@@ -1342,20 +1342,27 @@ request:
13421342* REQUIRED notificationType (string) - it MUST be one of the
13431343 registered values listed in the "OCM Notification Types"
13441344 registry (see [IANA Considerations](#iana-considerations)).
1345- * REQUIRED senderDomain (string) - ...
1346- * REQUIRED resourceType (string) - ...
1345+ * REQUIRED senderDomain (string) - the FQDN of the sender. A Receiving
1346+ Server SHOULD use this information to verify the HTTP message
1347+ signature on the request, and it SHOULD also use it to validate the
1348+ underlying share or resource the notification is about.
1349+ * OPTIONAL resourceType (string) - the type of the resource this
1350+ notification is about (e.g., `file`).
1351+ * OPTIONAL shareType (string) - the type of recipient this notification
1352+ is about (e.g., `user`).
13471353* OPTIONAL providerId (string) - the identifier assigned by the
13481354 Sending Server to the underlying share, if applicable. This
13491355 field is _deprecated_ and SHOULD NOT be used.
13501356* OPTIONAL notification (object) - optional additional parameters,
13511357 depending on the notification and the resource type.
13521358
1353- Multiple Notification types are defined for different purposes, and
1354- additional types MAY be defined by implementers and registered in the
1355- " OCM Notification Types" IANA Registry. For each notification type,
1356- a specific format is defined for the optional notification object.
1357- In the sections below the base Notification types are detailed along
1358- with their specific payload.
1359+ A Notification payload MUST include either the `resourceType` or the
1360+ ` shareType` , or both when relevant. Multiple Notification types are
1361+ defined for different purposes, and additional types MAY be defined
1362+ by implementers and registered in the "OCM Notification Types" IANA
1363+ Registry. For each notification type, a specific format MAY be defined
1364+ for the optional notification object. In the sections below, the base
1365+ Notification types are detailed along with their specific payload.
13591366
13601367# # Share Acceptance and Updating
13611368
@@ -1364,9 +1371,10 @@ the recipient accepted or declined a share, in response to a Share
13641371Creation Notification. Similarly, it MAY be sent by a provider to let
13651372the recipient know that the provider updated or removed a given share,
13661373such that the recipient MAY clean it up from its database. In all such
1367- cases, the `resourceType` is expected to match the `resourceType` of
1368- the underlying share (e.g., `file`), and the `notificationType` MUST be
1369- one of :
1374+ cases, the `resourceType` MUST match the `resourceType` of the
1375+ underlying share (e.g., `file`), the `shareType` MAY be omitted but if
1376+ present it MUST match the `shareType` of the underlying share, and the
1377+ `notificationType` MUST be one of :
13701378- " SHARE_ACCEPTED" , to inform about the acceptance of a share.
13711379- " SHARE_DECLINED" , to inform that a share was not accepted.
13721380- " SHARE_UNSHARED" , to inform the Receiving Server that the share
@@ -1387,9 +1395,12 @@ Further, the `notification` object MUST include the following fields:
13871395 the `permissions` values specified in the `webdav` protocol of a
13881396 [Share Creation Notification](#share-creation-notification).
13891397
1390- Note that the Sending Server MAY at any time revoke access to a
1391- Resource (effectively undoing or deleting the Share) without notifying
1392- the Receiving Server.
1398+ The same notifications identically apply to resources of type `folder`.
1399+ For other resources with a different `resourceType` attribute, a
1400+ Sending Server MAY implement the same notifications, provided that
1401+ they get registered in the related IANA Registry. Note that the
1402+ Sending Server MAY at any time revoke access to a Resource (effectively
1403+ undoing or deleting the Share) without notifying the Receiving Server.
13931404
13941405# # Resharing and Request to Share
13951406
@@ -1403,8 +1414,11 @@ the third party: in this case, all necessary exchanges and access
14031414requests MUST take place between the third party and the Sending
14041415Server, without further including the Receiving Server in the process.
14051416
1406- For a "REQUEST_RESHARE", the `notification` object MUST include the
1407- following fields :
1417+ For a "REQUEST_RESHARE" notification, the `resourceType` MUST match the
1418+ ` resourceType` of the original share (e.g., `file`, `folder`, ...), the
1419+ ` shareType` MAY be omitted but if present it MUST match the `shareType`
1420+ of the original share, and the the `notification` object MUST include
1421+ the following fields :
14081422* OPTIONAL message (string) - an optional human-readable message that
14091423 describes the request.
14101424* REQUIRED file (object) - an object containing the details of the
@@ -1428,8 +1442,10 @@ to the Sending Server.
14281442Similarly, the `"REQUEST_SHARE"` notification type MAY be used by a
14291443given Recipient OCM Server, to ask a remote OCM Server to share and
14301444grant access to a Resource, previously made known to the Recipient
1431- Server out of band. In this case, the `notification` object MUST
1432- include the following fields :
1445+ Server out of band. In this case, the `resourceType` MUST match the
1446+ ` resourceType` of the Resource in question (e.g., `file`, `folder`,
1447+ ...), the `shareType` MUST be omitted, and the `notification` object
1448+ MUST include the following fields :
14331449
14341450* OPTIONAL message (string) - an optional human-readable message that
14351451 describes the request.
@@ -1460,6 +1476,7 @@ even informing the `owner`: in this case, it MUST respond to the
14601476` "REQUEST_SHARE"` notification with an appropriate HTTP response type
14611477such as HTTP 404.
14621478
1479+
14631480# # Recipient Removal
14641481
14651482A notification MAY be sent to inform a target OCM Server that a share
@@ -1471,9 +1488,10 @@ The recipient of such notification MAY reciprocally remove that
14711488recipient from the list of trusted users, along with any related
14721489shares.
14731490
1474- For these cases, a notification payload MUST be formed such that the
1475- ` resourceType` is set to the affected shareType being removed, such as
1476- `user` or `group`, and the `notificationType` MUST be one of :
1491+ For these cases, a notification payload is to be formed such that the
1492+ ` resourceType` MUST be omitted, the `shareType` is set to the affected
1493+ shareType being removed, such as `user` or `group`, and the
1494+ `notificationType` MUST be one of :
14771495- " USER_REMOVED" , to inform about a single user that was removed or
14781496 marked as not trusted.
14791497- " GROUP_REMOVED" , to inform about a removed group.
0 commit comments