Skip to content

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

Closed
cristianscheid wants to merge 1 commit into
masterfrom
feat/noid/ocm-new-notifications
Closed

cristianscheid wants to merge 1 commit 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
    https://datatracker.ietf.org/doc/html/draft-ietf-ocm-open-cloud-mesh-07#name-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 and shareType
  • to let other servers know this format is supported, new capability is advertised in discovery: notification-sender-domain

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

@cristianscheid
cristianscheid force-pushed the feat/noid/ocm-new-notifications branch 3 times, most recently from d447fab to 6f5f300 Compare November 9, 2026 13:45
@nextcloud nextcloud deleted a comment from github-actions Bot Nov 9, 2026
@cristianscheid
cristianscheid force-pushed the feat/noid/ocm-new-notifications branch 2 times, most recently from 7ca357c to a1de777 Compare November 10, 2026 11:56
@cristianscheid cristianscheid self-assigned this Nov 10, 2026
@cristianscheid cristianscheid added enhancement 3. to review Waiting for reviews 2. developing Work in progress and removed 3. to review Waiting for reviews labels Nov 10, 2026
@cristianscheid
cristianscheid force-pushed the feat/noid/ocm-new-notifications branch from a1de777 to 225e57a Compare November 10, 2026 12:12
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid
cristianscheid force-pushed the feat/noid/ocm-new-notifications branch from 225e57a to 7e38c74 Compare November 10, 2026 12:14
@cristianscheid
cristianscheid marked this pull request as ready for review November 10, 2026 12:16
@cristianscheid
cristianscheid requested review from CarlSchwan and removed request for a team November 10, 2026 12:16
@cristianscheid cristianscheid added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 10, 2026

@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.

Looks ok to me

Edit: I just noticed the non standard capability

@cristianscheid

cristianscheid commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Just for the record, since we agreed that deprecating ICloudFederationProvider::notificationReceived() would be work for another PR: the main reason is that the method is still needed for notifications from senders using the old format, since core (RequestHandlerController::receiveNotification()) handles those via the cloud federation provider and ignores the result of dispatched event.

IMO, deprecating would only make sense in a follow up where we offer an alternative way to handle old format notifications (using result from event listeners instead of cloud federation provider). This PR is focused only on supporting the new format.

// http-sig advertisement requires a jwksUri
$provider->setJwksUri($this->signatoryManager->getLocalJwksUri());
$provider->setCapabilities(['http-sig']);
$provider->setCapabilities(['http-sig', 'notification-sender-domain']);

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.

This is not standardized, so either it needs to be proposed as a change to the spec, or we need some other way to figure out if the peer has this capability.

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.

Since the spec already has the notifications capabilty and nextcloud already anounces it, I think the cleanest thing to do is to look at apiVersion in the discovery, and if it does not say 1.0-proposal1 send the new notifications. Then we update the code to actually set the correct apiVersion instead of setting it in the nostandard version.

@cristianscheid

Copy link
Copy Markdown
Member Author

Closing this PR for now in favor of #66628

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

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants