Repository navigation
feat(ocm): support new format of notfication payload - #66049
cristianscheid wants to merge 2 commits into
Conversation
|
|
||
| try { | ||
| $this->dispatcher->dispatchTyped($notificationEvent); | ||
| $result = $notificationEvent->getResult() ?? throw new ActionNotSupportedException($notificationType); |
There was a problem hiding this comment.
I guess this will throw if there is no listener? Perhaps that is not what we want?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
That is for /shares /notifications is a bit down. Maybe 501 is ok, or alternatively 404: https://github.com/cs3org/OCM-API/blob/277e020f2737998238c5bf68689bd8c2da1ee5f9/spec.yaml#L162
There was a problem hiding this comment.
Another thing we may want to do, is deprecate notificationRecieved in cloudFederationProvider, and try to have the core implementations stop relying on this:
server/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
Lines 318 to 319 in ca11c0d
and instead add listeners.
There was a problem hiding this comment.
That is for /shares /notifications is a bit down
yes, sorry linked the wrong line
Maybe 501 is ok, or alternatively 404
between those two I would lean towards 501, what you think?
Another thing we may want to do, is deprecate notificationRecieved in cloudFederationProvider, and try to have the core implementations stop relying on this and instead add listeners.
I wonder whether we should tackle this here, or if it would fit better as a follow up PR
cc @mickenordin
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
…getMessage Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
545decd to
1d87711
Compare
Summary
/ocm/notificationssenderDomainfield:https://github.com/cs3org/OCM-API/blob/v1.5.0/IETF-OCM.md#notifications
RequestHandlerController::receiveNotification()checks whether the payload has asenderDomainfield:senderDomainfield: handles it with the new formatsenderDomainfield: handled as beforesenderDomain(checked withIOCMDiscoveryService::getIncomingSignedRequestFromDomain())CloudFederationProviderFiles), anOCMNotificationReceivedEventis dispatched, which apps can listen to and act onOCMNotificationReceivedEvent::setResult()ISenderDomainAwareCloudFederationNotification, which extendsICloudFederationNotificationwithsenderDomain,shareTypenotification-sender-domainTODO
Checklist
3. to review, feature component)stable32)AI (if applicable)