From df5c495e8ffa8711873300146a8e9a18c16c8ea1 Mon Sep 17 00:00:00 2001
From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com>
Date: Fri, 26 Jul 2024 16:06:40 +0530
Subject: [PATCH] Remove APPWRITE_API_KEY and add scopes
---
app/config/functionTemplates.php | 335 ++++---------------------------
1 file changed, 36 insertions(+), 299 deletions(-)
diff --git a/app/config/functionTemplates.php b/app/config/functionTemplates.php
index e00db3e44e..940229b83c 100644
--- a/app/config/functionTemplates.php
+++ b/app/config/functionTemplates.php
@@ -81,16 +81,8 @@ return [
'providerRepositoryId' => 'templates',
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
- 'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => false,
- 'type' => 'password'
- ]
- ]
+ 'variables' => [],
+ 'scopes' => ["users.read"]
],
[
'icon' => 'icon-upstash',
@@ -620,22 +612,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The API endpoint of the Appwrite. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database to store the short URLs. Learn more.',
@@ -660,7 +636,8 @@ return [
'required' => true,
'type' => 'url'
]
- ]
+ ],
+ 'scopes' => ["databases.read", "databases.write", "collections.write", "attributes.write", "documents.read", "documents.write"]
],
[
'icon' => 'icon-algolia',
@@ -698,14 +675,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the Appwrite database that contains the collection to sync. Learn more.',
@@ -748,15 +717,8 @@ return [
'required' => true,
'type' => 'password'
],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ]
- ]
+ ],
+ 'scopes' => ["databases.read", "collections.read", "documents.read"]
],
[
'icon' => 'icon-meilisearch',
@@ -806,14 +768,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the Appwrite database that contains the collection to sync. Learn more.',
@@ -856,15 +810,8 @@ return [
'required' => true,
'type' => 'text'
],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ]
- ]
+ ],
+ 'scopes' => ["databases.read", "collections.read", "documents.read"]
],
[
'icon' => 'icon-vonage',
@@ -1112,22 +1059,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'STRIPE_SECRET_KEY',
'description' => 'Secret for sending requests to the Stripe API. Learn more.',
@@ -1142,7 +1073,8 @@ return [
'required' => true,
'type' => 'password'
]
- ]
+ ],
+ 'scopes' => ["users.read", "sessions.write", "users.write"]
],
[
'icon' => 'icon-stripe',
@@ -1168,22 +1100,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'STRIPE_SECRET_KEY',
'description' => 'Secret for sending requests to the Stripe API. Learn more.',
@@ -1214,7 +1130,8 @@ return [
'required' => false,
'type' => 'text'
]
- ]
+ ],
+ 'scopes' => ["databases.read", "databases.write", "collections.write", "attributes.write", "documents.read", "documents.write"]
],
[
'icon' => 'icon-chat',
@@ -1306,22 +1223,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the responses are stored. Learn more.',
@@ -1353,7 +1254,8 @@ return [
'required' => true,
'type' => 'password'
]
- ]
+ ],
+ 'scopes' => ["databases.read", "databases.write", "collections.read", "collections.write", "attributes.write", "documents.read", "documents.write", "buckets.read", "buckets.write", "files.read"]
],
[
'icon' => 'icon-eye',
@@ -1379,22 +1281,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the responses are stored. Learn more.',
@@ -1426,7 +1312,8 @@ return [
'required' => true,
'type' => 'password'
]
- ]
+ ],
+ "scopes" => ["databases.read", "databases.write", "collections.read", "collections.write", "attributes.write", "documents.read", "documents.write", "buckets.read", "buckets.write", "files.read"]
],
[
'icon' => 'icon-text',
@@ -1452,22 +1339,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the responses are stored. Learn more.',
@@ -1499,7 +1370,8 @@ return [
'required' => true,
'type' => 'password'
]
- ]
+ ],
+ "scopes" => ["databases.read", "databases.write", "collections.read", "collections.write", "attributes.write", "documents.read", "documents.write", "buckets.read", "buckets.write", "files.read"]
],
[
'icon' => 'icon-chat',
@@ -1525,22 +1397,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the responses are stored. Learn more.',
@@ -1572,7 +1428,8 @@ return [
'required' => true,
'type' => 'password'
]
- ]
+ ],
+ "scopes" => ["buckets.read", "buckets.write", "files.read", "files.write"]
],
[
'icon' => 'icon-chip',
@@ -1640,22 +1497,6 @@ return [
'required' => true,
'type' => 'password'
],
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_BUCKET_ID',
'description' => 'The ID of the bucket where audio is stored. Learn more.',
@@ -1663,7 +1504,8 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["buckets.write", "files.read", "files.write"]
],
[
'icon' => 'icon-chip',
@@ -1785,22 +1627,6 @@ return [
'required' => true,
'type' => 'text'
],
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the documents are stored. Learn more.',
@@ -1815,7 +1641,8 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["databases.read", "collections.read", "documents.read"]
],
[
'icon' => 'icon-chip',
@@ -1863,22 +1690,6 @@ return [
'required' => true,
'type' => 'text'
],
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the documents are stored. Learn more.',
@@ -1893,7 +1704,8 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["databases.read", "collections.read", "documents.read"]
],
[
'icon' => 'icon-chat',
@@ -1926,22 +1738,6 @@ return [
'required' => true,
'type' => 'password'
],
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database where the responses are stored. Learn more.',
@@ -1963,7 +1759,8 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["buckets.read", "buckets.write", "files.read", "files.write"]
],
[
'icon' => 'icon-chip',
@@ -1996,22 +1793,6 @@ return [
'required' => true,
'type' => 'password'
],
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_BUCKET_ID',
'description' => 'The ID of the bucket where audio is stored. Learn more.',
@@ -2019,7 +1800,8 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["buckets.read", "buckets.write", "files.read", "files.write"]
],
[
'icon' => 'icon-chip',
@@ -2085,22 +1867,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_BUCKET_ID',
'description' => 'The ID of the bucket where generated music is stored. Learn more.',
@@ -2116,7 +1882,8 @@ return [
'required' => true,
'type' => 'password'
]
- ]
+ ],
+ "scopes" => ["buckets.read", "buckets.write", "files.read", "files.write"]
],
[
'icon' => 'icon-chip',
@@ -2176,22 +1943,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'LEMON_SQUEEZY_API_KEY',
'description' => 'API key for sending requests to the Lemon Squeezy API. Learn more.',
@@ -2220,7 +1971,8 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["users.read", "users.write"]
],
[
'icon' => 'icon-currency-dollar',
@@ -2246,22 +1998,6 @@ return [
'providerOwner' => 'appwrite',
'providerBranch' => 'main',
'variables' => [
- [
- 'name' => 'APPWRITE_API_KEY',
- 'description' => 'The API Key to authenticate against Appwrite\'s Server APIs. Learn more.',
- 'value' => '',
- 'placeholder' => 'd1efb...aec35',
- 'required' => true,
- 'type' => 'password'
- ],
- [
- 'name' => 'APPWRITE_ENDPOINT',
- 'description' => 'The URL endpoint of the Appwrite server. Learn more.',
- 'value' => 'https://cloud.appwrite.io/v1',
- 'placeholder' => 'https://cloud.appwrite.io/v1',
- 'required' => false,
- 'type' => 'url'
- ],
[
'name' => 'APPWRITE_DATABASE_ID',
'description' => 'The ID of the database to store paid orders. Learn more.',
@@ -2306,6 +2042,7 @@ return [
'required' => true,
'type' => 'text'
]
- ]
+ ],
+ "scopes" => ["users.read", "users.write"]
]
];