refactor: explicitly set locationAuth on all LOCATION methods, remove default

This commit is contained in:
harsh mahajan committed 2026-06-05 18:14:28 +05:30
1 parent 529847df95
commit ead39142cd
14 files changed
+17 -4

No files matched your search

@@ -42,6 +42,7 @@ class Get extends Action
description: '/docs/references/avatars/get-browser.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -42,6 +42,7 @@ class Get extends Action
description: '/docs/references/avatars/get-credit-card.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -54,6 +54,7 @@ class Get extends Action
description: '/docs/references/avatars/get-favicon.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -42,6 +42,7 @@ class Get extends Action
description: '/docs/references/avatars/get-flag.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -45,6 +45,7 @@ class Get extends Action
description: '/docs/references/avatars/get-image.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -44,6 +44,7 @@ class Get extends Action
description: '/docs/references/avatars/get-initials.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -42,6 +42,7 @@ class Get extends Action
description: '/docs/references/avatars/get-qr.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -57,6 +57,7 @@ class Get extends Action
description: '/docs/references/avatars/get-screenshot.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -52,7 +52,8 @@ class Get extends Action
)
],
contentType: ContentType::ANY,
type: MethodType::LOCATION
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
))
->param('functionId', '', fn (Database $dbForProject) => new UID($dbForProject->getAdapter()->getMaxUIDLength()), 'Function ID.', false, ['dbForProject'])
->param('deploymentId', '', fn (Database $dbForProject) => new UID($dbForProject->getAdapter()->getMaxUIDLength()), 'Deployment ID.', false, ['dbForProject'])
@@ -51,6 +51,7 @@ class Get extends Action
)
],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
contentType: ContentType::ANY,
))
->param('siteId', '', fn (Database $dbForProject) => new UID($dbForProject->getAdapter()->getMaxUIDLength()), 'Site ID.', false, ['dbForProject'])
@@ -57,7 +57,8 @@ class Get extends Action
)
],
contentType: ContentType::ANY,
type: MethodType::LOCATION
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
))
->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
->param('fileId', '', new UID(), 'File ID.')
@@ -71,6 +71,7 @@ class Get extends Action
)
],
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
contentType: ContentType::IMAGE
))
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
@@ -58,7 +58,8 @@ class Get extends Action
)
],
contentType: ContentType::ANY,
type: MethodType::LOCATION
type: MethodType::LOCATION,
locationAuth: ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery'],
))
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
->param('fileId', '', new UID(), 'File ID.')
+1 -1
View File
@@ -53,7 +53,7 @@ class Method
protected string $desc = '',
protected bool $public = true,
protected string $projectAuth = 'Project',
protected array $locationAuth = ['ImpersonateUserIdQuery', 'ImpersonateUserEmailQuery', 'ImpersonateUserPhoneQuery']
protected array $locationAuth = []
) {
$this->validateMethod($name, $namespace);
$this->validateAuthTypes($auth);