Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
339 lines (339 loc) · 10.3 KB
/
Copy pathopenapi.yaml
File metadata and controls
339 lines (339 loc) · 10.3 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
components:
schemas:
dto.CheckRoomHTTPRequest:
properties:
creator:
type: string
is_direct:
type: boolean
members:
items:
type: string
type: array
required:
- creator
- members
- is_direct
type: object
dto.CheckRoomHTTPResponse:
properties:
alkemio_room_id:
type: string
allow:
type: boolean
reason:
type: string
required:
- allow
type: object
dto.DMWebhookPayload:
properties:
invitee:
type: string
inviter:
type: string
required:
- inviter
- invitee
type: object
http.MediaUploadResult:
properties:
contentUri:
type: string
mediaId:
type: string
required:
- contentUri
- mediaId
type: object
securitySchemes:
apiKeyAuth:
in: header
name: Authorization
type: apiKey
info:
contact:
email: info@alkem.io
name: Alkemio
url: https://alkem.io
description: |
Matrix Adapter service for the Alkemio platform. Bridges the Alkemio Server
and Matrix Homeserver using mautrix-go and RabbitMQ. Provides AppService
transaction handling, room creation check endpoints, and health probes.
license:
name: EUPL-1.2
url: https://opensource.org/licenses/EUPL-1.2
title: Alkemio Matrix Adapter
version: 1.0.0
openapi: 3.1.1
paths:
/_matrix/app/alkemio/check-room:
post:
operationId: CheckRoomHandler.handleCheckRoom
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/dto.CheckRoomHTTPRequest'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/dto.CheckRoomHTTPResponse'
description: OK
"400":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Bad Request
"401":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Unauthorized
"500":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Internal Server Error
"504":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Gateway Timeout
security:
- apiKeyAuth: []
/_matrix/app/alkemio/dm-request:
post:
operationId: DMWebhookHandler.handleDMRequest
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/dto.DMWebhookPayload'
required: true
responses:
"200":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: OK
"400":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Bad Request
"401":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Unauthorized
"500":
content:
application/json:
schema:
additionalProperties:
type: string
type: object
description: Internal Server Error
security:
- apiKeyAuth: []
summary: handleDMRequest processes DM request webhooks from Synapse.
/health/live:
get:
operationId: app.go:76:40
responses:
"200":
content:
application/json:
schema:
type: string
description: OK
/health/ready:
get:
operationId: app.go:80:41
responses:
"200":
content:
application/json:
schema:
type: string
description: OK
/rest/messaging/media/upload:
post:
operationId: MediaUploadHandler.handleUpload
summary: Upload an original attachment stream to Synapse without publishing an event.
description: |
Authenticated gateway route for room-neutral browser uploads. The gateway strips
client actor headers and forwards its resolved actor identity. The request body
is original bytes, never JSON or multipart. Content-Type is required and
must contain the original MIME type. Content-Length is exact and required,
including for a zero-byte file. A body that is not an image streams through
unchanged. A JPEG, PNG or WebP body, recognised from its bytes, is read whole and
stored without its location, device and time metadata, with the content type and
length of the rewritten bytes; of its Exif data only the orientation tag is kept.
A corrupt image is refused with 400 invalid_media; an image the memory budget cannot take
in time with 503 upload_busy and Retry-After; an image body that stalls with 408
upload_timeout. The stream is not retried. Success is 201 only after the
synchronous Synapse media provider has stored the upload.
parameters:
- in: header
name: X-Alkemio-Actor-Id
required: true
description: Gateway-resolved non-guest Alkemio actor UUID; never supplied by the browser.
schema:
type: string
format: uuid
- in: query
name: filename
required: true
description: Nonempty UTF-8 filename encoded as an ordinary query parameter; controls are rejected.
schema:
type: string
- in: header
name: Content-Length
required: true
description: Exact number of original bytes, including zero; bounded by MaxAttachmentBytes.
schema:
type: integer
format: int64
minimum: 0
requestBody:
required: true
description: Raw original bytes; Content-Type declares their MIME type.
content:
'*/*':
schema:
type: string
format: binary
responses:
"201":
description: Synapse upload completed, without publishing a message event.
content:
application/json:
schema:
type: object
required: [contentUri, mediaId]
properties:
contentUri:
type: string
description: Local homeserver mxc URI of the completed upload.
mediaId:
type: string
description: Media identifier embedded in contentUri.
"400":
description: Invalid request metadata or media.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [invalid_display_name, invalid_content_type, invalid_media]
"401":
description: Gateway actor identity is absent, invalid, anonymous or a guest.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [invalid_actor]
"408":
description: Upload was canceled, or an image body stopped arriving (slower than 32 KiB/s) and was cut off.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [upload_canceled, upload_timeout]
"411":
description: Content-Length is required.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [length_required]
"413":
description: Media exceeds the upload byte limit.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [media_too_large]
"502":
description: Synapse rejected the upload or its upload request failed.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [upstream_rejected, upstream_upload_failed]
"503":
description: Too many images are being processed, or the actor already has two images in flight; nothing was uploaded. Retry after the Retry-After interval.
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [upload_busy]
"504":
description: Upload timed out.
content:
application/json:
schema:
type: object
required: [error]
properties:
error:
type: string
enum: [upload_timeout]