From 655cc593762fbba9bdb811028fba48d600c27802 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Mar 2021 17:51:17 +0545 Subject: [PATCH 01/29] deno getting started --- docs/sdks/deno/GETTING_STARTED.md | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/sdks/deno/GETTING_STARTED.md diff --git a/docs/sdks/deno/GETTING_STARTED.md b/docs/sdks/deno/GETTING_STARTED.md new file mode 100644 index 0000000000..9c9698e7c2 --- /dev/null +++ b/docs/sdks/deno/GETTING_STARTED.md @@ -0,0 +1,60 @@ +## Getting Started + +### Init your SDK +Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from previous phase. + +```typescript +let client = new sdk.Client(); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +``` + +### Make your first request + +Once your SDK object is set, create any of the Appwrite service project objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section. + +```typescript +let users = new sdk.Users(client); + +let promise = users.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); +``` + +### Full Example +```typescript +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +let client = new sdk.Client(); +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); +``` + +### Learn more +You can use followng resources to learn more and get help +- ๐Ÿš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) +- ๐Ÿ“œ [Appwrite Docs](https://appwrite.io/docs) +- ๐Ÿ’ฌ [Discord Community](https://appwrite.io/discord) +- ๐Ÿš‚ [Appwrite Deno Playground](https://github.com/appwrite/playground-for-deno) \ No newline at end of file From 4d9e021eb27ebd309a7801fb6b54501cb59cc68f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Mar 2021 10:35:27 +0545 Subject: [PATCH 02/29] corrections --- docs/sdks/deno/GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdks/deno/GETTING_STARTED.md b/docs/sdks/deno/GETTING_STARTED.md index 9c9698e7c2..2b27d950fc 100644 --- a/docs/sdks/deno/GETTING_STARTED.md +++ b/docs/sdks/deno/GETTING_STARTED.md @@ -1,7 +1,7 @@ ## Getting Started ### Init your SDK -Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from previous phase. +Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from project's API keys section. ```typescript let client = new sdk.Client(); @@ -57,4 +57,4 @@ You can use followng resources to learn more and get help - ๐Ÿš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) - ๐Ÿ“œ [Appwrite Docs](https://appwrite.io/docs) - ๐Ÿ’ฌ [Discord Community](https://appwrite.io/discord) -- ๐Ÿš‚ [Appwrite Deno Playground](https://github.com/appwrite/playground-for-deno) \ No newline at end of file +- ๐Ÿš‚ [Appwrite Deno Playground](https://github.com/appwrite/playground-for-deno) From 82e1ceb8a93f928b08e5a0af293bd9c9fa53fe79 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Mar 2021 18:29:20 +0545 Subject: [PATCH 03/29] fix grammar --- docs/sdks/deno/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/deno/GETTING_STARTED.md b/docs/sdks/deno/GETTING_STARTED.md index 2b27d950fc..f0b10ed375 100644 --- a/docs/sdks/deno/GETTING_STARTED.md +++ b/docs/sdks/deno/GETTING_STARTED.md @@ -16,7 +16,7 @@ client ### Make your first request -Once your SDK object is set, create any of the Appwrite service project objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section. +Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section. ```typescript let users = new sdk.Users(client); From 77e4eefc00eddc72e0ca5db18706fd7e40ad09cd Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Thu, 18 Mar 2021 00:55:36 +0200 Subject: [PATCH 04/29] Fix for head requests --- composer.json | 2 +- composer.lock | 274 +++++++++++++++++++++++++++++++------------------- 2 files changed, 173 insertions(+), 103 deletions(-) diff --git a/composer.json b/composer.json index d4135536dd..66bb66f518 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "appwrite/php-clamav": "1.0.*", - "utopia-php/framework": "0.10.0", + "utopia-php/framework": "0.12.*", "utopia-php/abuse": "0.3.*", "utopia-php/analytics": "0.1.*", "utopia-php/audit": "0.5.*", diff --git a/composer.lock b/composer.lock index 18832a1a81..5a90ba3b6c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3463ecea7830f29a67317097ad2aeb66", + "content-hash": "00a80774fb5a4984181b29f2f037a0e5", "packages": [ { "name": "adhocore/jwt", @@ -360,16 +360,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.2.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79" + "reference": "01129f635f45659fd4764a533777d069a978bc9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/01129f635f45659fd4764a533777d069a978bc9d", + "reference": "01129f635f45659fd4764a533777d069a978bc9d", "shasum": "" }, "require": { @@ -393,10 +393,11 @@ "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.1-dev" + "dev-master": "7.3-dev" } }, "autoload": { @@ -438,7 +439,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.2.0" + "source": "https://github.com/guzzle/guzzle/tree/master" }, "funding": [ { @@ -458,7 +459,7 @@ "type": "github" } ], - "time": "2020-10-10T11:47:56+00:00" + "time": "2021-03-15T07:56:29+00:00" }, { "name": "guzzlehttp/promises", @@ -522,12 +523,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "d7fe0a0eabc266c3dcf2f20aa12121044ff196a4" + "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/d7fe0a0eabc266c3dcf2f20aa12121044ff196a4", - "reference": "d7fe0a0eabc266c3dcf2f20aa12121044ff196a4", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a67cdbf85690e54a7b92fe91c297b20d2607c0b2", + "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2", "shasum": "" }, "require": { @@ -589,7 +590,7 @@ "issues": "https://github.com/guzzle/psr7/issues", "source": "https://github.com/guzzle/psr7/tree/1.x" }, - "time": "2021-03-09T14:42:40+00:00" + "time": "2021-03-15T11:15:53+00:00" }, { "name": "influxdb/influxdb-php", @@ -1642,16 +1643,16 @@ }, { "name": "utopia-php/framework", - "version": "0.10.0", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "65909bdb24ef6b6c6751abfdea90caf96bbc6c50" + "reference": "ba17789a16527d24b4fb11ddc359901a295fbf2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/65909bdb24ef6b6c6751abfdea90caf96bbc6c50", - "reference": "65909bdb24ef6b6c6751abfdea90caf96bbc6c50", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/ba17789a16527d24b4fb11ddc359901a295fbf2f", + "reference": "ba17789a16527d24b4fb11ddc359901a295fbf2f", "shasum": "" }, "require": { @@ -1685,9 +1686,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.10.0" + "source": "https://github.com/utopia-php/framework/tree/0.12.1" }, - "time": "2020-12-26T12:02:39+00:00" + "time": "2021-03-17T22:14:05+00:00" }, { "name": "utopia-php/image", @@ -1952,16 +1953,16 @@ }, { "name": "utopia-php/swoole", - "version": "0.2.1", + "version": "0.2.2", "source": { "type": "git", "url": "https://github.com/utopia-php/swoole.git", - "reference": "63168a82037f371516a199d75da101c8caa3edc1" + "reference": "17510e90499e73273245c534a05bca522d4ffb37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/swoole/zipball/63168a82037f371516a199d75da101c8caa3edc1", - "reference": "63168a82037f371516a199d75da101c8caa3edc1", + "url": "https://api.github.com/repos/utopia-php/swoole/zipball/17510e90499e73273245c534a05bca522d4ffb37", + "reference": "17510e90499e73273245c534a05bca522d4ffb37", "shasum": "" }, "require": { @@ -2002,9 +2003,9 @@ ], "support": { "issues": "https://github.com/utopia-php/swoole/issues", - "source": "https://github.com/utopia-php/swoole/tree/0.2.1" + "source": "https://github.com/utopia-php/swoole/tree/0.2.2" }, - "time": "2021-02-10T06:20:43+00:00" + "time": "2021-03-17T22:51:07+00:00" }, { "name": "utopia-php/system", @@ -3374,16 +3375,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.12.2", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", "shasum": "" }, "require": { @@ -3435,9 +3436,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.12.2" + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" }, - "time": "2020-12-19T10:15:11+00:00" + "time": "2021-03-17T13:42:18+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3522,12 +3523,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "be176a771658571c68e432ef2b92766323500396" + "reference": "b2ce4cf415b9989fac88e8c27c39b5ba2faad72b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/be176a771658571c68e432ef2b92766323500396", - "reference": "be176a771658571c68e432ef2b92766323500396", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/b2ce4cf415b9989fac88e8c27c39b5ba2faad72b", + "reference": "b2ce4cf415b9989fac88e8c27c39b5ba2faad72b", "shasum": "" }, "require": { @@ -3575,7 +3576,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:26+00:00" + "time": "2021-03-17T06:17:19+00:00" }, { "name": "phpunit/php-invoker", @@ -3583,12 +3584,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "7d0466dfe8d95401153dbd342a68d2dc5f97aa65" + "reference": "e2905d5648ac5e9bd0aa85b50d240e5890f76493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7d0466dfe8d95401153dbd342a68d2dc5f97aa65", - "reference": "7d0466dfe8d95401153dbd342a68d2dc5f97aa65", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/e2905d5648ac5e9bd0aa85b50d240e5890f76493", + "reference": "e2905d5648ac5e9bd0aa85b50d240e5890f76493", "shasum": "" }, "require": { @@ -3639,7 +3640,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:32+00:00" + "time": "2021-03-17T06:17:27+00:00" }, { "name": "phpunit/php-text-template", @@ -3647,12 +3648,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "937d542664c42822dc8da4c41b096b44926b35ef" + "reference": "e6a2483ffd3659d723996fb8b2ca638244b87e7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/937d542664c42822dc8da4c41b096b44926b35ef", - "reference": "937d542664c42822dc8da4c41b096b44926b35ef", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e6a2483ffd3659d723996fb8b2ca638244b87e7c", + "reference": "e6a2483ffd3659d723996fb8b2ca638244b87e7c", "shasum": "" }, "require": { @@ -3699,7 +3700,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:57+00:00" + "time": "2021-03-17T06:17:59+00:00" }, { "name": "phpunit/php-timer", @@ -3707,12 +3708,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "c2e5a4f63ab592d38a758be6b8655f12b8ab0e94" + "reference": "c0187813193d3709a455b94916bbee2881a1c6e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c2e5a4f63ab592d38a758be6b8655f12b8ab0e94", - "reference": "c2e5a4f63ab592d38a758be6b8655f12b8ab0e94", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c0187813193d3709a455b94916bbee2881a1c6e3", + "reference": "c0187813193d3709a455b94916bbee2881a1c6e3", "shasum": "" }, "require": { @@ -3759,7 +3760,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:39+00:00" + "time": "2021-03-17T06:17:35+00:00" }, { "name": "phpunit/phpunit", @@ -3918,12 +3919,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "dd99fa1f5e462d834febfd531068e79b94f63826" + "reference": "845853b8c553f6b61d9a708b8f26066806bcc7dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/dd99fa1f5e462d834febfd531068e79b94f63826", - "reference": "dd99fa1f5e462d834febfd531068e79b94f63826", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/845853b8c553f6b61d9a708b8f26066806bcc7dd", + "reference": "845853b8c553f6b61d9a708b8f26066806bcc7dd", "shasum": "" }, "require": { @@ -3967,7 +3968,7 @@ "type": "github" } ], - "time": "2021-03-12T06:36:17+00:00" + "time": "2021-03-17T06:18:24+00:00" }, { "name": "sebastian/code-unit", @@ -4031,12 +4032,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "2e341ac378f28444e8d5a9b1ca878f3e10d095c5" + "reference": "ab4d610891809670894a4fc260c17e5d5960ba4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/2e341ac378f28444e8d5a9b1ca878f3e10d095c5", - "reference": "2e341ac378f28444e8d5a9b1ca878f3e10d095c5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ab4d610891809670894a4fc260c17e5d5960ba4c", + "reference": "ab4d610891809670894a4fc260c17e5d5960ba4c", "shasum": "" }, "require": { @@ -4079,7 +4080,7 @@ "type": "github" } ], - "time": "2021-03-12T06:34:30+00:00" + "time": "2021-03-17T06:16:16+00:00" }, { "name": "sebastian/comparator", @@ -4087,12 +4088,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "da86fed339815cda8c93d24184902837e46f3dcf" + "reference": "d3d66b8faa86ac57e1236d576ad003f73097c9cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/da86fed339815cda8c93d24184902837e46f3dcf", - "reference": "da86fed339815cda8c93d24184902837e46f3dcf", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d3d66b8faa86ac57e1236d576ad003f73097c9cd", + "reference": "d3d66b8faa86ac57e1236d576ad003f73097c9cd", "shasum": "" }, "require": { @@ -4154,7 +4155,7 @@ "type": "github" } ], - "time": "2021-03-12T06:34:37+00:00" + "time": "2021-03-17T06:16:24+00:00" }, { "name": "sebastian/complexity", @@ -4219,12 +4220,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "d6a6f22f17c5a6c7454eedc4d202aad1bcd69f97" + "reference": "e81849c6dfbe34442b4685fa457fd6f012370e54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/d6a6f22f17c5a6c7454eedc4d202aad1bcd69f97", - "reference": "d6a6f22f17c5a6c7454eedc4d202aad1bcd69f97", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e81849c6dfbe34442b4685fa457fd6f012370e54", + "reference": "e81849c6dfbe34442b4685fa457fd6f012370e54", "shasum": "" }, "require": { @@ -4278,7 +4279,7 @@ "type": "github" } ], - "time": "2021-03-12T06:34:45+00:00" + "time": "2021-03-17T06:16:31+00:00" }, { "name": "sebastian/environment", @@ -4286,12 +4287,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "2b55055f427dd8c7274b87f8fcebeca063553827" + "reference": "c25633688d84a9f8694989223479051b5a8a23e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2b55055f427dd8c7274b87f8fcebeca063553827", - "reference": "2b55055f427dd8c7274b87f8fcebeca063553827", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c25633688d84a9f8694989223479051b5a8a23e7", + "reference": "c25633688d84a9f8694989223479051b5a8a23e7", "shasum": "" }, "require": { @@ -4342,7 +4343,7 @@ "type": "github" } ], - "time": "2021-03-12T06:34:52+00:00" + "time": "2021-03-17T06:16:40+00:00" }, { "name": "sebastian/exporter", @@ -4350,12 +4351,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "eac28a6ba06c1d2f4592caab3ecb5a573719dead" + "reference": "9119858d42f3963d01b737f029bb90f8464fd0ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/eac28a6ba06c1d2f4592caab3ecb5a573719dead", - "reference": "eac28a6ba06c1d2f4592caab3ecb5a573719dead", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/9119858d42f3963d01b737f029bb90f8464fd0ca", + "reference": "9119858d42f3963d01b737f029bb90f8464fd0ca", "shasum": "" }, "require": { @@ -4420,7 +4421,7 @@ "type": "github" } ], - "time": "2021-03-12T06:34:58+00:00" + "time": "2021-03-17T06:16:48+00:00" }, { "name": "sebastian/global-state", @@ -4428,12 +4429,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "fdc815035b99d311787aaddee356bcdbfdacd264" + "reference": "fe610de5530e3d29007134f76ee8dc79581a607d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/fdc815035b99d311787aaddee356bcdbfdacd264", - "reference": "fdc815035b99d311787aaddee356bcdbfdacd264", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/fe610de5530e3d29007134f76ee8dc79581a607d", + "reference": "fe610de5530e3d29007134f76ee8dc79581a607d", "shasum": "" }, "require": { @@ -4485,7 +4486,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:06+00:00" + "time": "2021-03-17T06:16:56+00:00" }, { "name": "sebastian/lines-of-code", @@ -4550,12 +4551,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "cc061578620fe00922c20aa0f563cc48c7260867" + "reference": "01ab82e49081de59e2da70c351d5f698c77c33c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/cc061578620fe00922c20aa0f563cc48c7260867", - "reference": "cc061578620fe00922c20aa0f563cc48c7260867", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/01ab82e49081de59e2da70c351d5f698c77c33c5", + "reference": "01ab82e49081de59e2da70c351d5f698c77c33c5", "shasum": "" }, "require": { @@ -4600,7 +4601,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:13+00:00" + "time": "2021-03-17T06:17:03+00:00" }, { "name": "sebastian/object-reflector", @@ -4608,12 +4609,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "c792bcd052c3290774390afd13c19bb3a96b94e6" + "reference": "7ed67aee59862b40785138f0203e86f1fde1b93a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/c792bcd052c3290774390afd13c19bb3a96b94e6", - "reference": "c792bcd052c3290774390afd13c19bb3a96b94e6", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/7ed67aee59862b40785138f0203e86f1fde1b93a", + "reference": "7ed67aee59862b40785138f0203e86f1fde1b93a", "shasum": "" }, "require": { @@ -4656,7 +4657,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:20+00:00" + "time": "2021-03-17T06:17:11+00:00" }, { "name": "sebastian/recursion-context", @@ -4664,12 +4665,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "c07d99ada2b8e6e5ade4c2522af54b0f3c796387" + "reference": "249976376508ed7e83b6dc429cd883a44b2a3c51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c07d99ada2b8e6e5ade4c2522af54b0f3c796387", - "reference": "c07d99ada2b8e6e5ade4c2522af54b0f3c796387", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/249976376508ed7e83b6dc429cd883a44b2a3c51", + "reference": "249976376508ed7e83b6dc429cd883a44b2a3c51", "shasum": "" }, "require": { @@ -4720,7 +4721,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:45+00:00" + "time": "2021-03-17T06:17:43+00:00" }, { "name": "sebastian/resource-operations", @@ -4784,12 +4785,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "3bbff26dad4e0aadda7d8a0b598b903fbef6c3e6" + "reference": "e02c851008e26557b4f1b4ffd139b71c96937b04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3bbff26dad4e0aadda7d8a0b598b903fbef6c3e6", - "reference": "3bbff26dad4e0aadda7d8a0b598b903fbef6c3e6", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/e02c851008e26557b4f1b4ffd139b71c96937b04", + "reference": "e02c851008e26557b4f1b4ffd139b71c96937b04", "shasum": "" }, "require": { @@ -4833,7 +4834,7 @@ "type": "github" } ], - "time": "2021-03-12T06:35:51+00:00" + "time": "2021-03-17T06:17:51+00:00" }, { "name": "sebastian/version", @@ -4932,16 +4933,17 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e8bee16c337d9553fb737adf79d6aabe330fd982" + "reference": "36e4ff2188cb5af6e6e94560b4aaa8042933aa58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e8bee16c337d9553fb737adf79d6aabe330fd982", - "reference": "e8bee16c337d9553fb737adf79d6aabe330fd982", + "url": "https://api.github.com/repos/symfony/console/zipball/36e4ff2188cb5af6e6e94560b4aaa8042933aa58", + "reference": "36e4ff2188cb5af6e6e94560b4aaa8042933aa58", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", "symfony/polyfill-php80": "^1.15", @@ -5022,7 +5024,75 @@ "type": "tidelift" } ], - "time": "2021-03-12T08:40:58+00:00" + "time": "2021-03-17T16:56:09+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "49dc45a74cbac5fffc6417372a9f5ae1682ca0b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/49dc45a74cbac5fffc6417372a9f5ae1682ca0b4", + "reference": "49dc45a74cbac5fffc6417372a9f5ae1682ca0b4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/main" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-25T16:38:04+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -5442,12 +5512,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "96cd360b9f03a22a30cf5354e630c557bd3aac33" + "reference": "3d72b4bfab3e991aa66906aa301aa479de4ca6ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/96cd360b9f03a22a30cf5354e630c557bd3aac33", - "reference": "96cd360b9f03a22a30cf5354e630c557bd3aac33", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/3d72b4bfab3e991aa66906aa301aa479de4ca6ee", + "reference": "3d72b4bfab3e991aa66906aa301aa479de4ca6ee", "shasum": "" }, "require": { @@ -5514,7 +5584,7 @@ "type": "tidelift" } ], - "time": "2021-03-05T22:51:52+00:00" + "time": "2021-03-16T09:10:58+00:00" }, { "name": "symfony/string", @@ -5522,12 +5592,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "6d830fae00e2bb336074eae141bb00db36cd3551" + "reference": "01454c66c88a6bb4449dcdeb913e463e075f331b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/6d830fae00e2bb336074eae141bb00db36cd3551", - "reference": "6d830fae00e2bb336074eae141bb00db36cd3551", + "url": "https://api.github.com/repos/symfony/string/zipball/01454c66c88a6bb4449dcdeb913e463e075f331b", + "reference": "01454c66c88a6bb4449dcdeb913e463e075f331b", "shasum": "" }, "require": { @@ -5598,7 +5668,7 @@ "type": "tidelift" } ], - "time": "2021-02-17T15:27:35+00:00" + "time": "2021-03-17T17:12:23+00:00" }, { "name": "theseer/tokenizer", From 185970a123101c5b702e63e03fd2331703009700 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 18 Mar 2021 17:07:12 +0545 Subject: [PATCH 05/29] fix workers for redis - user can be null --- bin/schedule | 2 +- bin/worker-audits | 2 +- bin/worker-certificates | 2 +- bin/worker-deletes | 2 +- bin/worker-functions | 2 +- bin/worker-mails | 2 +- bin/worker-tasks | 2 +- bin/worker-usage | 2 +- bin/worker-webhooks | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/schedule b/bin/schedule index 857ec9f6ff..6300d97edf 100644 --- a/bin/schedule +++ b/bin/schedule @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-audits b/bin/worker-audits index e411aa386f..8e99481d25 100644 --- a/bin/worker-audits +++ b/bin/worker-audits @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-certificates b/bin/worker-certificates index 7d474e1ead..9214af513d 100755 --- a/bin/worker-certificates +++ b/bin/worker-certificates @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-deletes b/bin/worker-deletes index 9c2fb3118e..517f755304 100644 --- a/bin/worker-deletes +++ b/bin/worker-deletes @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-functions b/bin/worker-functions index b41c019942..29cd4b85cb 100644 --- a/bin/worker-functions +++ b/bin/worker-functions @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-mails b/bin/worker-mails index 64d10f6099..a663942624 100644 --- a/bin/worker-mails +++ b/bin/worker-mails @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-tasks b/bin/worker-tasks index fc395b34ab..bac1f54a83 100644 --- a/bin/worker-tasks +++ b/bin/worker-tasks @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-usage b/bin/worker-usage index 4176f54b86..9cb9b5ed86 100644 --- a/bin/worker-usage +++ b/bin/worker-usage @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else diff --git a/bin/worker-webhooks b/bin/worker-webhooks index 13029ecbd9..4ae2fadaa9 100644 --- a/bin/worker-webhooks +++ b/bin/worker-webhooks @@ -1,6 +1,6 @@ #!/bin/sh -if [ -z "$_APP_REDIS_USER" ] || [ -z "$_APP_REDIS_PASS" ] +if [ -z "$_APP_REDIS_USER" ] && [ -z "$_APP_REDIS_PASS" ] then REDIS_BACKEND="${_APP_REDIS_HOST}:${_APP_REDIS_PORT}" else From d8990fba9978d7fd2fa75191809a4f7cea4d4709 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Thu, 18 Mar 2021 08:11:23 -0400 Subject: [PATCH 06/29] Upgrade utopia-php/abuse to version 0.4.0 --- CHANGES.md | 4 ++++ composer.json | 2 +- composer.lock | 16 ++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e4b9279a15..1b36e78e5c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ - Anonymous login +## Upgrades + +- Upgraded utopia-php/abuse to version 0.4.0 + # Version 0.7.1 ## Features diff --git a/composer.json b/composer.json index d4135536dd..0cd8016d57 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "appwrite/php-clamav": "1.0.*", "utopia-php/framework": "0.10.0", - "utopia-php/abuse": "0.3.*", + "utopia-php/abuse": "0.4.*", "utopia-php/analytics": "0.1.*", "utopia-php/audit": "0.5.*", "utopia-php/cache": "0.2.*", diff --git a/composer.lock b/composer.lock index 18832a1a81..a6e9fc1989 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3463ecea7830f29a67317097ad2aeb66", + "content-hash": "15b6e4ddce09e6fb642988603d734aa8", "packages": [ { "name": "adhocore/jwt", @@ -1272,21 +1272,21 @@ }, { "name": "utopia-php/abuse", - "version": "0.3.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "23c2eb533bca8f3ef5548ae265398fa7d4d39a1c" + "reference": "2b8cc40a67c045c137b44d1a11326f494acf50a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/23c2eb533bca8f3ef5548ae265398fa7d4d39a1c", - "reference": "23c2eb533bca8f3ef5548ae265398fa7d4d39a1c", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/2b8cc40a67c045c137b44d1a11326f494acf50a4", + "reference": "2b8cc40a67c045c137b44d1a11326f494acf50a4", "shasum": "" }, "require": { "ext-pdo": "*", - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { "phpunit/phpunit": "^9.4", @@ -1318,9 +1318,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.3.1" + "source": "https://github.com/utopia-php/abuse/tree/0.4.0" }, - "time": "2020-12-21T17:28:03+00:00" + "time": "2021-03-17T20:21:24+00:00" }, { "name": "utopia-php/analytics", From 11053b0b60ba67a7afa6ad250875f2cca44c04c8 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 19 Mar 2021 00:08:19 +0200 Subject: [PATCH 07/29] Added timestamp --- app/controllers/general.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/general.php b/app/controllers/general.php index fe00160388..18e1ab1bb1 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -256,6 +256,8 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { $template = ($route) ? $route->getLabel('error', null) : null; if (php_sapi_name() === 'cli') { + Console::error('[Error] Timestamp: '.date('c', time())); + if($route) { Console::error('[Error] Method: '.$route->getMethod()); Console::error('[Error] URL: '.$route->getURL()); From 1dfb18fc1b769b694cade12793f85335d3e523e0 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 19 Mar 2021 00:11:37 +0200 Subject: [PATCH 08/29] Upgraded ClamAV --- CHANGES.md | 4 ++++ app/views/install/compose.phtml | 2 +- docker-compose.yml | 2 +- tests/resources/docker/docker-compose.yml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e4b9279a15..cc086bb103 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ - Anonymous login +## Upgrades + +- Upgraded ClamAV to version 1.3.0 + # Version 0.7.1 ## Features diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 1c0c98108f..fdbfff2c5d 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -352,7 +352,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.2.0 + image: appwrite/clamav:1.3.0 container_name: appwrite-clamav restart: unless-stopped networks: diff --git a/docker-compose.yml b/docker-compose.yml index c4ad29c643..217d67a705 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -414,7 +414,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.2.0 + image: appwrite/clamav:1.3.0 container_name: appwrite-clamav networks: - appwrite diff --git a/tests/resources/docker/docker-compose.yml b/tests/resources/docker/docker-compose.yml index 9f4074c540..c9e4ea3d48 100644 --- a/tests/resources/docker/docker-compose.yml +++ b/tests/resources/docker/docker-compose.yml @@ -327,7 +327,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.2.0 + image: appwrite/clamav:1.3.0 container_name: appwrite-clamav restart: unless-stopped networks: From 7443bcf2d81535cd50d7034816dcae8f3cb51f13 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 20 Mar 2021 08:23:42 +0200 Subject: [PATCH 09/29] Disabled ClamAV from tests (for now) --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 581af6d978..30bacb2a83 100644 --- a/.env +++ b/.env @@ -16,7 +16,7 @@ _APP_DB_PORT=3306 _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password -_APP_STORAGE_ANTIVIRUS=enabled +_APP_STORAGE_ANTIVIRUS=disabled _APP_STORAGE_ANTIVIRUS_HOST=clamav _APP_STORAGE_ANTIVIRUS_PORT=3310 _APP_INFLUXDB_HOST=influxdb From 600692bcac36a7d6f3f64e2961d9a7e79f8698ce Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 20 Mar 2021 09:14:02 +0200 Subject: [PATCH 10/29] Fixed AV health check --- app/controllers/api/health.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 696247f3da..a4201d54d9 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -254,7 +254,10 @@ App::get('/v1/health/anti-virus') /** @var Appwrite\Utopia\Response $response */ if (App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'disabled') { // Check if scans are enabled - throw new Exception('Anitvirus is disabled'); + return $response->json([ + 'status' => 'disabled', + 'version' => '', + ]); } $antiVirus = new Network(App::getEnv('_APP_STORAGE_ANTIVIRUS_HOST', 'clamav'), From 50f97becd05c684aee7bfa53c55c0edc999071e6 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 20 Mar 2021 10:50:30 +0200 Subject: [PATCH 11/29] Fixed tests --- tests/e2e/Services/Health/HealthCustomServerTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Health/HealthCustomServerTest.php b/tests/e2e/Services/Health/HealthCustomServerTest.php index 5fe758e28c..ee1c4eeadc 100644 --- a/tests/e2e/Services/Health/HealthCustomServerTest.php +++ b/tests/e2e/Services/Health/HealthCustomServerTest.php @@ -234,8 +234,9 @@ class HealthCustomServerTest extends Scope ], $this->getHeaders()), []); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals('online', $response['body']['status']); - $this->assertStringStartsWith('ClamAV ', $response['body']['version']); + $this->assertNotEmpty($response['body']['status']); + $this->assertIsString($response['body']['status']); + $this->assertIsString($response['body']['version']); /** * Test for FAILURE From a5295a1c09d71e8d6226a02b548a65b718da95e9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 21 Mar 2021 20:11:05 +0545 Subject: [PATCH 12/29] test hook to print time --- tests/extensions/TestHook.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/extensions/TestHook.php diff --git a/tests/extensions/TestHook.php b/tests/extensions/TestHook.php new file mode 100644 index 0000000000..28c41486cd --- /dev/null +++ b/tests/extensions/TestHook.php @@ -0,0 +1,15 @@ + Date: Sun, 21 Mar 2021 20:12:37 +0545 Subject: [PATCH 13/29] test hook to print test result --- tests/extensions/TestHook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/extensions/TestHook.php b/tests/extensions/TestHook.php index 28c41486cd..240c6111d2 100644 --- a/tests/extensions/TestHook.php +++ b/tests/extensions/TestHook.php @@ -7,7 +7,7 @@ class TestHook implements AfterTestHook { public function executeAfterTest(string $test, float $time): void { - printf(" %s ended in %s seconds\n", + printf("\n%s ended in %s seconds", $test, $time ); From 6b8876a82ee45519f496bc6d8bae0ef0445cbf24 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 21 Mar 2021 20:12:50 +0545 Subject: [PATCH 14/29] enabling extension in phpunit --- phpunit.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index b0c8372720..ba4f4f496f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,6 +8,9 @@ processIsolation="false" stopOnFailure="false" > + + + ./tests/e2e/ From 9843d063f643b04d64ead734fb35d1363c0aa475 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 21 Mar 2021 20:13:03 +0545 Subject: [PATCH 15/29] autoloading test hook --- composer.json | 5 ++++- composer.lock | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 66bb66f518..ef472dc8fe 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,10 @@ } }, "autoload-dev": { - "psr-4": {"Tests\\E2E\\": "tests/e2e"} + "psr-4": { + "Tests\\E2E\\": "tests/e2e", + "Appwrite\\Tests\\": "tests/extensions" + } }, "require": { "php": ">=7.4.0", diff --git a/composer.lock b/composer.lock index 8b29ae44f8..e571d01404 100644 --- a/composer.lock +++ b/composer.lock @@ -364,12 +364,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "01129f635f45659fd4764a533777d069a978bc9d" + "reference": "f38085e434c6a8affe0d4ba8faa5303a0137566d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/01129f635f45659fd4764a533777d069a978bc9d", - "reference": "01129f635f45659fd4764a533777d069a978bc9d", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f38085e434c6a8affe0d4ba8faa5303a0137566d", + "reference": "f38085e434c6a8affe0d4ba8faa5303a0137566d", "shasum": "" }, "require": { @@ -383,6 +383,7 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", @@ -459,7 +460,7 @@ "type": "github" } ], - "time": "2021-03-15T07:56:29+00:00" + "time": "2021-03-21T12:52:42+00:00" }, { "name": "guzzlehttp/promises", @@ -523,12 +524,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2" + "reference": "72dde17f3154ea87cadea0b71e37493058d970ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a67cdbf85690e54a7b92fe91c297b20d2607c0b2", - "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/72dde17f3154ea87cadea0b71e37493058d970ce", + "reference": "72dde17f3154ea87cadea0b71e37493058d970ce", "shasum": "" }, "require": { @@ -590,7 +591,7 @@ "issues": "https://github.com/guzzle/psr7/issues", "source": "https://github.com/guzzle/psr7/tree/1.x" }, - "time": "2021-03-15T11:15:53+00:00" + "time": "2021-03-21T13:41:49+00:00" }, { "name": "influxdb/influxdb-php", @@ -2304,7 +2305,6 @@ "require-dev": { "phpunit/phpunit": "^7.0" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -5959,9 +5959,7 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "appwrite/sdk-generator": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { From b5846f5a79c2ed0849cdc0620432e056504788a1 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 22 Mar 2021 00:17:20 +0200 Subject: [PATCH 16/29] Updated default permissions --- app/controllers/api/database.php | 28 ++++++++++++++++------------ app/controllers/api/storage.php | 12 +++++++----- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index c386749ca9..e12088e507 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -169,8 +169,8 @@ App::put('/v1/database/collections/:collectionId') ->label('sdk.response.model', Response::MODEL_COLLECTION) ->param('collectionId', '', new UID(), 'Collection unique ID.') ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') - ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.') - ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('read', null, new ArrayList(new Text(64)), 'An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) + ->param('write', null, new ArrayList(new Text(64)), 'An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) ->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', true, ['projectDB']) ->inject('response') ->inject('projectDB') @@ -187,6 +187,8 @@ App::put('/v1/database/collections/:collectionId') } $parsedRules = []; + $read = (is_null($read)) ? ($collection->getPermissions()['read'] ?? []) : $read; // By default inherit read permissions + $write = (is_null($write)) ? ($collection->getPermissions()['write'] ?? []) : $write; // By default inherit write permissions foreach ($rules as &$rule) { $parsedRules[] = \array_merge([ @@ -295,17 +297,19 @@ App::post('/v1/database/collections/:collectionId/documents') ->label('sdk.response.model', Response::MODEL_ANY) ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') ->param('data', [], new JSON(), 'Document data as JSON object.') - ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('read', null, new ArrayList(new Text(64)), 'An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) + ->param('write', null, new ArrayList(new Text(64)), 'An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) ->param('parentDocument', '', new UID(), 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) ->param('parentProperty', '', new Key(), 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND], true), 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) ->inject('response') ->inject('projectDB') + ->inject('user') ->inject('audits') - ->action(function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType, $response, $projectDB, $audits) { + ->action(function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType, $response, $projectDB, $user, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Database\Document $user */ /** @var Appwrite\Event\Event $audits */ $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array @@ -326,8 +330,8 @@ App::post('/v1/database/collections/:collectionId/documents') $data['$collection'] = $collectionId; // Adding this param to make API easier for developers $data['$permissions'] = [ - 'read' => $read, - 'write' => $write, + 'read' => (is_null($read)) ? ['user:'.$user->getId()] : $read, // By default set read permissions for user + 'write' => (is_null($write)) ? ['user:'.$user->getId()] : $write, // By default set write permissions for user ]; // Read parent document + validate not 404 + validate read / write permission like patch method @@ -508,8 +512,8 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') ->param('documentId', null, new UID(), 'Document unique ID.') ->param('data', [], new JSON(), 'Document data as JSON object.') - ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('read', null, new ArrayList(new Text(64)), 'An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) + ->param('write', null, new ArrayList(new Text(64)), 'An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) ->inject('response') ->inject('projectDB') ->inject('audits') @@ -522,7 +526,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') $document = $projectDB->getDocument($documentId, false); $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array - + if (!\is_array($data)) { throw new Exception('Data param should be a valid JSON object', 400); } @@ -539,8 +543,8 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') $data['$collection'] = $collection->getId(); // Make sure user don't switch collectionID $data['$id'] = $document->getId(); // Make sure user don't switch document unique ID - $data['$permissions']['read'] = $read; - $data['$permissions']['write'] = $write; + $data['$permissions']['read'] = (is_null($read)) ? ($document->getPermissions()['read'] ?? []) : $read; // By default inherit read permissions + $data['$permissions']['write'] = (is_null($write)) ? ($document->getPermissions()['write'] ?? []) : $write; // By default inherit write permissions if (empty($data)) { throw new Exception('Missing payload', 400); diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index d4500e95aa..840d1ca4e0 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -38,17 +38,19 @@ App::post('/v1/storage/files') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_FILE) ->param('file', [], new File(), 'Binary file.', false) - ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('read', null, new ArrayList(new Text(64)), 'An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) + ->param('write', null, new ArrayList(new Text(64)), 'An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true) ->inject('request') ->inject('response') ->inject('projectDB') + ->inject('user') ->inject('audits') ->inject('usage') - ->action(function ($file, $read, $write, $request, $response, $projectDB, $audits, $usage) { + ->action(function ($file, $read, $write, $request, $response, $projectDB, $user, $audits, $usage) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Database\Document $user */ /** @var Appwrite\Event\Event $audits */ /** @var Appwrite\Event\Event $usage */ @@ -122,8 +124,8 @@ App::post('/v1/storage/files') $file = $projectDB->createDocument([ '$collection' => Database::SYSTEM_COLLECTION_FILES, '$permissions' => [ - 'read' => $read, - 'write' => $write, + 'read' => (is_null($read)) ? ['user:'.$user->getId()] : $read, // By default set read permissions for user + 'write' => (is_null($write)) ? ['user:'.$user->getId()] : $write, // By default write read permissions for user ], 'dateCreated' => \time(), 'folderId' => '', From e05da0ce3c9a030901f045aed0d176a2ae91a997 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 22 Mar 2021 00:26:00 +0200 Subject: [PATCH 17/29] Fixed comments --- app/controllers/api/storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 840d1ca4e0..82f37f9f6b 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -125,7 +125,7 @@ App::post('/v1/storage/files') '$collection' => Database::SYSTEM_COLLECTION_FILES, '$permissions' => [ 'read' => (is_null($read)) ? ['user:'.$user->getId()] : $read, // By default set read permissions for user - 'write' => (is_null($write)) ? ['user:'.$user->getId()] : $write, // By default write read permissions for user + 'write' => (is_null($write)) ? ['user:'.$user->getId()] : $write, // By default set write permissions for user ], 'dateCreated' => \time(), 'folderId' => '', From b7dec3a4f496cec006d8244c5f38adcd4938af4e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 22 Mar 2021 10:34:03 +0545 Subject: [PATCH 18/29] fix print line --- tests/extensions/TestHook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/extensions/TestHook.php b/tests/extensions/TestHook.php index 240c6111d2..a8d86304ef 100644 --- a/tests/extensions/TestHook.php +++ b/tests/extensions/TestHook.php @@ -7,7 +7,7 @@ class TestHook implements AfterTestHook { public function executeAfterTest(string $test, float $time): void { - printf("\n%s ended in %s seconds", + printf("%s ended in %s seconds\n", $test, $time ); From 46c465b80e53eb3f78e6f9f42f91aade199e11c1 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 22 Mar 2021 09:34:51 +0200 Subject: [PATCH 19/29] Added some fixes and dedicated tests --- app/controllers/api/database.php | 4 +- app/controllers/api/storage.php | 4 +- composer.lock | 122 +++++++++++++----- tests/e2e/Services/Database/DatabaseBase.php | 129 ++++++++++++++++++- 4 files changed, 223 insertions(+), 36 deletions(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index e12088e507..2c32ae981e 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -330,8 +330,8 @@ App::post('/v1/database/collections/:collectionId/documents') $data['$collection'] = $collectionId; // Adding this param to make API easier for developers $data['$permissions'] = [ - 'read' => (is_null($read)) ? ['user:'.$user->getId()] : $read, // By default set read permissions for user - 'write' => (is_null($write)) ? ['user:'.$user->getId()] : $write, // By default set write permissions for user + 'read' => (is_null($read) && !$user->isEmpty()) ? ['user:'.$user->getId()] : $read ?? [], // By default set read permissions for user + 'write' => (is_null($write) && !$user->isEmpty()) ? ['user:'.$user->getId()] : $write ?? [], // By default set write permissions for user ]; // Read parent document + validate not 404 + validate read / write permission like patch method diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 82f37f9f6b..f0ce2e4050 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -124,8 +124,8 @@ App::post('/v1/storage/files') $file = $projectDB->createDocument([ '$collection' => Database::SYSTEM_COLLECTION_FILES, '$permissions' => [ - 'read' => (is_null($read)) ? ['user:'.$user->getId()] : $read, // By default set read permissions for user - 'write' => (is_null($write)) ? ['user:'.$user->getId()] : $write, // By default set write permissions for user + 'read' => (is_null($read) && !$user->isEmpty()) ? ['user:'.$user->getId()] : $read ?? [], // By default set read permissions for user + 'write' => (is_null($write) && !$user->isEmpty()) ? ['user:'.$user->getId()] : $write ?? [], // By default set write permissions for user ], 'dateCreated' => \time(), 'folderId' => '', diff --git a/composer.lock b/composer.lock index 8b29ae44f8..3fa80281f1 100644 --- a/composer.lock +++ b/composer.lock @@ -364,18 +364,18 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "01129f635f45659fd4764a533777d069a978bc9d" + "reference": "98eeb955cbbe0e5d6f3f818e940c84f66aba427b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/01129f635f45659fd4764a533777d069a978bc9d", - "reference": "01129f635f45659fd4764a533777d069a978bc9d", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/98eeb955cbbe0e5d6f3f818e940c84f66aba427b", + "reference": "98eeb955cbbe0e5d6f3f818e940c84f66aba427b", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0" }, @@ -383,6 +383,7 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", @@ -459,7 +460,7 @@ "type": "github" } ], - "time": "2021-03-15T07:56:29+00:00" + "time": "2021-03-21T18:42:29+00:00" }, { "name": "guzzlehttp/promises", @@ -519,46 +520,47 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2" + "reference": "c0dcda9f54d145bd4d062a6d15f54931a67732f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a67cdbf85690e54a7b92fe91c297b20d2607c0b2", - "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c0dcda9f54d145bd4d062a6d15f54931a67732f9", + "reference": "c0dcda9f54d145bd4d062a6d15f54931a67732f9", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -573,6 +575,11 @@ { "name": "Tobias Schultze", "homepage": "https://github.com/Tobion" + }, + { + "name": "Mรกrk Sรกgi-Kazรกr", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -588,9 +595,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.x" + "source": "https://github.com/guzzle/psr7/tree/2.0.0-beta1" }, - "time": "2021-03-15T11:15:53+00:00" + "time": "2021-03-21T17:21:36+00:00" }, { "name": "influxdb/influxdb-php", @@ -906,6 +913,62 @@ }, "time": "2020-09-19T09:12:31+00:00" }, + { + "name": "psr/http-factory", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "36fa03d50ff82abcae81860bdaf4ed9a1510c7cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/36fa03d50ff82abcae81860bdaf4ed9a1510c7cd", + "reference": "36fa03d50ff82abcae81860bdaf4ed9a1510c7cd", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2020-09-17T16:52:55+00:00" + }, { "name": "psr/http-message", "version": "dev-master", @@ -1643,16 +1706,16 @@ }, { "name": "utopia-php/framework", - "version": "0.12.1", + "version": "0.12.2", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "ba17789a16527d24b4fb11ddc359901a295fbf2f" + "reference": "2264a3a3e212e50b9440b219fef3b4afcd2adf5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/ba17789a16527d24b4fb11ddc359901a295fbf2f", - "reference": "ba17789a16527d24b4fb11ddc359901a295fbf2f", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/2264a3a3e212e50b9440b219fef3b4afcd2adf5b", + "reference": "2264a3a3e212e50b9440b219fef3b4afcd2adf5b", "shasum": "" }, "require": { @@ -1686,9 +1749,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.12.1" + "source": "https://github.com/utopia-php/framework/tree/0.12.2" }, - "time": "2021-03-17T22:14:05+00:00" + "time": "2021-03-22T07:26:11+00:00" }, { "name": "utopia-php/image", @@ -2304,7 +2367,6 @@ "require-dev": { "phpunit/phpunit": "^7.0" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -5959,9 +6021,7 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "appwrite/sdk-generator": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 2b93485f16..eedd312fef 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -501,6 +501,133 @@ trait DatabaseBase $this->assertEquals($document['headers']['status-code'], 404); - return []; + return $data; + } + + /** + * @depends testDeleteDocument + */ + public function testDefaultPermissions(array $data):array + { + $document = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [], + ], + ]); + + $id = $document['body']['$id']; + + $this->assertEquals($document['headers']['status-code'], 201); + $this->assertEquals($document['body']['$collection'], $data['moviesId']); + $this->assertEquals($document['body']['name'], 'Captain America'); + $this->assertEquals($document['body']['releaseYear'], 1944); + $this->assertIsArray($document['body']['$permissions']); + $this->assertIsArray($document['body']['$permissions']['read']); + $this->assertIsArray($document['body']['$permissions']['write']); + + if($this->getSide() == 'client') { + $this->assertCount(1, $document['body']['$permissions']['read']); + $this->assertCount(1, $document['body']['$permissions']['write']); + $this->assertEquals(['user:'.$this->getUser()['$id']], $document['body']['$permissions']['read']); + $this->assertEquals(['user:'.$this->getUser()['$id']], $document['body']['$permissions']['write']); + } + + if($this->getSide() == 'server') { + $this->assertCount(0, $document['body']['$permissions']['read']); + $this->assertCount(0, $document['body']['$permissions']['write']); + $this->assertEquals([], $document['body']['$permissions']['read']); + $this->assertEquals([], $document['body']['$permissions']['write']); + } + + // Updated and Inherit Permissions + + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Captain America 2', + 'releaseYear' => 1945, + 'actors' => [], + ], + 'read' => ['*'], + ]); + + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertEquals($document['body']['name'], 'Captain America 2'); + $this->assertEquals($document['body']['releaseYear'], 1945); + + if($this->getSide() == 'client') { + $this->assertCount(1, $document['body']['$permissions']['read']); + $this->assertCount(1, $document['body']['$permissions']['write']); + $this->assertEquals(['*'], $document['body']['$permissions']['read']); + $this->assertEquals(['user:'.$this->getUser()['$id']], $document['body']['$permissions']['write']); + } + + if($this->getSide() == 'server') { + $this->assertCount(1, $document['body']['$permissions']['read']); + $this->assertCount(0, $document['body']['$permissions']['write']); + $this->assertEquals(['*'], $document['body']['$permissions']['read']); + $this->assertEquals([], $document['body']['$permissions']['write']); + } + + $document = $this->client->call(Client::METHOD_GET, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertEquals($document['body']['name'], 'Captain America 2'); + $this->assertEquals($document['body']['releaseYear'], 1945); + + if($this->getSide() == 'client') { + $this->assertCount(1, $document['body']['$permissions']['read']); + $this->assertCount(1, $document['body']['$permissions']['write']); + $this->assertEquals(['*'], $document['body']['$permissions']['read']); + $this->assertEquals(['user:'.$this->getUser()['$id']], $document['body']['$permissions']['write']); + } + + if($this->getSide() == 'server') { + $this->assertCount(1, $document['body']['$permissions']['read']); + $this->assertCount(0, $document['body']['$permissions']['write']); + $this->assertEquals(['*'], $document['body']['$permissions']['read']); + $this->assertEquals([], $document['body']['$permissions']['write']); + } + + // Reset Permissions + + $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Captain America 3', + 'releaseYear' => 1946, + 'actors' => [], + ], + 'read' => [], + 'write' => [], + ]); + + if($this->getSide() == 'client') { + $this->assertEquals($document['headers']['status-code'], 401); + } + + if($this->getSide() == 'server') { + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertEquals($document['body']['name'], 'Captain America 3'); + $this->assertEquals($document['body']['releaseYear'], 1946); + $this->assertCount(0, $document['body']['$permissions']['read']); + $this->assertCount(0, $document['body']['$permissions']['write']); + $this->assertEquals([], $document['body']['$permissions']['read']); + $this->assertEquals([], $document['body']['$permissions']['write']); + } + + return $data; } } \ No newline at end of file From d6fc03ca63b2d7dfe3caa78fc3a20a519c230075 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Mon, 22 Mar 2021 08:44:13 -0400 Subject: [PATCH 20/29] Throw error only on nonzero exit code --- app/workers/certificates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/certificates.php b/app/workers/certificates.php index e8693e3566..90907204a3 100644 --- a/app/workers/certificates.php +++ b/app/workers/certificates.php @@ -124,7 +124,7 @@ class CertificatesV1 ." -w ".APP_STORAGE_CERTIFICATES ." -d {$domain->get()}", '', $stdout, $stderr); - if($stderr || $exit !== 0) { + if($exit !== 0) { throw new Exception('Failed to issue a certificate with message: '.$stderr); } From a76016fa375fc773295c18c9d5920c23deb33a19 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 22 Mar 2021 18:19:05 +0200 Subject: [PATCH 21/29] Fixed functions tests --- app/controllers/api/functions.php | 2 +- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 7a6b11bcda..92708527a3 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -435,7 +435,7 @@ App::post('/v1/functions/:functionId/tags') ->label('sdk.response.model', Response::MODEL_TAG) ->param('functionId', '', new UID(), 'Function unique ID.') ->param('command', '', new Text('1028'), 'Code execution command.') - ->param('code', null, new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', false) + ->param('code', [], new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', false) ->inject('request') ->inject('response') ->inject('projectDB') diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 9dded8fdd7..b04a635cf0 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -628,7 +628,7 @@ class FunctionsCustomServerTest extends Scope ], $this->getHeaders()), [ 'tag' => $tagId, ]); - + $this->assertEquals(200, $tag['headers']['status-code']); $execution = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/executions', array_merge([ From 7eb45d30f4cd5a8717f85e0364c59f91799484e3 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 22 Mar 2021 22:07:59 +0200 Subject: [PATCH 22/29] Updated change log --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index cc086bb103..184cd763f9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,12 @@ - Upgraded ClamAV to version 1.3.0 +# Version 0.7.2 (Not Released Yet) + +## Bugs + +- Fixed certificates worker error on successful operations + # Version 0.7.1 ## Features From 5ab87a107bac561fc4bf2b7b20a0dcd11a260939 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 23 Mar 2021 00:42:25 +0200 Subject: [PATCH 23/29] Updated utopia libs --- composer.lock | 142 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 101 insertions(+), 41 deletions(-) diff --git a/composer.lock b/composer.lock index 8b29ae44f8..9dc046f896 100644 --- a/composer.lock +++ b/composer.lock @@ -364,18 +364,18 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "01129f635f45659fd4764a533777d069a978bc9d" + "reference": "98eeb955cbbe0e5d6f3f818e940c84f66aba427b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/01129f635f45659fd4764a533777d069a978bc9d", - "reference": "01129f635f45659fd4764a533777d069a978bc9d", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/98eeb955cbbe0e5d6f3f818e940c84f66aba427b", + "reference": "98eeb955cbbe0e5d6f3f818e940c84f66aba427b", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0" }, @@ -383,6 +383,7 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", @@ -459,7 +460,7 @@ "type": "github" } ], - "time": "2021-03-15T07:56:29+00:00" + "time": "2021-03-21T18:42:29+00:00" }, { "name": "guzzlehttp/promises", @@ -519,46 +520,47 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2" + "reference": "c0dcda9f54d145bd4d062a6d15f54931a67732f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a67cdbf85690e54a7b92fe91c297b20d2607c0b2", - "reference": "a67cdbf85690e54a7b92fe91c297b20d2607c0b2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c0dcda9f54d145bd4d062a6d15f54931a67732f9", + "reference": "c0dcda9f54d145bd4d062a6d15f54931a67732f9", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -573,6 +575,11 @@ { "name": "Tobias Schultze", "homepage": "https://github.com/Tobion" + }, + { + "name": "Mรกrk Sรกgi-Kazรกr", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -588,9 +595,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.x" + "source": "https://github.com/guzzle/psr7/tree/2.0.0-beta1" }, - "time": "2021-03-15T11:15:53+00:00" + "time": "2021-03-21T17:21:36+00:00" }, { "name": "influxdb/influxdb-php", @@ -906,6 +913,62 @@ }, "time": "2020-09-19T09:12:31+00:00" }, + { + "name": "psr/http-factory", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "36fa03d50ff82abcae81860bdaf4ed9a1510c7cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/36fa03d50ff82abcae81860bdaf4ed9a1510c7cd", + "reference": "36fa03d50ff82abcae81860bdaf4ed9a1510c7cd", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2020-09-17T16:52:55+00:00" + }, { "name": "psr/http-message", "version": "dev-master", @@ -1643,16 +1706,16 @@ }, { "name": "utopia-php/framework", - "version": "0.12.1", + "version": "0.12.3", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "ba17789a16527d24b4fb11ddc359901a295fbf2f" + "reference": "78be43a0eb711f3677769dfb445e5111bfafaa88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/ba17789a16527d24b4fb11ddc359901a295fbf2f", - "reference": "ba17789a16527d24b4fb11ddc359901a295fbf2f", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/78be43a0eb711f3677769dfb445e5111bfafaa88", + "reference": "78be43a0eb711f3677769dfb445e5111bfafaa88", "shasum": "" }, "require": { @@ -1686,9 +1749,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.12.1" + "source": "https://github.com/utopia-php/framework/tree/0.12.3" }, - "time": "2021-03-17T22:14:05+00:00" + "time": "2021-03-22T22:02:23+00:00" }, { "name": "utopia-php/image", @@ -1953,16 +2016,16 @@ }, { "name": "utopia-php/swoole", - "version": "0.2.2", + "version": "0.2.3", "source": { "type": "git", "url": "https://github.com/utopia-php/swoole.git", - "reference": "17510e90499e73273245c534a05bca522d4ffb37" + "reference": "45c42aae7e7d3f9f82bf194c2cfa5499b674aefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/swoole/zipball/17510e90499e73273245c534a05bca522d4ffb37", - "reference": "17510e90499e73273245c534a05bca522d4ffb37", + "url": "https://api.github.com/repos/utopia-php/swoole/zipball/45c42aae7e7d3f9f82bf194c2cfa5499b674aefe", + "reference": "45c42aae7e7d3f9f82bf194c2cfa5499b674aefe", "shasum": "" }, "require": { @@ -2003,9 +2066,9 @@ ], "support": { "issues": "https://github.com/utopia-php/swoole/issues", - "source": "https://github.com/utopia-php/swoole/tree/0.2.2" + "source": "https://github.com/utopia-php/swoole/tree/0.2.3" }, - "time": "2021-03-17T22:51:07+00:00" + "time": "2021-03-22T22:39:24+00:00" }, { "name": "utopia-php/system", @@ -2304,7 +2367,6 @@ "require-dev": { "phpunit/phpunit": "^7.0" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -5727,12 +5789,12 @@ "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "37e48403c21e06f63bc27d7ccd997fbb72b0ae2a" + "reference": "116bfb0bc9ec2a39db93431b7fe67144164d251e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/37e48403c21e06f63bc27d7ccd997fbb72b0ae2a", - "reference": "37e48403c21e06f63bc27d7ccd997fbb72b0ae2a", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/116bfb0bc9ec2a39db93431b7fe67144164d251e", + "reference": "116bfb0bc9ec2a39db93431b7fe67144164d251e", "shasum": "" }, "require": { @@ -5798,7 +5860,7 @@ "type": "tidelift" } ], - "time": "2021-03-10T10:07:14+00:00" + "time": "2021-03-22T08:23:49+00:00" }, { "name": "vimeo/psalm", @@ -5959,9 +6021,7 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "appwrite/sdk-generator": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { From 9f5fb08363c7b9486dd5cc47f7a4b4ed66886799 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 23 Mar 2021 13:50:40 +0545 Subject: [PATCH 24/29] ruby getting started --- docs/sdks/ruby/GETTING_STARTED.md | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 docs/sdks/ruby/GETTING_STARTED.md diff --git a/docs/sdks/ruby/GETTING_STARTED.md b/docs/sdks/ruby/GETTING_STARTED.md new file mode 100644 index 0000000000..d353ee196a --- /dev/null +++ b/docs/sdks/ruby/GETTING_STARTED.md @@ -0,0 +1,49 @@ +## Getting Started + +### Init your SDK +Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from project's API keys section. + +```ruby +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint + .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID + .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key +; +``` + +### Make Your First Request +Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section. + +```ruby +users = Appwrite::Users.new(client); + +result = users.create(email: 'email@example.com', password: 'password'); +``` + +### Full Example +```ruby +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint + .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID + .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key +; + +users = Appwrite::Users.new(client); + +result = users.create(email: 'email@example.com', password: 'password'); +``` + +### Learn more +You can use followng resources to learn more and get help +- ๐Ÿš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) +- ๐Ÿ“œ [Appwrite Docs](https://appwrite.io/docs) +- ๐Ÿ’ฌ [Discord Community](https://appwrite.io/discord) +- ๐Ÿš‚ [Appwrite Ruby Playground](https://github.com/appwrite/playground-for-ruby) From 32906110a84b6f14a2fb4118e5670e14133c9b7a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 23 Mar 2021 11:35:45 +0100 Subject: [PATCH 25/29] add dotnet getting started --- docs/sdks/dotnet/CHANGELOG.md | 1 + docs/sdks/dotnet/GETTING_STARTED.md | 36 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docs/sdks/dotnet/CHANGELOG.md create mode 100644 docs/sdks/dotnet/GETTING_STARTED.md diff --git a/docs/sdks/dotnet/CHANGELOG.md b/docs/sdks/dotnet/CHANGELOG.md new file mode 100644 index 0000000000..fa4d35e687 --- /dev/null +++ b/docs/sdks/dotnet/CHANGELOG.md @@ -0,0 +1 @@ +# Change Log \ No newline at end of file diff --git a/docs/sdks/dotnet/GETTING_STARTED.md b/docs/sdks/dotnet/GETTING_STARTED.md new file mode 100644 index 0000000000..584d571a10 --- /dev/null +++ b/docs/sdks/dotnet/GETTING_STARTED.md @@ -0,0 +1,36 @@ +## Getting Started + +### Initialize & Make API Request +Once you add the dependencies, its extremely easy to get started with the SDK; All you need to do is import the package in your code, set your Appwrite credentials, and start making API calls. Below is a simple example: + +```csharp +using Appwrite; + +static async Task Main(string[] args) +{ + var client = Client(); + + client + .setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible + .setProject('5ff3379a01d25') // Your project ID + .setKey('cd868c7af8bdc893b4...93b7535db89') + ; + + var users = Users(client); + + try { + var request = await users.create('email@example.com', 'password', 'name'); + var response = await request.Content.ReadAsStringAsync(); + Console.WriteLine(response); + } catch (AppwriteException e) { + Console.WriteLine(e.Message); + } +} +``` + +### Learn more +You can use followng resources to learn more and get help +- ๐Ÿš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) +- ๐Ÿ“œ [Appwrite Docs](https://appwrite.io/docs) +- ๐Ÿ’ฌ [Discord Community](https://appwrite.io/discord) +- ๐Ÿš‚ [Appwrite Dart Playground](https://github.com/appwrite/playground-for-dotnet) From caca0f8c5260129e11ec7e536fdfc21a72b921d6 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 23 Mar 2021 13:36:20 +0200 Subject: [PATCH 26/29] Updated the changelog for 0.7.2 --- CHANGES.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5ea9c27593..2ae482c9e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,16 +2,25 @@ - Anonymous login +# Version 0.7.2 (Not Released Yet) + +## Features + +- When creating new resources from the client API, the current user gets both read & write permissions by default. (#1007) +- Added timestamp to errors logs on the HTTP API container (#1002) +- Added verbose tests output on the terminal and CI (#1006) + ## Upgrades - Upgraded ClamAV to version 1.3.0 - Upgraded utopia-php/abuse to version 0.4.0 -# Version 0.7.2 (Not Released Yet) - ## Bugs -- Fixed certificates worker error on successful operations +- Fixed certificates worker error on successful operations (#1010) +- Fixed head requests not responding (#998) +- Fixed bug when using auth credential for the Redis container (#993) +- Fixed server warning logs on 3** redirect endpoints (#1013) # Version 0.7.1 From 90a9127bafe7a8bcf193e4341afd02a3c7f4900c Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 24 Mar 2021 10:44:24 +0100 Subject: [PATCH 27/29] bump utopia/analytics to 0.2.0 --- composer.json | 2 +- composer.lock | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index 142d67d0bd..f7e589480e 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "utopia-php/framework": "0.12.*", "utopia-php/abuse": "0.4.*", - "utopia-php/analytics": "0.1.*", + "utopia-php/analytics": "0.2.*", "utopia-php/audit": "0.5.*", "utopia-php/cache": "0.2.*", "utopia-php/cli": "0.10.0", diff --git a/composer.lock b/composer.lock index 24d495dc74..2d4e127a0c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "40de7f78c6b3d14b63c4ec178dcfe1a2", + "content-hash": "69222438c59581b58de7052befa6ac00", "packages": [ { "name": "adhocore/jwt", @@ -364,12 +364,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "98eeb955cbbe0e5d6f3f818e940c84f66aba427b" + "reference": "de6f1e58e735754b888649495ed4cb9ae3b19589" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/98eeb955cbbe0e5d6f3f818e940c84f66aba427b", - "reference": "98eeb955cbbe0e5d6f3f818e940c84f66aba427b", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/de6f1e58e735754b888649495ed4cb9ae3b19589", + "reference": "de6f1e58e735754b888649495ed4cb9ae3b19589", "shasum": "" }, "require": { @@ -398,7 +398,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.3-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -460,7 +460,7 @@ "type": "github" } ], - "time": "2021-03-21T18:42:29+00:00" + "time": "2021-03-23T14:07:59+00:00" }, { "name": "guzzlehttp/promises", @@ -1388,16 +1388,16 @@ }, { "name": "utopia-php/analytics", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/utopia-php/analytics.git", - "reference": "a1f2a1672a927bef8cd4d9b47e5cfbc856a3c72f" + "reference": "adfc2d057a7f6ab618a77c8a20ed3e35485ff416" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/analytics/zipball/a1f2a1672a927bef8cd4d9b47e5cfbc856a3c72f", - "reference": "a1f2a1672a927bef8cd4d9b47e5cfbc856a3c72f", + "url": "https://api.github.com/repos/utopia-php/analytics/zipball/adfc2d057a7f6ab618a77c8a20ed3e35485ff416", + "reference": "adfc2d057a7f6ab618a77c8a20ed3e35485ff416", "shasum": "" }, "require": { @@ -1437,9 +1437,9 @@ ], "support": { "issues": "https://github.com/utopia-php/analytics/issues", - "source": "https://github.com/utopia-php/analytics/tree/0.1.0" + "source": "https://github.com/utopia-php/analytics/tree/0.2.0" }, - "time": "2021-02-03T17:07:09+00:00" + "time": "2021-03-23T21:33:07+00:00" }, { "name": "utopia-php/audit", @@ -4996,12 +4996,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36e4ff2188cb5af6e6e94560b4aaa8042933aa58" + "reference": "5da8b675121f9f4419b7052caa0cc6118a3ccd47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36e4ff2188cb5af6e6e94560b4aaa8042933aa58", - "reference": "36e4ff2188cb5af6e6e94560b4aaa8042933aa58", + "url": "https://api.github.com/repos/symfony/console/zipball/5da8b675121f9f4419b7052caa0cc6118a3ccd47", + "reference": "5da8b675121f9f4419b7052caa0cc6118a3ccd47", "shasum": "" }, "require": { @@ -5087,7 +5087,7 @@ "type": "tidelift" } ], - "time": "2021-03-17T16:56:09+00:00" + "time": "2021-03-23T14:20:07+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5095,12 +5095,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "49dc45a74cbac5fffc6417372a9f5ae1682ca0b4" + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/49dc45a74cbac5fffc6417372a9f5ae1682ca0b4", - "reference": "49dc45a74cbac5fffc6417372a9f5ae1682ca0b4", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", "shasum": "" }, "require": { @@ -5155,7 +5155,7 @@ "type": "tidelift" } ], - "time": "2021-02-25T16:38:04+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -5575,12 +5575,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "3d72b4bfab3e991aa66906aa301aa479de4ca6ee" + "reference": "1309413986521646bb0ba91140afdc2a61ed8cfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/3d72b4bfab3e991aa66906aa301aa479de4ca6ee", - "reference": "3d72b4bfab3e991aa66906aa301aa479de4ca6ee", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1309413986521646bb0ba91140afdc2a61ed8cfe", + "reference": "1309413986521646bb0ba91140afdc2a61ed8cfe", "shasum": "" }, "require": { @@ -5647,7 +5647,7 @@ "type": "tidelift" } ], - "time": "2021-03-16T09:10:58+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/string", From 90adfe8760b82906ed442affa665a1c8efa3ed04 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 24 Mar 2021 12:37:58 +0200 Subject: [PATCH 28/29] Revreted back to ClamAV 1.2 --- CHANGES.md | 1 - app/views/install/compose.phtml | 2 +- docker-compose.yml | 2 +- tests/resources/docker/docker-compose.yml | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2ae482c9e7..d8fabf5cd0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,7 +12,6 @@ ## Upgrades -- Upgraded ClamAV to version 1.3.0 - Upgraded utopia-php/abuse to version 0.4.0 ## Bugs diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index fdbfff2c5d..1c0c98108f 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -352,7 +352,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.3.0 + image: appwrite/clamav:1.2.0 container_name: appwrite-clamav restart: unless-stopped networks: diff --git a/docker-compose.yml b/docker-compose.yml index 217d67a705..c4ad29c643 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -414,7 +414,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.3.0 + image: appwrite/clamav:1.2.0 container_name: appwrite-clamav networks: - appwrite diff --git a/tests/resources/docker/docker-compose.yml b/tests/resources/docker/docker-compose.yml index c9e4ea3d48..9f4074c540 100644 --- a/tests/resources/docker/docker-compose.yml +++ b/tests/resources/docker/docker-compose.yml @@ -327,7 +327,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.3.0 + image: appwrite/clamav:1.2.0 container_name: appwrite-clamav restart: unless-stopped networks: From e36df74be3e97d1ed0287e3eb6d168f6dd046866 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 24 Mar 2021 12:38:19 +0200 Subject: [PATCH 29/29] Enabled ClamAV --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 30bacb2a83..581af6d978 100644 --- a/.env +++ b/.env @@ -16,7 +16,7 @@ _APP_DB_PORT=3306 _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password -_APP_STORAGE_ANTIVIRUS=disabled +_APP_STORAGE_ANTIVIRUS=enabled _APP_STORAGE_ANTIVIRUS_HOST=clamav _APP_STORAGE_ANTIVIRUS_PORT=3310 _APP_INFLUXDB_HOST=influxdb