Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
466 lines (466 loc) · 17 KB
/
Copy pathopenapi.yaml
File metadata and controls
466 lines (466 loc) · 17 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
openapi: 3.1.0
info:
title: Obiente Support Intake API
version: 1.0.0
description: Product-neutral private support intake. All successful report submissions require explicit user confirmation in the calling client.
license:
name: GNU Affero General Public License v3.0
identifier: AGPL-3.0-only
servers:
- url: https://support.obiente.org
security: []
paths:
/api/v1/products:
get:
summary: List supported Obiente products
operationId: listProducts
responses:
"200":
description: Registered products and their diagnostic constraints.
content:
application/json:
schema:
$ref: "#/components/schemas/ProductResponse"
/api/v1/reports:
post:
summary: Submit a private support report
operationId: createReport
parameters:
- $ref: "#/components/parameters/IdempotencyKey"
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [metadata]
properties:
metadata:
$ref: "#/components/schemas/ReportMetadata"
diagnostics:
type: string
format: binary
maxLength: 4194304
responses:
"201":
description: Private report receipt.
content:
application/json:
schema:
$ref: "#/components/schemas/Receipt"
"400": { $ref: "#/components/responses/Problem" }
"409": { $ref: "#/components/responses/Problem" }
"410": { $ref: "#/components/responses/Problem" }
/api/v1/receipts:
get:
summary: Reconcile an uncertain report submission
operationId: reconcileReceipt
description: Reconcile an ambiguous submission outcome without creating another report.
parameters:
- $ref: "#/components/parameters/IdempotencyKey"
responses:
"200":
description: Existing private report receipt.
content:
application/json:
schema:
$ref: "#/components/schemas/Receipt"
"404": { $ref: "#/components/responses/Problem" }
"410": { $ref: "#/components/responses/Problem" }
delete:
summary: Cancel a private report submission
operationId: cancelReportSubmission
description: Atomically prevent a pending submission from creating a report and delete any report already created with the same idempotency key.
parameters:
- $ref: "#/components/parameters/IdempotencyKey"
responses:
"204":
description: The submission is terminally cancelled and no private report remains available.
"400": { $ref: "#/components/responses/Problem" }
/api/v1/reports/{capability}:
parameters:
- name: capability
in: path
required: true
schema: { type: string, minLength: 43, maxLength: 43 }
get:
summary: Read a private report status through its capability
operationId: getPrivateReportStatus
responses:
"200":
description: Private report state.
content:
application/json:
schema:
$ref: "#/components/schemas/PrivateStatus"
"404": { $ref: "#/components/responses/Problem" }
delete:
summary: Delete a private report through its capability
operationId: deletePrivateReport
responses:
"200":
description: The private report was revoked and its diagnostic object removed.
content:
application/json:
schema:
$ref: "#/components/schemas/PrivateStatus"
"404": { $ref: "#/components/responses/Problem" }
/api/v1/reports/{capability}/messages:
post:
summary: Reply to a private support conversation
operationId: createPrivateReportMessage
parameters:
- name: capability
in: path
required: true
schema: { type: string, minLength: 43, maxLength: 43 }
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/MessageInput" }
responses:
"201":
description: Message added to the private report.
content:
application/json:
schema: { $ref: "#/components/schemas/PrivateStatus" }
"400": { $ref: "#/components/responses/Problem" }
"404": { $ref: "#/components/responses/Problem" }
/api/v1/admin/login:
post:
summary: Sign in a support maintainer
operationId: adminLogin
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [username, password]
properties:
username: { type: string }
password: { type: string, format: password }
responses:
"200":
description: Authenticated maintainer session. The server also sets an HTTP-only session cookie.
content:
application/json:
schema: { $ref: "#/components/schemas/AdminSession" }
"401": { $ref: "#/components/responses/Problem" }
"429": { $ref: "#/components/responses/Problem" }
/api/v1/admin/session:
get:
summary: Refresh the current maintainer session
operationId: refreshAdminSession
security: [{ AdminSessionCookie: [] }]
responses:
"200":
description: Current session with a freshly rotated CSRF token.
content:
application/json:
schema: { $ref: "#/components/schemas/AdminSession" }
"401": { $ref: "#/components/responses/Problem" }
/api/v1/admin/logout:
post:
summary: Sign out the current maintainer
operationId: adminLogout
security: [{ AdminSessionCookie: [] }]
parameters:
- $ref: "#/components/parameters/CSRFToken"
responses:
"204": { description: Session revoked. }
"401": { $ref: "#/components/responses/Problem" }
"403": { $ref: "#/components/responses/Problem" }
/api/v1/admin/reports:
get:
summary: List private reports for moderation
operationId: listAdminReports
security: [{ AdminSessionCookie: [] }]
parameters:
- name: status
in: query
schema: { $ref: "#/components/schemas/ReportStatus" }
- name: limit
in: query
schema: { type: integer, minimum: 1, maximum: 100, default: 25 }
- name: offset
in: query
schema: { type: integer, minimum: 0, default: 0 }
responses:
"200":
description: Private moderation queue.
content:
application/json:
schema: { $ref: "#/components/schemas/AdminReportResponse" }
"401": { $ref: "#/components/responses/Problem" }
/api/v1/admin/reports/{id}:
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
get:
summary: Read one private report for moderation
operationId: getAdminReport
security: [{ AdminSessionCookie: [] }]
responses:
"200":
description: Decrypted private report for maintainer review.
content:
application/json:
schema: { $ref: "#/components/schemas/AdminReportDetail" }
"401": { $ref: "#/components/responses/Problem" }
"404": { $ref: "#/components/responses/Problem" }
patch:
summary: Change a private report status
operationId: updateAdminReportStatus
security: [{ AdminSessionCookie: [] }]
parameters:
- $ref: "#/components/parameters/CSRFToken"
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [status]
properties:
status: { $ref: "#/components/schemas/ReportStatus" }
responses:
"200":
description: Updated private report.
content:
application/json:
schema: { $ref: "#/components/schemas/AdminReportDetail" }
"400": { $ref: "#/components/responses/Problem" }
"401": { $ref: "#/components/responses/Problem" }
"403": { $ref: "#/components/responses/Problem" }
"404": { $ref: "#/components/responses/Problem" }
/api/v1/admin/reports/{id}/diagnostics:
get:
summary: Download one private diagnostic archive
operationId: downloadAdminDiagnostics
security: [{ AdminSessionCookie: [] }]
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Decrypted diagnostic ZIP for an explicit maintainer download.
content:
application/zip:
schema: { type: string, format: binary }
"401": { $ref: "#/components/responses/Problem" }
"404": { $ref: "#/components/responses/Problem" }
"503":
description: The report exists but its private diagnostic archive is unavailable.
content:
application/json:
schema: { $ref: "#/components/schemas/Problem" }
example:
contractVersion: 1
code: diagnostics_unavailable
message: The report is available, but its diagnostic archive is unavailable.
/api/v1/admin/reports/{id}/messages:
post:
summary: Ask a reporter for more information
operationId: createAdminReportMessage
security: [{ AdminSessionCookie: [] }]
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
- $ref: "#/components/parameters/CSRFToken"
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/MessageInput" }
responses:
"201":
description: Encrypted maintainer message added and report marked as needing information.
content:
application/json:
schema: { $ref: "#/components/schemas/AdminReportDetail" }
"400": { $ref: "#/components/responses/Problem" }
"401": { $ref: "#/components/responses/Problem" }
"403": { $ref: "#/components/responses/Problem" }
"404": { $ref: "#/components/responses/Problem" }
components:
securitySchemes:
AdminSessionCookie:
type: apiKey
in: cookie
name: obiente_admin_session
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: true
schema: { type: string, pattern: "^[A-Za-z0-9_-]{32,128}$" }
CSRFToken:
name: X-CSRF-Token
in: header
required: true
schema: { type: string, minLength: 43, maxLength: 43 }
responses:
Problem:
description: A bounded, user-safe error.
content:
application/json:
schema:
$ref: "#/components/schemas/Problem"
schemas:
ProductResponse:
type: object
required: [contractVersion, products]
properties:
contractVersion: { const: 1 }
products:
type: array
items: { $ref: "#/components/schemas/Product" }
Product:
type: object
required: [id, name, description, diagnosticContentTypes, diagnosticEntries, diagnosticMaxBytes, diagnosticMaxExpandedBytes, retentionDays]
properties:
id: { type: string }
name: { type: string }
description: { type: string }
repository: { type: string }
diagnosticContentTypes: { type: array, items: { type: string } }
diagnosticEntries: { type: array, items: { type: string } }
diagnosticMaxBytes: { type: integer, minimum: 0 }
diagnosticMaxExpandedBytes: { type: integer, minimum: 0 }
retentionDays: { type: integer, minimum: 1 }
ReportMetadata:
type: object
required: [contractVersion, productId, requestType, title, description, source, release, privacyAccepted]
properties:
contractVersion: { const: 1 }
productId: { type: string }
requestType: { enum: [bug, feature, support] }
title: { type: string, minLength: 4, maxLength: 160 }
description: { type: string, minLength: 10, maxLength: 8000 }
contact: { type: string, maxLength: 320 }
source: { enum: [web, app] }
privacyAccepted: { const: true }
release:
type: object
required: [version, platform]
properties:
version: { type: string, maxLength: 80 }
channel: { type: string, maxLength: 40 }
platform: { type: string, maxLength: 60 }
osVersion: { type: string, maxLength: 120 }
architecture: { type: string, maxLength: 40 }
Receipt:
type: object
required: [contractVersion, supportCode, status, statusUrl, deletionUrl, createdAt, retentionUntil]
properties:
contractVersion: { const: 1 }
supportCode: { type: string }
status: { type: string }
statusUrl: { type: string, format: uri }
deletionUrl: { type: string, format: uri }
createdAt: { type: string, format: date-time }
retentionUntil: { type: string, format: date-time }
PrivateStatus:
type: object
required: [contractVersion, supportCode, productId, requestType, status, createdAt, updatedAt, retentionUntil, messages]
properties:
contractVersion: { const: 1 }
supportCode: { type: string }
productId: { type: string }
requestType: { type: string }
status: { type: string }
createdAt: { type: string, format: date-time }
updatedAt: { type: string, format: date-time }
retentionUntil: { type: string, format: date-time }
messages:
type: array
items: { $ref: "#/components/schemas/SupportMessage" }
MessageInput:
type: object
required: [body]
properties:
body: { type: string, minLength: 1, maxLength: 8192 }
SupportMessage:
type: object
required: [id, author, body, createdAt]
properties:
id: { type: string, format: uuid }
author: { enum: [maintainer, reporter] }
body: { type: string }
createdAt: { type: string, format: date-time }
ReportStatus:
type: string
enum: [new, needs_information, accepted, duplicate, resolved, rejected]
AdminSession:
type: object
required: [contractVersion, username, csrfToken, expiresAt]
properties:
contractVersion: { const: 1 }
username: { type: string }
csrfToken: { type: string, minLength: 43, maxLength: 43 }
expiresAt: { type: string, format: date-time }
AdminReportSummary:
type: object
required: [id, supportCode, productId, requestType, status, source, title, hasDiagnostics, createdAt, updatedAt, retentionUntil]
properties:
id: { type: string, format: uuid }
supportCode: { type: string }
productId: { type: string }
requestType: { enum: [bug, feature, support] }
status: { $ref: "#/components/schemas/ReportStatus" }
source: { enum: [web, app] }
title: { type: string }
hasDiagnostics: { type: boolean, description: Whether a diagnostic archive was attached to the report. }
diagnosticsState:
type: string
enum: [none, available, unavailable, unknown]
description: Current private object storage availability; unknown means the storage check failed.
createdAt: { type: string, format: date-time }
updatedAt: { type: string, format: date-time }
retentionUntil: { type: string, format: date-time }
AdminReportDetail:
allOf:
- $ref: "#/components/schemas/AdminReportSummary"
- type: object
required: [description, release, messages]
properties:
description: { type: string }
contact: { type: string }
release:
type: object
required: [version, platform]
properties:
version: { type: string }
channel: { type: string }
platform: { type: string }
osVersion: { type: string }
architecture: { type: string }
messages:
type: array
items: { $ref: "#/components/schemas/SupportMessage" }
AdminReportResponse:
type: object
required: [contractVersion, reports, total, limit, offset]
properties:
contractVersion: { const: 1 }
reports:
type: array
items: { $ref: "#/components/schemas/AdminReportSummary" }
total: { type: integer, minimum: 0 }
limit: { type: integer, minimum: 1 }
offset: { type: integer, minimum: 0 }
Problem:
type: object
required: [contractVersion, code, message]
properties:
contractVersion: { const: 1 }
code: { type: string }
message: { type: string }