You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec.yaml
+130Lines changed: 130 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,8 @@ paths:
60
60
This endpoint is used by a Sending Server to notify a Receiving Server that
61
61
a new Share has been created. See [Share Creation Notification](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#share-creation-notification)
62
62
for more details.
63
+
parameters:
64
+
- $ref: "#/components/parameters/journalId"
63
65
requestBody:
64
66
content:
65
67
application/json:
@@ -142,6 +144,8 @@ paths:
142
144
that concerns a previously known entity, such as a Share or a trusted User.
143
145
See [Share Acceptance Notification](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#share-acceptance-notification)
144
146
for more details.
147
+
parameters:
148
+
- $ref: "#/components/parameters/journalId"
145
149
requestBody:
146
150
content:
147
151
application/json:
@@ -208,6 +212,8 @@ paths:
208
212
This optional endpoint is used to inform the Sender that an Invitation was accepted.
209
213
See [Invite flow](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#invite-flow)
210
214
for more details.
215
+
parameters:
216
+
- $ref: "#/components/parameters/journalId"
211
217
requestBody:
212
218
content:
213
219
application/json:
@@ -247,6 +253,84 @@ paths:
247
253
application/json:
248
254
schema:
249
255
$ref: "#/components/schemas/Error"
256
+
/journal:
257
+
get:
258
+
summary: Journal Replay endpoint
259
+
description: >
260
+
This optional endpoint allows a Receiving Server to request OCM messages
261
+
it may have missed from a Sending Server. The Sending Server maintains a
262
+
sequential journal of all OCM messages sent to each Receiving Server,
263
+
scoped per (sender, receiver, message type) tuple. Journal IDs are
264
+
monotonically increasing integers assigned to each outgoing message.
265
+
266
+
267
+
Servers that expose the `journaling` capability MUST support this
268
+
endpoint. This endpoint MUST require HTTP Request Signatures [RFC9421]
269
+
for authentication. Servers that do not support the `http-sig` capability
270
+
MUST NOT expose this endpoint.
271
+
272
+
273
+
The Sending Server identifies the caller via the HTTP signature and
274
+
serves the appropriate journal entries for the (sender, caller, messageType)
275
+
tuple.
276
+
277
+
278
+
The journal MAY be compacted: when a sequence of messages effectively
279
+
cancels out (e.g. a share followed by an unshare of the same resource),
280
+
the Sending Server MAY replace them with `noop` entries. This preserves
281
+
sequence continuity while reflecting the current effective state.
282
+
parameters:
283
+
- name: since
284
+
in: query
285
+
required: true
286
+
description: >
287
+
Return journal entries with a journalId strictly greater than
288
+
this value. Use 0 to request the full (possibly compacted) journal.
289
+
schema:
290
+
type: integer
291
+
minimum: 0
292
+
- name: messageType
293
+
in: query
294
+
required: true
295
+
description: >
296
+
The type of OCM message journal to query. Each message type
297
+
maintains a separate journal per (sender, receiver) pair.
298
+
schema:
299
+
type: string
300
+
enum:
301
+
- share
302
+
- notification
303
+
- invite-accepted
304
+
responses:
305
+
"200":
306
+
description: >
307
+
Successfully retrieved journal entries. The entries MUST be ordered
308
+
by journalId in ascending order.
309
+
content:
310
+
application/json:
311
+
schema:
312
+
type: object
313
+
required:
314
+
- entries
315
+
properties:
316
+
entries:
317
+
type: array
318
+
items:
319
+
$ref: "#/components/schemas/JournalEntry"
320
+
"403":
321
+
description: >
322
+
Caller cannot be authenticated via HTTP Request Signatures or
323
+
is not authorized to access this journal.
324
+
content:
325
+
application/json:
326
+
schema:
327
+
$ref: "#/components/schemas/Error"
328
+
"501":
329
+
description: This server does not support journaling.
330
+
content:
331
+
application/json:
332
+
schema:
333
+
$ref: "#/components/schemas/Error"
250
334
components:
251
335
parameters:
252
336
id:
@@ -256,6 +340,19 @@ components:
256
340
required: true
257
341
schema:
258
342
type: string
343
+
journalId:
344
+
name: OCM-Journal-Id
345
+
in: header
346
+
required: false
347
+
description: >
348
+
Sequential journal identifier for this message, scoped per
349
+
(sender, receiver, message type) tuple. Servers that expose the
350
+
`journaling` capability MUST include this header in all outgoing
351
+
OCM messages. Receiving Servers that do not support journaling
352
+
MAY ignore this header.
353
+
schema:
354
+
type: integer
355
+
minimum: 1
259
356
page:
260
357
name: page
261
358
in: query
@@ -405,6 +502,7 @@ components:
405
502
- http-sig
406
503
- invites
407
504
- invite-wayf
505
+
- journaling
408
506
- notifications
409
507
- protocol-object
410
508
- webdav-uri
@@ -901,3 +999,35 @@ components:
901
999
type: number
902
1000
description: Number of seconds before this access_token will need to be refreshed.
903
1001
example: 300
1002
+
JournalEntry:
1003
+
type: object
1004
+
required:
1005
+
- journalId
1006
+
- message
1007
+
properties:
1008
+
journalId:
1009
+
type: integer
1010
+
minimum: 1
1011
+
description: >
1012
+
Monotonically increasing sequence number scoped per
1013
+
(sender, receiver, message type) tuple. Journal IDs MUST be
1014
+
strictly increasing but need not be contiguous.
1015
+
example: 42
1016
+
message:
1017
+
description: >
1018
+
The OCM message body. The message type is determined by the
1019
+
`messageType` query parameter used to request the journal.
1020
+
Compacted entries are represented as Noop (empty object `{}`).
1021
+
oneOf:
1022
+
- $ref: "#/components/schemas/NewShare"
1023
+
- $ref: "#/components/schemas/NewNotification"
1024
+
- $ref: "#/components/schemas/AcceptedInvite"
1025
+
- $ref: "#/components/schemas/Noop"
1026
+
Noop:
1027
+
type: object
1028
+
description: >
1029
+
A no-operation message representing a compacted journal entry.
1030
+
When a sequence of messages effectively cancels out (e.g. a share
1031
+
followed by an unshare of the same resource), the Sending Server
1032
+
MAY replace them with noop entries to preserve journal sequence
0 commit comments