yaxc/swagger.yml
2021-05-13 19:59:45 +02:00

116 lines
No EOL
3.5 KiB
YAML

swagger: "2.0"
info:
description: "YAxC - Yet Another Cross Clipboard"
version: "1.1.0"
title: "YAxC"
host: "yaxc.d2a.io"
basePath: "/"
tags:
- name: "{anywhere}"
description: "Public Clipboard Name"
schemes:
- "https"
- "http"
paths:
'/{anywhere}':
post:
tags:
- "{anywhere}"
summary: Post new clipboard data
consumes:
- 'text/plain'
produces:
- 'text/plain'
parameters:
- in: "path"
name: "anywhere"
description: |
Path under which the data is to be saved.
⚠️ Since the path is **publicly accessible** to **everyone**, either
* either no sensitive data should be sent to this path
* use a long, random path
* the data should be encrypted
(best on client-side, but it is possible on server-side by using the `secret` parameter, **which is not recommended!**)
required: true
type: string
- in: "body"
name: "contents"
description: "The content which should be uploaded"
required: true
schema:
type: string
default: "Hello World!"
- in: "query"
name: "secret"
description: |
Encrypts the content with the password (server-side!)
By default, the data is not encrypted.
**It is not recommended to encrypt the data on server side. The data should always be encrypted on the client side.**
However, if this is not possible, the `secret`-parameter can be used to specify a password with which the data should be encrypted.
required: false
type: string
- in: "query"
name: "ttl"
description: "Waiting time after which the content is deleted"
required: false
type: string
responses:
"200":
description: "OK"
"406":
description: "Invalid Path"
"413":
description: "Body too large"
"416":
description: "TTL out of range"
"422":
description: "Invalid TTL. (Examples: 10s, 5m, 1h)"
"423":
description: "Encryption password was specified, but encryption is not enabled on the server"
"500":
description: "Intenral server error; e.g. Encryption failed (server-side)"
get:
tags:
- "{anywhere}"
summary: Get clipboard data
produces:
- 'text/plain'
parameters:
- in: "path"
name: "anywhere"
description: |
Path under which the data is to be saved.
⚠️ Since the path is **publicly accessible** to **everyone**, either
* either no sensitive data should be sent to this path
* use a long, random path
* the data should be encrypted
(best on client-side, but it is possible on server-side by using the `secret` parameter, **which is not recommended!**)
required: true
type: string
- in: "query"
name: "secret"
description: |
If the data has been encrypted and should be decrypted on the server side (**which is btw. not recommended**),
the "password" can be passed via the `secret`-parameter.
required: false
type: string
responses:
"200":
description: "OK"
"406":
description: "Invalid Path"
"423":
description: "Encryption password was specified, but encryption is not enabled on the server"