Skip to content

feat(ocm): support new format of notfication payload - #66049

Draft
cristianscheid wants to merge 2 commits into
masterfrom
feat/noid/ocm-new-notifications
Draft

cristianscheid wants to merge 2 commits into
masterfrom
feat/noid/ocm-new-notifications

Conversation

@cristianscheid

@cristianscheid cristianscheid commented Oct 30, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

  • support new notification payload format on /ocm/notifications
  • since OCM 1.5, notification payloads include a senderDomain field:
    https://github.com/cs3org/OCM-API/blob/v1.5.0/IETF-OCM.md#notifications
  • RequestHandlerController::receiveNotification() checks whether the payload has a senderDomain field:
    • with senderDomain field: handles it with the new format
    • without senderDomain field: handled as before
  • for the new format, request must be signed by senderDomain (checked with IOCMDiscoveryService::getIncomingSignedRequestFromDomain())
  • instead of routing to a cloud federation provider (e.g. CloudFederationProviderFiles), an OCMNotificationReceivedEvent is dispatched, which apps can listen to and act on
  • listeners can set response that is sent back to the sender with OCMNotificationReceivedEvent::setResult()
  • the event carries a ISenderDomainAwareCloudFederationNotification, which extends ICloudFederationNotification with senderDomain, shareType
  • to let other servers know this format is supported, new capability is advertised in discovery: notification-sender-domain

TODO

  • this is a draft to discuss whether this is a good approach
  • if we go with it, refine code, add tests and do manual testing

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@mickenordin mickenordin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments


try {
$this->dispatcher->dispatchTyped($notificationEvent);
$result = $notificationEvent->getResult() ?? throw new ActionNotSupportedException($notificationType);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this will throw if there is no listener? Perhaps that is not what we want?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with no listener, yes, it would throw, but the exception is handled and the sender of the notification would get a 501 (Http::STATUS_NOT_IMPLEMENTED)

looking at the spec for 501: https://github.com/cs3org/OCM-API/blob/v1.5.0/spec.yaml#L95

you think we should return something else, maybe 201?

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
…getMessage

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid
cristianscheid force-pushed the feat/noid/ocm-new-notifications branch from 545decd to 1d87711 Compare November 5, 2026 11:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants