From cae3c7731ef25073ed0ae75413fce88c6a4f2a43 Mon Sep 17 00:00:00 2001 From: Laura Du Ry <123562732+LauraDuRy@users.noreply.github.com> Date: Fri, 29 Sep 2023 11:48:51 +0200 Subject: [PATCH 01/10] Update README.md Updated our follow us section. Added LinkedIn and our own blog. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25cdc82de..3deb9748c 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a ## Follow Us -Join our growing community around the world! Check out our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions. +Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [Twitter](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions. ## License From 14489feb51ebd597be3d462b724c5bb604900bc9 Mon Sep 17 00:00:00 2001 From: Laura Du Ry <123562732+LauraDuRy@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:13:40 +0100 Subject: [PATCH 02/10] Update README.md Updated twitter to X --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bbcaf9da..f5529052c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=ready&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github) [![Build Status](https://img.shields.io/github/actions/workflow/status/appwrite/appwrite/tests.yml?branch=master&label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions) -[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) +[![X Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) From e715d3c0cc47590ca2fbefb3fd9f7966ea678d2d Mon Sep 17 00:00:00 2001 From: Laura Du Ry <123562732+LauraDuRy@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:00:45 +0100 Subject: [PATCH 03/10] Update README.md Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b040a4a1b..f143eae2a 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a ## Follow Us -Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [Twitter](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions. +Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [X](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions. ## License From 88836429af1c55976e6c4ab0bc1407c1ba4adb41 Mon Sep 17 00:00:00 2001 From: Laura Du Ry <123562732+LauraDuRy@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:02:11 +0100 Subject: [PATCH 04/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f143eae2a..7be9a27f7 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a ## Follow Us -Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [X](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions. +Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [X](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](appwrite.io/discord) for more help, ideas, and discussions. ## License From 404de48cc36578c5da8fc9d08711ef2a2ab2412a Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Thu, 18 Apr 2024 17:08:47 -0400 Subject: [PATCH 05/10] Update user create error message for console to be console specific --- app/config/errors.php | 5 +++++ app/controllers/api/account.php | 3 +++ src/Appwrite/Extend/Exception.php | 1 + 3 files changed, 9 insertions(+) diff --git a/app/config/errors.php b/app/config/errors.php index c999ddba5..4bb9458dd 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -136,6 +136,11 @@ return [ 'description' => 'The current project has exceeded the maximum number of users. Please check your user limit in the Appwrite console.', 'code' => 501, ], + Exception::USER_CONSOLE_COUNT_EXCEEDED => [ + 'name' => Exception::USER_CONSOLE_COUNT_EXCEEDED, + 'description' => 'Sign up to the console is restricted. You can update console sign up restrictions by setting _APP_CONSOLE_WHITELIST_ROOT to "disabled" or by updating _APP_CONSOLE_WHITELIST_IPS or _APP_CONSOLE_WHITELIST_EMAILS to whitelist your IP or email.', + 'code' => 501, + ], Exception::USER_JWT_INVALID => [ 'name' => Exception::USER_JWT_INVALID, 'description' => 'The JWT token is invalid. Please check the value of the X-Appwrite-JWT header to ensure the correct token is being used.', diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index ee7dc076d..b2f121232 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -215,6 +215,9 @@ App::post('/v1/account') $total = $dbForProject->count('users', max: APP_LIMIT_USERS); if ($total >= $limit) { + if ('console' === $project->getId()){ + throw new Exception(Exception::USER_CONSOLE_COUNT_EXCEEDED); + } throw new Exception(Exception::USER_COUNT_EXCEEDED); } } diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 7d56f5a38..1c5692cd9 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -63,6 +63,7 @@ class Exception extends \Exception /** Users */ public const USER_COUNT_EXCEEDED = 'user_count_exceeded'; + public const USER_CONSOLE_COUNT_EXCEEDED = 'user_console_count_exceeded'; public const USER_JWT_INVALID = 'user_jwt_invalid'; public const USER_ALREADY_EXISTS = 'user_already_exists'; public const USER_BLOCKED = 'user_blocked'; From c57fa3546f6d65091697a5049f21151b96772ffd Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Thu, 18 Apr 2024 17:22:41 -0400 Subject: [PATCH 06/10] Ran formatter --- app/controllers/api/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index b2f121232..4d9dd364f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -215,7 +215,7 @@ App::post('/v1/account') $total = $dbForProject->count('users', max: APP_LIMIT_USERS); if ($total >= $limit) { - if ('console' === $project->getId()){ + if ('console' === $project->getId()) { throw new Exception(Exception::USER_CONSOLE_COUNT_EXCEEDED); } throw new Exception(Exception::USER_COUNT_EXCEEDED); From be05844116003d5b17f111971b8afb645a695264 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Thu, 18 Apr 2024 18:18:34 -0400 Subject: [PATCH 07/10] Update error for USER_CONSOLE_COUNT_EXCEEDED to just mention relevant variables --- app/config/errors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/errors.php b/app/config/errors.php index 4bb9458dd..47bb6d834 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -138,7 +138,7 @@ return [ ], Exception::USER_CONSOLE_COUNT_EXCEEDED => [ 'name' => Exception::USER_CONSOLE_COUNT_EXCEEDED, - 'description' => 'Sign up to the console is restricted. You can update console sign up restrictions by setting _APP_CONSOLE_WHITELIST_ROOT to "disabled" or by updating _APP_CONSOLE_WHITELIST_IPS or _APP_CONSOLE_WHITELIST_EMAILS to whitelist your IP or email.', + 'description' => 'Sign up to the console is restricted. You can contact an administrator to update console sign up restrictions by setting _APP_CONSOLE_WHITELIST_ROOT to "disabled".', 'code' => 501, ], Exception::USER_JWT_INVALID => [ From be07114c39b4aac8b49c79a5f84d540bf40d2576 Mon Sep 17 00:00:00 2001 From: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:18:30 -0700 Subject: [PATCH 08/10] fix: update discord link in readme Absolute URLs should include the URL scheme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ab211b0c..e93d861dc 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a ## Follow Us -Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [X](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](appwrite.io/discord) for more help, ideas, and discussions. +Join our growing community around the world! Check out our official [Blog](https://appwrite.io/blog). Follow us on [X](https://twitter.com/appwrite), [LinkedIn](https://www.linkedin.com/company/appwrite/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://appwrite.io/discord) for more help, ideas, and discussions. ## License From 3d17b64eacff19fc93d89d23e77bd865cc218f2c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 23 Apr 2024 16:24:05 +0900 Subject: [PATCH 09/10] Add Null check before we access factors --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 7c2f08c70..9e2812f63 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -290,7 +290,7 @@ App::init() $minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1; if (!in_array('mfa', $route->getGroups())) { - if ($session && \count($session->getAttribute('factors')) < $minimumFactors) { + if ($session && !empty($session->getAttribute('factors')) && \count($session->getAttribute('factors')) < $minimumFactors) { throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED); } } From 089af4e137340de666b8eacd1a29d793e168834a Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 23 Apr 2024 16:34:12 +0900 Subject: [PATCH 10/10] Update app/controllers/shared/api.php Co-authored-by: Jake Barnby --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 9e2812f63..fdaa98212 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -290,7 +290,7 @@ App::init() $minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1; if (!in_array('mfa', $route->getGroups())) { - if ($session && !empty($session->getAttribute('factors')) && \count($session->getAttribute('factors')) < $minimumFactors) { + if ($session && \count($session->getAttribute('factors', [])) < $minimumFactors) { throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED); } }