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
@@ -43,6 +43,8 @@ paths:
43
43
This endpoint is used by a Sending Server to notify a Receiving Server that
44
44
a new Share has been created. See [Share Creation Notification](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#share-creation-notification)
45
45
for more details.
46
+
parameters:
47
+
- $ref: "#/components/parameters/journalId"
46
48
requestBody:
47
49
content:
48
50
application/json:
@@ -125,6 +127,8 @@ paths:
125
127
that concerns a previously known entity, such as a Share or a trusted User.
126
128
See [Share Acceptance Notification](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#share-acceptance-notification)
127
129
for more details.
130
+
parameters:
131
+
- $ref: "#/components/parameters/journalId"
128
132
requestBody:
129
133
content:
130
134
application/json:
@@ -191,6 +195,8 @@ paths:
191
195
This optional endpoint is used to inform the Sender that an Invitation was accepted.
192
196
See [Invite flow](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#invite-flow)
193
197
for more details.
198
+
parameters:
199
+
- $ref: "#/components/parameters/journalId"
194
200
requestBody:
195
201
content:
196
202
application/json:
@@ -230,6 +236,84 @@ paths:
230
236
application/json:
231
237
schema:
232
238
$ref: "#/components/schemas/Error"
239
+
/journal:
240
+
get:
241
+
summary: Journal Replay endpoint
242
+
description: >
243
+
This optional endpoint allows a Receiving Server to request OCM messages
244
+
it may have missed from a Sending Server. The Sending Server maintains a
245
+
sequential journal of all OCM messages sent to each Receiving Server,
246
+
scoped per (sender, receiver, message type) tuple. Journal IDs are
247
+
monotonically increasing integers assigned to each outgoing message.
248
+
249
+
250
+
Servers that expose the `journaling` capability MUST support this
251
+
endpoint. This endpoint MUST require HTTP Request Signatures [RFC9421]
252
+
for authentication. Servers that do not support the `http-sig` capability
253
+
MUST NOT expose this endpoint.
254
+
255
+
256
+
The Sending Server identifies the caller via the HTTP signature and
257
+
serves the appropriate journal entries for the (sender, caller, messageType)
258
+
tuple.
259
+
260
+
261
+
The journal MAY be compacted: when a sequence of messages effectively
262
+
cancels out (e.g. a share followed by an unshare of the same resource),
263
+
the Sending Server MAY replace them with `noop` entries. This preserves
264
+
sequence continuity while reflecting the current effective state.
265
+
parameters:
266
+
- name: since
267
+
in: query
268
+
required: true
269
+
description: >
270
+
Return journal entries with a journalId strictly greater than
271
+
this value. Use 0 to request the full (possibly compacted) journal.
272
+
schema:
273
+
type: integer
274
+
minimum: 0
275
+
- name: messageType
276
+
in: query
277
+
required: true
278
+
description: >
279
+
The type of OCM message journal to query. Each message type
280
+
maintains a separate journal per (sender, receiver) pair.
281
+
schema:
282
+
type: string
283
+
enum:
284
+
- share
285
+
- notification
286
+
- invite-accepted
287
+
responses:
288
+
"200":
289
+
description: >
290
+
Successfully retrieved journal entries. The entries MUST be ordered
291
+
by journalId in ascending order.
292
+
content:
293
+
application/json:
294
+
schema:
295
+
type: object
296
+
required:
297
+
- entries
298
+
properties:
299
+
entries:
300
+
type: array
301
+
items:
302
+
$ref: "#/components/schemas/JournalEntry"
303
+
"403":
304
+
description: >
305
+
Caller cannot be authenticated via HTTP Request Signatures or
306
+
is not authorized to access this journal.
307
+
content:
308
+
application/json:
309
+
schema:
310
+
$ref: "#/components/schemas/Error"
311
+
"501":
312
+
description: This server does not support journaling.
313
+
content:
314
+
application/json:
315
+
schema:
316
+
$ref: "#/components/schemas/Error"
233
317
components:
234
318
parameters:
235
319
id:
@@ -239,6 +323,19 @@ components:
239
323
required: true
240
324
schema:
241
325
type: string
326
+
journalId:
327
+
name: OCM-Journal-Id
328
+
in: header
329
+
required: false
330
+
description: >
331
+
Sequential journal identifier for this message, scoped per
332
+
(sender, receiver, message type) tuple. Servers that expose the
333
+
`journaling` capability MUST include this header in all outgoing
334
+
OCM messages. Receiving Servers that do not support journaling
335
+
MAY ignore this header.
336
+
schema:
337
+
type: integer
338
+
minimum: 1
242
339
page:
243
340
name: page
244
341
in: query
@@ -388,6 +485,7 @@ components:
388
485
- http-sig
389
486
- invites
390
487
- invite-wayf
488
+
- journaling
391
489
- notifications
392
490
- protocol-object
393
491
- webdav-uri
@@ -884,3 +982,35 @@ components:
884
982
type: number
885
983
description: Number of seconds before this access_token will need to be refreshed.
886
984
example: 300
985
+
JournalEntry:
986
+
type: object
987
+
required:
988
+
- journalId
989
+
- message
990
+
properties:
991
+
journalId:
992
+
type: integer
993
+
minimum: 1
994
+
description: >
995
+
Monotonically increasing sequence number scoped per
996
+
(sender, receiver, message type) tuple. Journal IDs MUST be
997
+
strictly increasing but need not be contiguous.
998
+
example: 42
999
+
message:
1000
+
description: >
1001
+
The OCM message body. The message type is determined by the
1002
+
`messageType` query parameter used to request the journal.
1003
+
Compacted entries are represented as Noop (empty object `{}`).
1004
+
oneOf:
1005
+
- $ref: "#/components/schemas/NewShare"
1006
+
- $ref: "#/components/schemas/NewNotification"
1007
+
- $ref: "#/components/schemas/AcceptedInvite"
1008
+
- $ref: "#/components/schemas/Noop"
1009
+
Noop:
1010
+
type: object
1011
+
description: >
1012
+
A no-operation message representing a compacted journal entry.
1013
+
When a sequence of messages effectively cancels out (e.g. a share
1014
+
followed by an unshare of the same resource), the Sending Server
1015
+
MAY replace them with noop entries to preserve journal sequence
0 commit comments