1
0
Fork 0
mirror of synced 2024-05-20 04:32:37 +12:00

Merge branch 'main' into fix-usage-skip-main

This commit is contained in:
Damodar Lohani 2024-04-24 08:42:17 +05:45 committed by GitHub
commit c163c84478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 43 additions and 32 deletions

View file

@ -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)
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
<!-- [![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.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://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 [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

View file

@ -142,6 +142,7 @@ return [
'pw' => ['name' => 'Palau', 'path' => __DIR__ . '/flags/pw.png'],
'pg' => ['name' => 'Papua New Guinea', 'path' => __DIR__ . '/flags/pg.png'],
'pl' => ['name' => 'Poland', 'path' => __DIR__ . '/flags/pl.png'],
'pf' => ['name' => 'French Polynesia', 'path' => __DIR__ . '/flags/pf.png'],
'kp' => ['name' => 'North Korea', 'path' => __DIR__ . '/flags/kp.png'],
'pt' => ['name' => 'Portugal', 'path' => __DIR__ . '/flags/pt.png'],
'py' => ['name' => 'Paraguay', 'path' => __DIR__ . '/flags/py.png'],

View file

@ -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 contact an administrator to update console sign up restrictions by setting _APP_CONSOLE_WHITELIST_ROOT to "disabled".',
'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.',

View file

@ -73,6 +73,7 @@ return [
'GD',
'GT',
'GY',
'HK',
'HN',
'HR',
'HT',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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);
}
}

View file

@ -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 && \count($session->getAttribute('factors', [])) < $minimumFactors) {
throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED);
}
}

View file

@ -1 +1 @@
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator) method.
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.

View file

@ -1 +1 @@
Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#addAuthenticator) method.
Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. add

View file

@ -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';

View file

@ -33,7 +33,7 @@ class BatchTest extends Scope
$this->assertArrayNotHasKey('errors', $response['body'][1]);
$this->assertArrayHasKey('localeListCountries', $response['body'][0]['data']);
$this->assertArrayHasKey('localeListContinents', $response['body'][1]['data']);
$this->assertEquals(195, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(7, $response['body'][1]['data']['localeListContinents']['total']);
}
@ -56,8 +56,8 @@ class BatchTest extends Scope
$this->assertArrayNotHasKey('errors', $response['body'][1]);
$this->assertArrayHasKey('localeListCountries', $response['body'][0]['data']);
$this->assertArrayHasKey('localeListCountries', $response['body'][1]['data']);
$this->assertEquals(195, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(195, $response['body'][1]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][1]['data']['localeListCountries']['total']);
}
public function testArrayBatchedMutations()
@ -184,7 +184,7 @@ class BatchTest extends Scope
$this->assertArrayHasKey('localeListCountries', $response['body'][0]['data']);
$this->assertArrayHasKey('localeListContinents', $response['body'][1]['data']);
$this->assertArrayHasKey('accountCreate', $response['body'][2]['data']);
$this->assertEquals(195, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(7, $response['body'][1]['data']['localeListContinents']['total']);
$this->assertEquals('Tester 1', $response['body'][2]['data']['accountCreate']['name']);
}
@ -225,8 +225,8 @@ class BatchTest extends Scope
$this->assertArrayHasKey('localeListCountries', $response['body'][0]['data']);
$this->assertArrayHasKey('localeListCountries', $response['body'][1]['data']);
$this->assertArrayHasKey('accountCreate', $response['body'][2]['data']);
$this->assertEquals(195, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(195, $response['body'][1]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][1]['data']['localeListCountries']['total']);
$this->assertArrayHasKey('_id', $response['body'][2]['data']['accountCreate']);
}
@ -251,7 +251,7 @@ class BatchTest extends Scope
$this->assertArrayNotHasKey('errors', $response['body']);
$this->assertArrayHasKey('localeListCountries', $response['body']['data']);
$this->assertArrayHasKey('localeListContinents', $response['body']['data']);
$this->assertEquals(195, $response['body']['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body']['data']['localeListCountries']['total']);
$this->assertEquals(7, $response['body']['data']['localeListContinents']['total']);
}
@ -275,7 +275,7 @@ class BatchTest extends Scope
$this->assertIsArray($response['body']['data']);
$this->assertArrayNotHasKey('errors', $response['body']);
$this->assertArrayHasKey('localeListCountries', $response['body']['data']);
$this->assertEquals(195, $response['body']['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body']['data']['localeListCountries']['total']);
}
public function testQueryBatchedMutations()

View file

@ -30,7 +30,7 @@ class ContentTypeTest extends Scope
$this->assertIsArray($response['body']['data']);
$this->assertArrayNotHasKey('errors', $response['body']);
$response = $response['body']['data']['localeListCountries'];
$this->assertEquals(195, $response['total']);
$this->assertEquals(196, $response['total']);
}
public function testSingleQueryJSONContentType()
@ -46,7 +46,7 @@ class ContentTypeTest extends Scope
$this->assertIsArray($response['body']['data']);
$this->assertArrayNotHasKey('errors', $response['body']);
$response = $response['body']['data']['localeListCountries'];
$this->assertEquals(195, $response['total']);
$this->assertEquals(196, $response['total']);
}
public function testArrayBatchedJSONContentType()
@ -69,7 +69,7 @@ class ContentTypeTest extends Scope
$this->assertArrayNotHasKey('errors', $response['body'][1]);
$this->assertArrayHasKey('localeListCountries', $response['body'][0]['data']);
$this->assertArrayHasKey('localeListContinents', $response['body'][1]['data']);
$this->assertEquals(195, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body'][0]['data']['localeListCountries']['total']);
$this->assertEquals(7, $response['body'][1]['data']['localeListContinents']['total']);
}
@ -94,7 +94,7 @@ class ContentTypeTest extends Scope
$this->assertArrayNotHasKey('errors', $response['body']);
$this->assertArrayHasKey('localeListCountries', $response['body']['data']);
$this->assertArrayHasKey('localeListContinents', $response['body']['data']);
$this->assertEquals(195, $response['body']['data']['localeListCountries']['total']);
$this->assertEquals(196, $response['body']['data']['localeListCountries']['total']);
$this->assertEquals(7, $response['body']['data']['localeListContinents']['total']);
}

View file

@ -45,7 +45,7 @@ trait LocaleBase
$this->assertEquals($response['headers']['status-code'], 200);
$this->assertIsArray($response['body']);
$this->assertEquals(195, $response['body']['total']);
$this->assertEquals(196, $response['body']['total']);
$this->assertEquals($response['body']['countries'][0]['name'], 'Afghanistan');
$this->assertEquals($response['body']['countries'][0]['code'], 'AF');
@ -59,7 +59,7 @@ trait LocaleBase
$this->assertEquals($response['headers']['status-code'], 200);
$this->assertIsArray($response['body']);
$this->assertEquals(195, $response['body']['total']);
$this->assertEquals(196, $response['body']['total']);
$this->assertEquals($response['body']['countries'][0]['name'], 'Afganistán');
$this->assertEquals($response['body']['countries'][0]['code'], 'AF');
@ -247,7 +247,7 @@ trait LocaleBase
}
$this->assertEquals($response['headers']['status-code'], 200);
$this->assertEquals(195, $response['body']['total']);
$this->assertEquals(196, $response['body']['total']);
$response = $this->client->call(Client::METHOD_GET, '/locale/continents', [
'content-type' => 'application/json',