-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi-docs-v0.1.yaml
129 lines (127 loc) · 4.01 KB
/
api-docs-v0.1.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
openapi: 3.0.1
info:
title: Anode VPN Server
description: 'VPN server for Anode at [http://localhost](http://localhost)'
termsOfService: 'http://anode.co/terms/'
contact:
email: [email protected]
version: "1.0"
externalDocs:
description: Find out more about Anode
url: 'http://anode.co'
servers:
- url: 'https://localhost:8888/'
tags:
- name: Authorize
description: 'Authorize clients on the VPN'
externalDocs:
description: Find out more
url: 'http://api.anode.co'
paths:
/api/0.3/server/authorize/:
post:
tags:
- Authorize
summary: Authorize cjdns public key
description: Client requests authorization from VPN server for access to the VPN, including active network routes and IP address allocation.
operationId: addClientAuthorization
requestBody:
description: Client public key
content:
application/json:
schema:
$ref: '#/components/schemas/PublicKeyInput'
required: true
responses:
'201':
description: Created. New client authorized
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
'200':
description: OK. Authorization extended
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
'403':
description: Forbidden. This cilent is not authorized to connect
'407':
description: Proxy Authentication Failed. The coordinaton server signature could not be verified
'500':
description: Server Error. Response for all other errors.
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
'503':
description: Service Unavailable. No more IP addresses for allocation.
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
/api/0.3/server/authorize/{clientPublicKey}:
delete:
tags:
- Authorize
summary: Remove authorized public key
description: Remove authorization for a client public key
operationId: removeClientAuthorization
parameters:
- in: path
name: clientPublicKey
schema:
type: string
example: lbqr0rzyc2tuysw3w8gfr95u68kujzlq7zht5hyf452u8yshr120.k
description: authorized client cjdns public key
required: true
responses:
'200':
description: OK. Authorization removed
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
'404':
description: Not found.
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
components:
schemas:
StatusResponse:
type: object
properties:
status:
type: string
example: 'success'
enum:
- success
- error
description: >
Status:
* `success` - Method completed successfully
* `error` - Error processing request
message:
type: string
example: 'not found'
description: Human readable text describing the nature of the status
expiresAt:
type: string
format: integer
example: '1591963516'
description: Unix timestamp representing the date and time the authorization and allocated IP addresses expires
date:
type: string
format: integer
example: '1591963441'
description: Unix-timestamp of response
PublicKeyInput:
type: object
properties:
clientPublicKey:
type: string
example: skZ6UtW5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB.k
description: A cjdns client's public key