mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
refactor: remove getProjectAuth(), use getLocationAuth()[0] directly in spec formatters
This commit is contained in:
1 parent
c3c8fb5b9f
commit
1d7ed046cb
3 files changed
+4
-9
No files matched your search
@@ -225,11 +225,6 @@ class Method
|
||||
return $this->additionalParameters;
|
||||
}
|
||||
|
||||
public function getProjectAuth(): string
|
||||
{
|
||||
return $this->locationAuth[0] ?? 'Project';
|
||||
}
|
||||
|
||||
public function getLocationAuth(): array
|
||||
{
|
||||
return $this->locationAuth;
|
||||
|
||||
@@ -188,7 +188,7 @@ class OpenAPI3 extends Format
|
||||
continue;
|
||||
}
|
||||
|
||||
$methodSecurities = [$methodObj->getProjectAuth() => []];
|
||||
$methodSecurities = [($methodObj->getLocationAuth()[0] ?? 'Project') => []];
|
||||
foreach ($methodObj->getAuth() as $security) {
|
||||
if (\array_key_exists($security->value, $this->keys)) {
|
||||
$methodSecurities[$security->value] = [];
|
||||
@@ -374,7 +374,7 @@ class OpenAPI3 extends Format
|
||||
}
|
||||
|
||||
if (!empty($scope)) {
|
||||
$securities = [$sdk->getProjectAuth() => []];
|
||||
$securities = [($sdk->getLocationAuth()[0] ?? 'Project') => []];
|
||||
|
||||
foreach ($sdk->getAuth() as $security) {
|
||||
/** @var AuthType $security */
|
||||
|
||||
@@ -188,7 +188,7 @@ class Swagger2 extends Format
|
||||
continue;
|
||||
}
|
||||
|
||||
$methodSecurities = [$methodObj->getProjectAuth() => []];
|
||||
$methodSecurities = [($methodObj->getLocationAuth()[0] ?? 'Project') => []];
|
||||
foreach ($methodObj->getAuth() as $security) {
|
||||
/** @var AuthType $security */
|
||||
if (\array_key_exists($security->value, $this->keys)) {
|
||||
@@ -365,7 +365,7 @@ class Swagger2 extends Format
|
||||
}
|
||||
|
||||
if (!empty($scope)) {
|
||||
$securities = [$sdk->getProjectAuth() => []];
|
||||
$securities = [($sdk->getLocationAuth()[0] ?? 'Project') => []];
|
||||
|
||||
foreach ($sdk->getAuth() as $security) {
|
||||
if (\array_key_exists($security->value, $this->keys)) {
|
||||
|
||||
Reference in new issue
Block a user