-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
153 lines (153 loc) · 7.87 KB
/
openapi.json
File metadata and controls
153 lines (153 loc) · 7.87 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
"openapi": "3.0.3",
"info": {
"title": "Export exchange API",
"description": "API for Grip on Software export exchange upload.",
"version": "1.0.0",
"contact": {
"name": "Grip on Software",
"url": "https://gros.liacs.nl"
},
"license": {
"name": "Apache License, Version 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"paths": {
"/exchange": {
"post": {
"summary": "Exchange public keys",
"description": "Exchange public keys of a known export client and the upload server.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"examples": {
"client_pubkey": {
"value": {
"pubkey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmDMEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/U\nb7O1u120JkFsaWNlIExvdmVsYWNlIDxhbGljZUBvcGVucGdwLmV4YW1wbGU+iJAE\nExYIADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTrhbtfozp14V6UTmPy\nMVUMT0fjjgUCXaWfOgAKCRDyMVUMT0fjjukrAPoDnHBSogOmsHOsd9qGsiZpgRnO\ndypvbm+QtXZqth9rvwD9HcDC0tC+PHAsO7OTh1S1TC9RiJsvawAfCPaQZoed8gK4\nOARcRwTpEgorBgEEAZdVAQUBAQdAQv8GIa2rSTzgqbXCpDDYMiKRVitCsy203x3s\nE9+eviIDAQgHiHgEGBYIACAWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXEcE6QIb\nDAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn\n0QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwYWhmvOgE=\n=iIGO\n-----END PGP PUBLIC KEY BLOCK-----"
}
}
},
"schema": {
"$ref": "schema/export-exchange/exchange.json#/$defs/exchange"
}
}
}
},
"responses": {
"200": {
"description": "Key exchange success",
"content": {
"application/json": {
"examples": {
"server_pubkey": {
"value": {
"pubkey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmDMEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/U\nb7O1u120JkFsaWNlIExvdmVsYWNlIDxhbGljZUBvcGVucGdwLmV4YW1wbGU+iJAE\nExYIADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTrhbtfozp14V6UTmPy\nMVUMT0fjjgUCXaWfOgAKCRDyMVUMT0fjjukrAPoDnHBSogOmsHOsd9qGsiZpgRnO\ndypvbm+QtXZqth9rvwD9HcDC0tC+PHAsO7OTh1S1TC9RiJsvawAfCPaQZoed8gK4\nOARcRwTpEgorBgEEAZdVAQUBAQdAQv8GIa2rSTzgqbXCpDDYMiKRVitCsy203x3s\nE9+eviIDAQgHiHgEGBYIACAWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXEcE6QIb\nDAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn\n0QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwYWhmvOgE=\n=iIGO\n-----END PGP PUBLIC KEY BLOCK-----"
}
}
},
"schema": {
"$ref": "schema/export-exchange/exchange.json#/$defs/exchange"
}
}
}
},
"500": {
"description": "Public key error",
"content": {
"application/json": {
"examples": {
"pubkey_error": {
"value": {
"success": false,
"error": {
"status": "500 Internal Server Error",
"message": "Must be an acceptable public key"
},
"version": {
"upload": "1"
}
}
}
},
"schema": {
"$ref": "schema/export-exchange/error_response.json#/$defs/error_response"
}
}
}
}
}
}
},
"/upload": {
"post": {
"summary": "Upload files",
"description": "Upload files to the server, encrypted with a known and validated GPG key of the client.",
"requestBody": {
"required": true,
"description": "Files uploaded in the form data should have either `application/pgp-encrypted` or `application/x-pgp-encrypted-binary` MIME type to indicate if the file is armored as a binary file or not. Files must have an acceptable file name configured by the server.",
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"files": {
"type": "array",
"items": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Upload success",
"content": {
"application/json": {
"examples": {
"upload_success": {
"value": {
"success": true
}
}
},
"schema": {
"$ref": "schema/export-exchange/upload_response.json#/$defs/upload_response"
}
}
}
},
"500": {
"description": "Upload error",
"content": {
"application/json": {
"examples": {
"upload_error": {
"value": {
"success": false,
"error": {
"status": "500 Internal Server Error",
"message": "No name provided for file #0"
},
"version": {
"upload": "1"
}
}
}
},
"schema": {
"$ref": "schema/export-exchange/error_response.json#/$defs/error_response"
}
}
}
}
}
}
}
}
}