Browse Source
chore(federation): add trusted server auto accept integration tests
chore(federation): add trusted server auto accept integration tests
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>pull/49973/head
9 changed files with 2073 additions and 88 deletions
-
5apps/federation/appinfo/routes.php
-
102apps/federation/lib/Controller/SettingsController.php
-
384apps/federation/openapi-administration.json
-
511apps/federation/openapi-federation.json
-
863apps/federation/openapi-full.json
-
29apps/federation/tests/Controller/SettingsControllerTest.php
-
45build/integration/features/bootstrap/FederationContext.php
-
219build/integration/federation_features/federated.feature
-
3build/integration/run.sh
@ -0,0 +1,384 @@ |
|||
{ |
|||
"openapi": "3.0.3", |
|||
"info": { |
|||
"title": "federation-administration", |
|||
"version": "0.0.1", |
|||
"description": "Federation allows you to connect with other trusted servers to exchange the account directory.", |
|||
"license": { |
|||
"name": "agpl" |
|||
} |
|||
}, |
|||
"components": { |
|||
"securitySchemes": { |
|||
"basic_auth": { |
|||
"type": "http", |
|||
"scheme": "basic" |
|||
}, |
|||
"bearer_auth": { |
|||
"type": "http", |
|||
"scheme": "bearer" |
|||
} |
|||
}, |
|||
"schemas": {} |
|||
}, |
|||
"paths": { |
|||
"/ocs/v2.php/apps/federation/trusted-servers": { |
|||
"get": { |
|||
"operationId": "settings-get-servers", |
|||
"summary": "List all trusted servers", |
|||
"description": "This endpoint requires admin access", |
|||
"tags": [ |
|||
"settings" |
|||
], |
|||
"security": [ |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "List of trusted servers", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "array", |
|||
"items": { |
|||
"type": "object", |
|||
"required": [ |
|||
"id", |
|||
"status", |
|||
"url" |
|||
], |
|||
"properties": { |
|||
"id": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
}, |
|||
"status": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
}, |
|||
"url": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"ok" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"post": { |
|||
"operationId": "settings-add-server", |
|||
"summary": "Add server to the list of trusted Nextcloud servers", |
|||
"description": "This endpoint requires admin access", |
|||
"tags": [ |
|||
"settings" |
|||
], |
|||
"security": [ |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"requestBody": { |
|||
"required": true, |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"url" |
|||
], |
|||
"properties": { |
|||
"url": { |
|||
"type": "string", |
|||
"description": "The URL of the server to add" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Server added successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"id", |
|||
"message", |
|||
"url" |
|||
], |
|||
"properties": { |
|||
"id": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
}, |
|||
"url": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"ok" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"404": { |
|||
"description": "Server not found at the given URL", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"hint", |
|||
"message" |
|||
], |
|||
"properties": { |
|||
"hint": { |
|||
"type": "string" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"error" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"409": { |
|||
"description": "Server is already in the list of trusted servers", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"hint", |
|||
"message" |
|||
], |
|||
"properties": { |
|||
"hint": { |
|||
"type": "string" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"error" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/apps/federation/trusted-servers/{id}": { |
|||
"delete": { |
|||
"operationId": "settings-remove-server", |
|||
"summary": "Add server to the list of trusted Nextcloud servers", |
|||
"description": "This endpoint requires admin access", |
|||
"tags": [ |
|||
"settings" |
|||
], |
|||
"security": [ |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "id", |
|||
"in": "path", |
|||
"description": "The ID of the trusted server to remove", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Server removed successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"id" |
|||
], |
|||
"properties": { |
|||
"id": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"ok" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"404": { |
|||
"description": "Server not found at the given ID", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"message" |
|||
], |
|||
"properties": { |
|||
"message": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"error" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"tags": [ |
|||
{ |
|||
"name": "ocs_authapi", |
|||
"description": "Class OCSAuthAPI\nOCS API end-points to exchange shared secret between two connected Nextclouds" |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,511 @@ |
|||
{ |
|||
"openapi": "3.0.3", |
|||
"info": { |
|||
"title": "federation-federation", |
|||
"version": "0.0.1", |
|||
"description": "Federation allows you to connect with other trusted servers to exchange the account directory.", |
|||
"license": { |
|||
"name": "agpl" |
|||
} |
|||
}, |
|||
"components": { |
|||
"securitySchemes": { |
|||
"basic_auth": { |
|||
"type": "http", |
|||
"scheme": "basic" |
|||
}, |
|||
"bearer_auth": { |
|||
"type": "http", |
|||
"scheme": "bearer" |
|||
} |
|||
}, |
|||
"schemas": { |
|||
"OCSMeta": { |
|||
"type": "object", |
|||
"required": [ |
|||
"status", |
|||
"statuscode" |
|||
], |
|||
"properties": { |
|||
"status": { |
|||
"type": "string" |
|||
}, |
|||
"statuscode": { |
|||
"type": "integer" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
}, |
|||
"totalitems": { |
|||
"type": "string" |
|||
}, |
|||
"itemsperpage": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"paths": { |
|||
"/ocs/v2.php/apps/federation/api/v1/shared-secret": { |
|||
"get": { |
|||
"operationId": "ocs_authapi-get-shared-secret-legacy", |
|||
"summary": "Create shared secret and return it, for legacy end-points", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "url", |
|||
"in": "query", |
|||
"description": "URL of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "token", |
|||
"in": "query", |
|||
"description": "Token of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret returned", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"sharedSecret" |
|||
], |
|||
"properties": { |
|||
"sharedSecret": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Getting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/apps/federation/api/v1/request-shared-secret": { |
|||
"post": { |
|||
"operationId": "ocs_authapi-request-shared-secret-legacy", |
|||
"summary": "Request received to ask remote server for a shared secret, for legacy end-points", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"requestBody": { |
|||
"required": true, |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"url", |
|||
"token" |
|||
], |
|||
"properties": { |
|||
"url": { |
|||
"type": "string", |
|||
"description": "URL of the server" |
|||
}, |
|||
"token": { |
|||
"type": "string", |
|||
"description": "Token of the server" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret requested successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Requesting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/cloud/shared-secret": { |
|||
"get": { |
|||
"operationId": "ocs_authapi-get-shared-secret", |
|||
"summary": "Create shared secret and return it", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "url", |
|||
"in": "query", |
|||
"description": "URL of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "token", |
|||
"in": "query", |
|||
"description": "Token of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret returned", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"sharedSecret" |
|||
], |
|||
"properties": { |
|||
"sharedSecret": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Getting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"post": { |
|||
"operationId": "ocs_authapi-request-shared-secret", |
|||
"summary": "Request received to ask remote server for a shared secret", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"requestBody": { |
|||
"required": true, |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"url", |
|||
"token" |
|||
], |
|||
"properties": { |
|||
"url": { |
|||
"type": "string", |
|||
"description": "URL of the server" |
|||
}, |
|||
"token": { |
|||
"type": "string", |
|||
"description": "Token of the server" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret requested successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Requesting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"tags": [ |
|||
{ |
|||
"name": "ocs_authapi", |
|||
"description": "Class OCSAuthAPI\nOCS API end-points to exchange shared secret between two connected Nextclouds" |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,863 @@ |
|||
{ |
|||
"openapi": "3.0.3", |
|||
"info": { |
|||
"title": "federation-full", |
|||
"version": "0.0.1", |
|||
"description": "Federation allows you to connect with other trusted servers to exchange the account directory.", |
|||
"license": { |
|||
"name": "agpl" |
|||
} |
|||
}, |
|||
"components": { |
|||
"securitySchemes": { |
|||
"basic_auth": { |
|||
"type": "http", |
|||
"scheme": "basic" |
|||
}, |
|||
"bearer_auth": { |
|||
"type": "http", |
|||
"scheme": "bearer" |
|||
} |
|||
}, |
|||
"schemas": { |
|||
"OCSMeta": { |
|||
"type": "object", |
|||
"required": [ |
|||
"status", |
|||
"statuscode" |
|||
], |
|||
"properties": { |
|||
"status": { |
|||
"type": "string" |
|||
}, |
|||
"statuscode": { |
|||
"type": "integer" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
}, |
|||
"totalitems": { |
|||
"type": "string" |
|||
}, |
|||
"itemsperpage": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"paths": { |
|||
"/ocs/v2.php/apps/federation/api/v1/shared-secret": { |
|||
"get": { |
|||
"operationId": "ocs_authapi-get-shared-secret-legacy", |
|||
"summary": "Create shared secret and return it, for legacy end-points", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "url", |
|||
"in": "query", |
|||
"description": "URL of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "token", |
|||
"in": "query", |
|||
"description": "Token of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret returned", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"sharedSecret" |
|||
], |
|||
"properties": { |
|||
"sharedSecret": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Getting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/apps/federation/api/v1/request-shared-secret": { |
|||
"post": { |
|||
"operationId": "ocs_authapi-request-shared-secret-legacy", |
|||
"summary": "Request received to ask remote server for a shared secret, for legacy end-points", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"requestBody": { |
|||
"required": true, |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"url", |
|||
"token" |
|||
], |
|||
"properties": { |
|||
"url": { |
|||
"type": "string", |
|||
"description": "URL of the server" |
|||
}, |
|||
"token": { |
|||
"type": "string", |
|||
"description": "Token of the server" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret requested successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Requesting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/cloud/shared-secret": { |
|||
"get": { |
|||
"operationId": "ocs_authapi-get-shared-secret", |
|||
"summary": "Create shared secret and return it", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "url", |
|||
"in": "query", |
|||
"description": "URL of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "token", |
|||
"in": "query", |
|||
"description": "Token of the server", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "string" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret returned", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"sharedSecret" |
|||
], |
|||
"properties": { |
|||
"sharedSecret": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Getting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"post": { |
|||
"operationId": "ocs_authapi-request-shared-secret", |
|||
"summary": "Request received to ask remote server for a shared secret", |
|||
"tags": [ |
|||
"ocs_authapi" |
|||
], |
|||
"security": [ |
|||
{}, |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"requestBody": { |
|||
"required": true, |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"url", |
|||
"token" |
|||
], |
|||
"properties": { |
|||
"url": { |
|||
"type": "string", |
|||
"description": "URL of the server" |
|||
}, |
|||
"token": { |
|||
"type": "string", |
|||
"description": "Token of the server" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Shared secret requested successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"403": { |
|||
"description": "Requesting shared secret is not allowed", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"ocs" |
|||
], |
|||
"properties": { |
|||
"ocs": { |
|||
"type": "object", |
|||
"required": [ |
|||
"meta", |
|||
"data" |
|||
], |
|||
"properties": { |
|||
"meta": { |
|||
"$ref": "#/components/schemas/OCSMeta" |
|||
}, |
|||
"data": {} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/apps/federation/trusted-servers": { |
|||
"get": { |
|||
"operationId": "settings-get-servers", |
|||
"summary": "List all trusted servers", |
|||
"description": "This endpoint requires admin access", |
|||
"tags": [ |
|||
"settings" |
|||
], |
|||
"security": [ |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "List of trusted servers", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "array", |
|||
"items": { |
|||
"type": "object", |
|||
"required": [ |
|||
"id", |
|||
"status", |
|||
"url" |
|||
], |
|||
"properties": { |
|||
"id": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
}, |
|||
"status": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
}, |
|||
"url": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"ok" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"post": { |
|||
"operationId": "settings-add-server", |
|||
"summary": "Add server to the list of trusted Nextcloud servers", |
|||
"description": "This endpoint requires admin access", |
|||
"tags": [ |
|||
"settings" |
|||
], |
|||
"security": [ |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"requestBody": { |
|||
"required": true, |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"url" |
|||
], |
|||
"properties": { |
|||
"url": { |
|||
"type": "string", |
|||
"description": "The URL of the server to add" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Server added successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"id", |
|||
"message", |
|||
"url" |
|||
], |
|||
"properties": { |
|||
"id": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
}, |
|||
"url": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"ok" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"404": { |
|||
"description": "Server not found at the given URL", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"hint", |
|||
"message" |
|||
], |
|||
"properties": { |
|||
"hint": { |
|||
"type": "string" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"error" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"409": { |
|||
"description": "Server is already in the list of trusted servers", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"hint", |
|||
"message" |
|||
], |
|||
"properties": { |
|||
"hint": { |
|||
"type": "string" |
|||
}, |
|||
"message": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"error" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"/ocs/v2.php/apps/federation/trusted-servers/{id}": { |
|||
"delete": { |
|||
"operationId": "settings-remove-server", |
|||
"summary": "Add server to the list of trusted Nextcloud servers", |
|||
"description": "This endpoint requires admin access", |
|||
"tags": [ |
|||
"settings" |
|||
], |
|||
"security": [ |
|||
{ |
|||
"bearer_auth": [] |
|||
}, |
|||
{ |
|||
"basic_auth": [] |
|||
} |
|||
], |
|||
"parameters": [ |
|||
{ |
|||
"name": "id", |
|||
"in": "path", |
|||
"description": "The ID of the trusted server to remove", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "OCS-APIRequest", |
|||
"in": "header", |
|||
"description": "Required to be true for the API request to pass", |
|||
"required": true, |
|||
"schema": { |
|||
"type": "boolean", |
|||
"default": true |
|||
} |
|||
} |
|||
], |
|||
"responses": { |
|||
"200": { |
|||
"description": "Server removed successfully", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"id" |
|||
], |
|||
"properties": { |
|||
"id": { |
|||
"type": "integer", |
|||
"format": "int64" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"ok" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"404": { |
|||
"description": "Server not found at the given ID", |
|||
"content": { |
|||
"application/json": { |
|||
"schema": { |
|||
"type": "object", |
|||
"required": [ |
|||
"data", |
|||
"status" |
|||
], |
|||
"properties": { |
|||
"data": { |
|||
"type": "object", |
|||
"required": [ |
|||
"message" |
|||
], |
|||
"properties": { |
|||
"message": { |
|||
"type": "string" |
|||
} |
|||
} |
|||
}, |
|||
"status": { |
|||
"type": "string", |
|||
"enum": [ |
|||
"error" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"tags": [ |
|||
{ |
|||
"name": "ocs_authapi", |
|||
"description": "Class OCSAuthAPI\nOCS API end-points to exchange shared secret between two connected Nextclouds" |
|||
} |
|||
] |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue