mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: minor mistakes in devkeys naming and initialization
This commit is contained in:
@@ -722,7 +722,7 @@ return [
|
||||
'format' => '',
|
||||
'size' => Database::LENGTH_KEY,
|
||||
'signed' => true,
|
||||
'required' => false,
|
||||
'required' => true,
|
||||
'default' => 0,
|
||||
'array' => false,
|
||||
'filters' => [],
|
||||
|
||||
@@ -26,6 +26,7 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000;
|
||||
const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period
|
||||
const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds
|
||||
const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls
|
||||
const APP_LIMIT_DEV_KEYS = 5000; // Default maximum number of dev keys to return in list API calls
|
||||
const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
|
||||
@@ -55,7 +55,7 @@ class Create extends Action
|
||||
->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false)
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
->callback(fn ($projectId, $name, $expire, $response, $dbForPlatform) => $this->action($projectId, $name, $expire, $response, $dbForPlatform));
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForPlatform)
|
||||
|
||||
@@ -39,7 +39,7 @@ class Delete extends Action
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_CREATED,
|
||||
code: Response::STATUS_CODE_NOCONTENT,
|
||||
model: Response::MODEL_NONE
|
||||
)
|
||||
],
|
||||
@@ -49,7 +49,7 @@ class Delete extends Action
|
||||
->param('keyId', '', new UID(), 'Key unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
->callback(fn ($projectId, $keyId, $response, $dbForPlatform) => $this->action($projectId, $keyId, $response, $dbForPlatform));
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform)
|
||||
|
||||
@@ -49,7 +49,7 @@ class Get extends Action
|
||||
->param('keyId', '', new UID(), 'Key unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
->callback(fn ($projectId, $keyId, $response, $dbForPlatform) => $this->action($projectId, $keyId, $response, $dbForPlatform));
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform)
|
||||
|
||||
@@ -40,7 +40,7 @@ class Update extends Action
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_CREATED,
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_DEV_KEY
|
||||
)
|
||||
],
|
||||
@@ -52,7 +52,7 @@ class Update extends Action
|
||||
->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.')
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForPlatform) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForPlatform));
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForPlatform)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ class XList extends Action
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_CREATED,
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_DEV_KEY_LIST
|
||||
)
|
||||
],
|
||||
@@ -49,7 +49,7 @@ class XList extends Action
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
->callback(fn ($projectId, $response, $dbForPlatform) => $this->action($projectId, $response, $dbForPlatform));
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $projectId, Response $response, Database $dbForPlatform)
|
||||
@@ -63,7 +63,7 @@ class XList extends Action
|
||||
|
||||
$keys = $dbForPlatform->find('devKeys', [
|
||||
Query::equal('projectInternalId', [$project->getInternalId()]),
|
||||
Query::limit(5000),
|
||||
Query::limit(APP_LIMIT_DEV_KEYS),
|
||||
]);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
|
||||
@@ -366,7 +366,7 @@ class Response extends SwooleResponse
|
||||
->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false))
|
||||
->setModel(new BaseList('Webhooks List', self::MODEL_WEBHOOK_LIST, 'webhooks', self::MODEL_WEBHOOK, true, false))
|
||||
->setModel(new BaseList('API Keys List', self::MODEL_KEY_LIST, 'keys', self::MODEL_KEY, true, false))
|
||||
->setModel(new BaseList('Dev Keys List', self::MODEL_DEV_KEY_LIST, 'keys', self::MODEL_DEV_KEY, true, false))
|
||||
->setModel(new BaseList('Dev Keys List', self::MODEL_DEV_KEY_LIST, 'devKeys', self::MODEL_DEV_KEY, true, false))
|
||||
->setModel(new BaseList('Auth Providers List', self::MODEL_AUTH_PROVIDER_LIST, 'platforms', self::MODEL_AUTH_PROVIDER, true, false))
|
||||
->setModel(new BaseList('Platforms List', self::MODEL_PLATFORM_LIST, 'platforms', self::MODEL_PLATFORM, true, false))
|
||||
->setModel(new BaseList('Countries List', self::MODEL_COUNTRY_LIST, 'countries', self::MODEL_COUNTRY))
|
||||
|
||||
@@ -37,7 +37,7 @@ class DevKey extends Model
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Key name.',
|
||||
'default' => '',
|
||||
'example' => 'My API Key',
|
||||
'example' => 'Dev API Key',
|
||||
])
|
||||
->addRule('expire', [
|
||||
'type' => self::TYPE_DATETIME,
|
||||
|
||||
Reference in New Issue
Block a user