small fix
This commit is contained in:
parent
1a28c3a909
commit
e782e4744f
2 changed files with 2 additions and 3 deletions
|
@ -776,7 +776,7 @@ App::post('/v1/projects/:projectId/keys')
|
||||||
->param('projectId', null, new UID(), 'Project unique ID.')
|
->param('projectId', null, new UID(), 'Project unique ID.')
|
||||||
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
||||||
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
|
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
|
||||||
->param('expire', 0, new Integer() , 'Key expiration time')
|
->param('expire', null, new Integer() , 'Key expiration timestamp', true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('dbForConsole')
|
->inject('dbForConsole')
|
||||||
->action(function (string $projectId, string $name, array $scopes, int $expire, Response $response, Database $dbForConsole) {
|
->action(function (string $projectId, string $name, array $scopes, int $expire, Response $response, Database $dbForConsole) {
|
||||||
|
@ -885,7 +885,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
|
||||||
->param('keyId', null, new UID(), 'Key unique ID.')
|
->param('keyId', null, new UID(), 'Key unique ID.')
|
||||||
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
||||||
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
|
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
|
||||||
->param('expire', 0, new Integer() , 'Key expiration time')
|
->param('expire', 0, new Integer() , 'Key expiration timestamp' ,true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('dbForConsole')
|
->inject('dbForConsole')
|
||||||
->action(function (string $projectId, string $keyId, string $name, array $scopes, int $expire, Response $response, Database $dbForConsole) {
|
->action(function (string $projectId, string $keyId, string $name, array $scopes, int $expire, Response $response, Database $dbForConsole) {
|
||||||
|
|
|
@ -285,7 +285,6 @@ App::init(function (App $utopia, Request $request, Response $response, Document
|
||||||
throw new AppwriteException('Project key expired', 401, AppwriteException:: PROJECT_KEY_EXPIRED);
|
throw new AppwriteException('Project key expired', 401, AppwriteException:: PROJECT_KEY_EXPIRED);
|
||||||
}
|
}
|
||||||
|
|
||||||
Authorization::setRole('role:'.Auth::USER_ROLE_APP);
|
|
||||||
Authorization::setRole('role:' . Auth::USER_ROLE_APP);
|
Authorization::setRole('role:' . Auth::USER_ROLE_APP);
|
||||||
Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys.
|
Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue