From 9779f5dc5facd7e9b7c99535305d66455f1339fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danil=20Shaymurzin=20=E2=9A=A1=EF=B8=8F?= Date: Mon, 12 Feb 2024 19:52:13 +0500 Subject: [PATCH] fix(server): api specification #1499 (#1503) --- src/shadowbox/server/api.yml | 52 +++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/shadowbox/server/api.yml b/src/shadowbox/server/api.yml index 80eee5526..13cb55607 100644 --- a/src/shadowbox/server/api.yml +++ b/src/shadowbox/server/api.yml @@ -175,6 +175,30 @@ paths: '1': value: >- {"id":"1","name":"Second","password":"xXxXxX","port":9795,"method":"chacha20-ietf-poly1305","accessUrl":"ss://ASDFHAKSDFSDAKFJ@0.0.0.0:9795/?outline=1"} + get: + description: Lists the access keys + tags: + - Access Key + responses: + '200': + description: List of access keys + content: + application/json: + schema: + type: object + properties: + accessKeys: + type: array + items: + $ref: "#/components/schemas/AccessKey" + examples: + '0': + value: >- + {"accessKeys":[ + {"id":"0","name":"Admin","password":"XxXxXx","port":18162,"method":"chacha20-ietf-poly1305","accessUrl":"ss://SADFJSKADFJAKSD@0.0.0.0:18162/?outline=1"}, + {"id":"1","name":"First","password":"xXxXxX","port":4410,"method":"chacha20-ietf-poly1305","accessUrl":"ss://ASDFSADJFKAS=@0.0.0.0:4410/?outline=1"}, + {"id":"2","name":"SecondWithCustomDataLimit","password":"XxXxXx","port":25424,"method":"chacha20-ietf-poly1305","dataLimit":{"bytes":8589934592},"accessUrl":"ss://ASDFHAKSDFSDAKFJ@0.0.0.0:25424/?outline=1"}]} + /access-keys/{id}: put: description: Creates a new access key with a specific identifer tags: @@ -186,8 +210,6 @@ paths: schema: type: object properties: - id: - type: string name: type: string method: @@ -200,7 +222,7 @@ paths: $ref: "#/components/schemas/DataLimit" examples: '0': - value: '{"id":"123","method":"aes-192-gcm","name":"First","password":"8iu8V8EeoFVpwQvQeS9wiD","port": 12345,"limit":{"bytes":10000}}' + value: '{"method":"aes-192-gcm","name":"First","password":"8iu8V8EeoFVpwQvQeS9wiD","port": 12345,"limit":{"bytes":10000}}' responses: '201': description: The newly created access key @@ -212,30 +234,6 @@ paths: '0': value: >- {"id":"my-identifier","name":"First","password":"XxXxXx","port":9795,"method":"chacha20-ietf-poly1305","accessUrl":"ss://SADFJSKADFJAKSD@0.0.0.0:9795/?outline=1"} - get: - description: Lists the access keys - tags: - - Access Key - responses: - '200': - description: List of access keys - content: - application/json: - schema: - type: object - properties: - accessKeys: - type: array - items: - $ref: "#/components/schemas/AccessKey" - examples: - '0': - value: >- - {"accessKeys":[ - {"id":"0","name":"Admin","password":"XxXxXx","port":18162,"method":"chacha20-ietf-poly1305","accessUrl":"ss://SADFJSKADFJAKSD@0.0.0.0:18162/?outline=1"}, - {"id":"1","name":"First","password":"xXxXxX","port":4410,"method":"chacha20-ietf-poly1305","accessUrl":"ss://ASDFSADJFKAS=@0.0.0.0:4410/?outline=1"}, - {"id":"2","name":"SecondWithCustomDataLimit","password":"XxXxXx","port":25424,"method":"chacha20-ietf-poly1305","dataLimit":{"bytes":8589934592},"accessUrl":"ss://ASDFHAKSDFSDAKFJ@0.0.0.0:25424/?outline=1"}]} - /access-keys/{id}: get: description: Get an access key tags: