diff options
author | jld3103 <jld3103yt@gmail.com> | 2023-06-14 09:44:03 +0200 |
---|---|---|
committer | jld3103 <jld3103yt@gmail.com> | 2023-07-12 09:21:01 +0200 |
commit | 4ead6e64a41d9591ac8bf8918f293dbcae908243 (patch) | |
tree | 09a0d041f867ea662d0dc8598d94e6ec5dd4d862 /apps/federatedfilesharing/openapi.json | |
parent | 46284f1696700c2553d8d2f5340ad3bcbad08470 (diff) | |
download | nextcloud-server-4ead6e64a41d9591ac8bf8918f293dbcae908243.tar.gz nextcloud-server-4ead6e64a41d9591ac8bf8918f293dbcae908243.zip |
federatedfilesharing: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'apps/federatedfilesharing/openapi.json')
-rw-r--r-- | apps/federatedfilesharing/openapi.json | 955 |
1 files changed, 955 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/openapi.json b/apps/federatedfilesharing/openapi.json new file mode 100644 index 00000000000..0bbe535cc2a --- /dev/null +++ b/apps/federatedfilesharing/openapi.json @@ -0,0 +1,955 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "federatedfilesharing", + "version": "0.0.1", + "description": "Provide federated file sharing across servers", + "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": { + "/index.php/apps/federatedfilesharing/createFederatedShare": { + "post": { + "operationId": "mount_public_link-create-federated-share", + "summary": "send federated share to a user of a public link", + "tags": [ + "mount_public_link" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "shareWith", + "in": "query", + "description": "Username to share with", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "token", + "in": "query", + "description": "Token of the share", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "Password of the share", + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "Remote URL returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "remoteUrl" + ], + "properties": { + "remoteUrl": { + "type": "string" + } + } + } + } + } + }, + "400": { + "description": "Creating share is not possible", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/shares": { + "post": { + "operationId": "request_handler-create-share", + "summary": "create a new share", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "remote", + "in": "query", + "description": "Address of the remote", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "name", + "in": "query", + "description": "Name of the shared resource", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "owner", + "in": "query", + "description": "Display name of the receiver", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "sharedBy", + "in": "query", + "description": "Display name of the sender", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "shareWith", + "in": "query", + "description": "ID of the user that receives the share", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "remoteId", + "in": "query", + "description": "ID of the remote", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "sharedByFederatedId", + "in": "query", + "description": "Federated ID of the sender", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "ownerFederatedId", + "in": "query", + "description": "Federated ID of the receiver", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "", + "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/shares/{id}/reshare": { + "post": { + "operationId": "request_handler-re-share", + "summary": "create re-share on behalf of another user", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "shareWith", + "in": "query", + "description": "ID of the user that receives the share", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "remoteId", + "in": "query", + "description": "ID of the remote", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": 0 + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Remote share 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": [ + "token", + "remoteId" + ], + "properties": { + "token": { + "type": "string" + }, + "remoteId": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "Re-sharing is not possible", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/shares/{id}/permissions": { + "post": { + "operationId": "request_handler-update-permissions", + "summary": "update share information to keep federated re-shares in sync", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "permissions", + "in": "query", + "description": "New permissions", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Permissions updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + }, + "400": { + "description": "Updating permissions is not possible", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/shares/{id}/accept": { + "post": { + "operationId": "request_handler-accept-share", + "summary": "accept server-to-server share", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the remote share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Share accepted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/shares/{id}/decline": { + "post": { + "operationId": "request_handler-decline-share", + "summary": "decline server-to-server share", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the remote share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "", + "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/shares/{id}/unshare": { + "post": { + "operationId": "request_handler-unshare", + "summary": "remove server-to-server share if it was unshared by the owner", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "", + "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/shares/{id}/revoke": { + "post": { + "operationId": "request_handler-revoke", + "summary": "federated share was revoked, either by the owner or the re-sharer", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Share revoked successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + }, + "400": { + "description": "Revoking the share is not possible", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/cloud/shares/{id}/move": { + "post": { + "operationId": "request_handler-move", + "summary": "change the owner of a server-to-server share", + "tags": [ + "request_handler" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "token", + "in": "query", + "description": "Shared secret between servers", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "remote", + "in": "query", + "description": "Address of the remote", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "remote_id", + "in": "query", + "description": "ID of the remote", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "id", + "in": "path", + "description": "ID of the share", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Share moved successfully", + "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": [ + "remote", + "owner" + ], + "properties": { + "remote": { + "type": "string" + }, + "owner": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "Moving share is not possible", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "tags": [ + { + "name": "mount_public_link", + "description": "Class MountPublicLinkController\nconvert public links to federated shares" + } + ] +}
\ No newline at end of file |