mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Add project path auth scheme to specs (#12554)
This commit is contained in:
1 parent
a58bfa7117
commit
0848175951
3 files changed
+43
-47
No files matched your search
@@ -139,11 +139,15 @@ class Specs extends Action
|
||||
'description' => 'Your project ID',
|
||||
'in' => 'header',
|
||||
],
|
||||
'ProjectQuery' => [
|
||||
'ProjectPath' => [
|
||||
'type' => 'apiKey',
|
||||
'name' => 'project',
|
||||
'description' => 'Your project ID',
|
||||
'in' => 'query',
|
||||
'x-appwrite' => [
|
||||
'location' => 'path',
|
||||
'param' => 'project_id',
|
||||
],
|
||||
],
|
||||
'JWT' => [
|
||||
'type' => 'apiKey',
|
||||
@@ -201,11 +205,15 @@ class Specs extends Action
|
||||
'description' => 'Your project ID',
|
||||
'in' => 'header',
|
||||
],
|
||||
'ProjectQuery' => [
|
||||
'ProjectPath' => [
|
||||
'type' => 'apiKey',
|
||||
'name' => 'project',
|
||||
'description' => 'Your project ID',
|
||||
'in' => 'query',
|
||||
'x-appwrite' => [
|
||||
'location' => 'path',
|
||||
'param' => 'project_id',
|
||||
],
|
||||
],
|
||||
'Key' => [
|
||||
'type' => 'apiKey',
|
||||
@@ -275,11 +283,15 @@ class Specs extends Action
|
||||
'description' => 'Your project ID',
|
||||
'in' => 'header',
|
||||
],
|
||||
'ProjectQuery' => [
|
||||
'ProjectPath' => [
|
||||
'type' => 'apiKey',
|
||||
'name' => 'project',
|
||||
'description' => 'Your project ID',
|
||||
'in' => 'query',
|
||||
'x-appwrite' => [
|
||||
'location' => 'path',
|
||||
'param' => 'project_id',
|
||||
],
|
||||
],
|
||||
'Key' => [
|
||||
'type' => 'apiKey',
|
||||
|
||||
@@ -81,28 +81,20 @@ class OpenAPI3 extends Format
|
||||
],
|
||||
];
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Project'])) {
|
||||
$output['components']['securitySchemes']['Project']['x-appwrite'] = ['demo' => '<YOUR_PROJECT_ID>'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['ProjectQuery'])) {
|
||||
$output['components']['securitySchemes']['ProjectQuery']['x-appwrite'] = ['demo' => '<YOUR_PROJECT_ID>'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Key'])) {
|
||||
$output['components']['securitySchemes']['Key']['x-appwrite'] = ['demo' => '<YOUR_API_KEY>'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['JWT'])) {
|
||||
$output['components']['securitySchemes']['JWT']['x-appwrite'] = ['demo' => '<YOUR_JWT>'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Locale'])) {
|
||||
$output['components']['securitySchemes']['Locale']['x-appwrite'] = ['demo' => 'en'];
|
||||
}
|
||||
|
||||
if (isset($output['components']['securitySchemes']['Mode'])) {
|
||||
$output['components']['securitySchemes']['Mode']['x-appwrite'] = ['demo' => ''];
|
||||
foreach ([
|
||||
'Project' => '<YOUR_PROJECT_ID>',
|
||||
'ProjectPath' => '<YOUR_PROJECT_ID>',
|
||||
'Key' => '<YOUR_API_KEY>',
|
||||
'JWT' => '<YOUR_JWT>',
|
||||
'Locale' => 'en',
|
||||
'Mode' => '',
|
||||
] as $key => $demo) {
|
||||
if (isset($output['components']['securitySchemes'][$key])) {
|
||||
$output['components']['securitySchemes'][$key]['x-appwrite'] = \array_merge(
|
||||
$output['components']['securitySchemes'][$key]['x-appwrite'] ?? [],
|
||||
['demo' => $demo]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$usedModels = [];
|
||||
|
||||
@@ -70,28 +70,20 @@ class Swagger2 extends Format
|
||||
],
|
||||
];
|
||||
|
||||
if (isset($output['securityDefinitions']['Project'])) {
|
||||
$output['securityDefinitions']['Project']['x-appwrite'] = ['demo' => '<YOUR_PROJECT_ID>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['ProjectQuery'])) {
|
||||
$output['securityDefinitions']['ProjectQuery']['x-appwrite'] = ['demo' => '<YOUR_PROJECT_ID>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['Key'])) {
|
||||
$output['securityDefinitions']['Key']['x-appwrite'] = ['demo' => '<YOUR_API_KEY>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['JWT'])) {
|
||||
$output['securityDefinitions']['JWT']['x-appwrite'] = ['demo' => '<YOUR_JWT>'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['Locale'])) {
|
||||
$output['securityDefinitions']['Locale']['x-appwrite'] = ['demo' => 'en'];
|
||||
}
|
||||
|
||||
if (isset($output['securityDefinitions']['Mode'])) {
|
||||
$output['securityDefinitions']['Mode']['x-appwrite'] = ['demo' => ''];
|
||||
foreach ([
|
||||
'Project' => '<YOUR_PROJECT_ID>',
|
||||
'ProjectPath' => '<YOUR_PROJECT_ID>',
|
||||
'Key' => '<YOUR_API_KEY>',
|
||||
'JWT' => '<YOUR_JWT>',
|
||||
'Locale' => 'en',
|
||||
'Mode' => '',
|
||||
] as $key => $demo) {
|
||||
if (isset($output['securityDefinitions'][$key])) {
|
||||
$output['securityDefinitions'][$key]['x-appwrite'] = \array_merge(
|
||||
$output['securityDefinitions'][$key]['x-appwrite'] ?? [],
|
||||
['demo' => $demo]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$usedModels = [];
|
||||
|
||||
Reference in new issue
Block a user