Skip to content

feat(ocm): add OCM HTTP signatures - #1104

Draft
MahdiBaghbani wants to merge 16 commits into
opencloud-eu:mainfrom
MahdiBaghbani:ocm-signed-notifications
Draft

MahdiBaghbani wants to merge 16 commits into
opencloud-eu:mainfrom
MahdiBaghbani:ocm-signed-notifications

Conversation

@MahdiBaghbani

@MahdiBaghbani MahdiBaghbani commented Dec 4, 2026 •

Copy link
Copy Markdown

This PR is part of cs3org/OCM-STA#54

Summary

Add OCM HTTP signatures to every OCM request OpenCloud sends and receives, the same way CERNBox does since cs3org#5968 and cs3org#6031. Invites, share creation and notifications are signed when a signing_key is set, and ocmd verifies them when http_sig is on

It's off by default. In permissive mode an unsigned request is still accepted if the sender doesn't advertise http-sig. strict rejects anything unsigned and adds must-use-http-sig to discovery. Unlike cs3org#6031 the key stays optional, so existing setups don't change

Peers that advertise notifications get signed standard notifications, everyone else gets the existing OpenCloud ones. Those older notifications don't name a sender, so permissive mode still accepts them unsigned

Discovery also lists folder next to file. OpenCloud already sends folder shares, but CERNBox refuses a resource type the sender doesn't advertise

flowchart LR
    A["Incoming OCM request"] --> B{"Signed?"}
    B -->|yes| C["Verify with the sender's published key"]
    B -->|no| D{"Strict, or sender advertises http-sig?"}
    D -->|yes| E["Reject"]
    D -->|no| F["Accept"]
    C -->|valid| F
    C -->|invalid| E
Loading

I tested invites, shares, permission changes and withdrawals between OpenCloud servers in strict, permissive and off mode, with an older OpenCloud, and with a CERNBox development build in both modes

The signing library needs Go 1.27, and the integration timeout goes from 15 to 20 minutes since the suite takes about 15 minutes here

The OpenCloud configuration is in opencloud-eu/opencloud#4222

@codacy-production

codacy-production Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 11 critical

Alerts:
⚠ 11 issues (≤ 0 issues of at least minor severity)

Results:
11 new issues

Category Results
Security 11 critical (11 false positives)

View in Codacy

🟢 Metrics 1174 complexity · 51 duplication

Metric Results
Complexity 1174
Duplication 51

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@MahdiBaghbani MahdiBaghbani changed the title feat(ocm): sign and verify share notifications feat(ocm): add OCM HTTP signatures Dec 4, 2026
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
@MahdiBaghbani
MahdiBaghbani force-pushed the ocm-signed-notifications branch from bc99fa1 to 158a1ff Compare December 4, 2026 17:49
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.

1 participant