Repository navigation
feat(ocm): notify remotes about unshares and permission changes - #1030
Merged
4 commits merged intoNov 19, 2026
Merged
4 commits merged into
4 commits merged into
Conversation
When the owner removes an OCM share we now notify the receiving instance with a SHARE_UNSHARED notification on its /notifications endpoint. The receiver deletes the received share through the new DeleteOCMCoreShare implementation, so remote users no longer keep a dangling share pointing at a resource they cannot access anymore. A failing notification is logged and does not fail the removal. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Updating the permissions of an OCM share now sends a SHARE_CHANGE_PERMISSION notification to the receiving instance, which updates the permissions of the received share through UpdateOCMCoreShare. Before, the remote kept the permissions it got when the share was created. The notification payload moves from pkg/ocm/payload into the ocm client package. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
The ocmcore service now publishes OCMCoreShareCreated when a remote instance creates a share for one of our users, and the new OCMCoreShareDelete when the remote removes it again. The events are sent directly when an events endpoint is configured, so they no longer depend on the events middleware being configured on the ocm grpc server, which it is not. Consumers like userlog can turn them into notifications for the receiving user. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
The /notifications endpoint is unauthenticated, and a notification without a notification object, or with a content type other than application/json, made the handler dereference a nil request and panic. Several error paths also wrote an error response and then fell through to write another status. We now return 400 for these requests before touching the gateway, require the protocol for permission changes and stop after every error response. Unsharing a share the receiver no longer knows now answers 404 instead of failing with an internal error, so a repeated notification is not reported as a server error. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
This was referenced Nov 18, 2026
butonic
added a commit
to opencloud-eu/opencloud
that referenced
this pull request
Nov 19, 2026
We temporarily replace reva with the butonic fork at a merge of reva main and opencloud-eu/reva#1035, which is stacked on opencloud-eu/reva#1030. This brings in the OCM unshare and permission change notifications, the ocm core share events and the fixes to the permissions of OCM shares, on top of the invite and provider fixes already on reva main. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
fschade
approved these changes
Nov 19, 2026
0093d72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We now send OCM notifications to the receiving instance when the owner removes a federated share (
SHARE_UNSHARED) or changes its permissions (SHARE_CHANGE_PERMISSION). The receiving side handles them on/notifications: it deletes the received share or updates its protocols via the newly implementedDeleteOCMCoreShare/UpdateOCMCoreShare. Before, remote users kept stale shares and permissions until something failed.The ocmcore service also publishes
OCMCoreShareCreatedand the newOCMCoreShareDeletedirectly when aneventsendpoint is configured. The events middleware is not configured on the ocm grpc server, so it never emitted them. The server needs to pass the events config toocmcoreto get user notifications for incoming federated shares.Review focus:
ocmshareprovider.UpdateOCMShare: if the remote can't be notified, the update is reverted and fails. A failed unshare notification only gets logged.ocmd/notifications.go: the endpoint is unauthenticated, like/shares. A notification only matches a received share if both the share id and the grantee match. There is no sender verification yet.Review commit by commit: the first three carry the original changes, the last one is ours.
AI assistance: Claude Code (claude-opus-5-5) cherry-picked and resolved the changes, wrote the handler fix, the specs and this description.