OCM (Open Cloud Mesh) compatibility adapter — interop with Nextcloud/ownCloud #117
Closed
opened 2026-08-04 23:00:31 +00:00 by Cordy
·
5 comments
No Branch/Tag specified
main
b12v07
b11v07
b10v07
ci-rc-publish
fx15-s3dry
b9v07
b8v07
bench742
b7v07
legal-texts-v0.2
b6v07
b5v07
b4v07
b3v07
sx1139
st742
b2v07
ix1102
fu1098
zp1097
wd1099
tr1100
qf1077
nc1070
ci1
rp1072
lk1073
ab1071
fi1074
si1070
ra1054
wo1056
oc1057
tf1055
sv1063
fg1059
st1058
fs929
mu1039
ls1033
cf975
lf835
dx1023
ml896
a11y2
av1022
r913
r7
r6
r5
r45
r23
r1
b10
b9
fix-b5
fix-b4
fix-b3
fix-b2
fix-b1
fix-922
fix-923
fix-911
fix-343b
batch-a
v0.6.413
v0.6.412
v0.6.411
v0.6.410
v0.6.409
v0.6.408
v0.6.407
v0.6.406
v0.6.405
v0.6.404
v0.6.403
v0.6.402
v0.6.401
v0.6.400
v0.6.399
v0.6.398
v0.6.397
v0.6.396
v0.6.395
v0.6.394
v0.6.393
v0.6.392
v0.6.391
v0.6.390
v0.6.389
v0.6.388
v0.6.387
v0.6.386
v0.6.385
v0.6.384
v0.6.383
v0.6.382
v0.6.381
v0.6.380
v0.6.379
v0.6.378
v0.6.377
v0.6.376
v0.6.375
v0.6.374
v0.6.373
v0.6.372
v0.6.371
v0.6.370
v0.6.369
v0.6.368
v0.6.367
v0.6.366
v0.6.365
v0.6.364
v0.6.363
v0.6.362
v0.6.361
v0.6.360
v0.6.359
v0.6.358
v0.6.357
v0.6.356
v0.6.355
v0.6.354
v0.6.353
v0.6.352
v0.6.351
v0.6.350
v0.6.349
v0.6.348
v0.6.347
v0.6.346
v0.6.345
v0.6.344
v0.6.343
v0.6.342
v0.6.341
v0.6.340
v0.6.339
v0.6.338
v0.6.337
v0.6.336
v0.6.335
v0.6.334
v0.6.333
v0.6.332
v0.6.331
v0.6.330
v0.6.329
v0.6.328
v0.6.327
v0.6.326
v0.6.325
v0.6.324
v0.6.323
v0.6.322
v0.6.321
v0.6.320
v0.6.319
v0.6.318
v0.6.317
v0.6.316
v0.6.315
v0.6.314
v0.6.313
v0.6.312
v0.6.311
v0.6.310
v0.6.309
v0.6.308
v0.6.307
v0.6.306
v0.6.305
v0.6.304
v0.6.303
v0.6.302
v0.6.301
v0.6.300
v0.6.299
v0.6.298
v0.6.297
v0.6.296
v0.6.295
v0.6.294
v0.6.293
v0.6.292
v0.6.291
v0.6.290
v0.6.289
v0.6.288
v0.6.287
v0.6.286
v0.6.285
v0.6.284
v0.6.283
v0.6.282
v0.6.281
v0.6.280
v0.6.279
v0.6.278
v0.6.277
v0.6.276
v0.6.275
v0.6.274
v0.6.273
v0.6.272
v0.6.271
v0.6.270
v0.6.269
v0.6.268
v0.6.267
v0.6.266
v0.6.265
v0.6.264
v0.6.263
v0.6.262
v0.6.261
v0.6.260
v0.6.259
v0.6.258
v0.6.257
v0.6.256
v0.6.255
v0.6.254
v0.6.253
v0.6.252
v0.6.251
v0.6.250
v0.6.249
v0.6.248
v0.6.247
v0.6.246
v0.6.245
v0.6.244
v0.6.243
v0.6.242
v0.6.241
v0.6.240
v0.6.239
v0.6.238
v0.6.237
v0.6.236
v0.6.235
v0.6.234
v0.6.233
v0.6.232
v0.6.231
v0.6.230
v0.6.229
v0.6.228
v0.6.227
v0.6.226
v0.6.225
v0.6.224
v0.6.223
v0.6.222
v0.6.221
v0.6.220
v0.6.219
v0.6.218
v0.6.217
v0.6.216
v0.6.215
v0.6.214
v0.6.213
v0.6.212
v0.6.211
v0.6.210
v0.6.209
v0.6.208
v0.6.207
v0.6.206
v0.6.205
v0.6.204
v0.6.203
v0.6.202
v0.6.201
v0.6.200
v0.6.199
v0.6.198
v0.6.197
v0.6.196
v0.6.195
v0.6.194
v0.6.193
v0.6.192
v0.6.191
v0.6.190
v0.6.189
v0.6.188
v0.6.187
v0.6.186
v0.6.185
v0.6.184
v0.6.183
v0.6.182
v0.6.181
v0.6.180
v0.6.179
v0.6.178
v0.6.177
v0.6.176
v0.6.175
v0.6.174
v0.6.173
v0.6.172
v0.6.171
v0.6.170
v0.6.169
v0.6.168
v0.6.167
v0.6.166
v0.6.165
v0.6.164
v0.6.163
v0.6.162
v0.6.161
v0.6.160
v0.6.159
v0.6.158
v0.6.157
v0.6.156
v0.6.155
v0.6.154
v0.6.153
v0.6.152
v0.6.151
v0.6.150
v0.6.149
v0.6.148
v0.6.147
v0.6.146
v0.6.145
v0.6.144
v0.6.143
v0.6.142
v0.6.141
v0.6.140
v0.6.139
v0.6.138
v0.6.137
v0.6.136
v0.6.135
v0.6.134
v0.6.133
v0.6.132
v0.6.131
v0.6.130
v0.6.129
v0.6.128
v0.6.127
v0.6.126
v0.6.125
v0.6.124
v0.6.123
v0.6.122
v0.6.121
v0.6.120
v0.6.119
v0.6.118
v0.6.117
v0.6.116
v0.6.115
v0.6.114
v0.6.113
v0.6.112
v0.6.111
v0.6.110
v0.6.109
v0.6.108
v0.6.107
v0.6.106
v0.6.105
v0.6.104
v0.6.103
v0.6.102
v0.6.101
v0.6.100
v0.6.99
v0.6.98
v0.6.97
v0.6.96
v0.6.95
v0.6.94
v0.6.93
v0.6.92
v0.6.91
v0.6.90
v0.6.89
v0.6.88
v0.6.87
v0.6.86
v0.6.85
v0.6.84
v0.6.83
v0.6.82
v0.6.81
v0.6.80
v0.6.79
v0.6.78
v0.6.77
v0.6.76
v0.6.75
v0.6.74
v0.6.73
v0.6.72
v0.6.71
v0.6.70
v0.6.69
v0.6.68
v0.6.67
v0.6.66
v0.6.65
v0.6.64
v0.6.63
v0.6.62
v0.6.61
v0.6.60
v0.6.59
v0.6.58
v0.6.57
v0.6.56
v0.6.55
v0.6.54
v0.6.53
v0.6.52
v0.6.51
v0.6.50
v0.6.49
v0.6.48
v0.6.47
v0.6.46
v0.6.45
v0.6.44
v0.6.43
v0.6.42
v0.6.41
v0.6.40
v0.6.39
v0.6.38
v0.6.37
v0.6.36
v0.6.35
v0.6.34
v0.6.33
v0.6.32
v0.6.31
v0.6.30
v0.6.29
v0.6.28
v0.6.25
v0.6.24
v0.6.23
v0.6.22
v0.6.21
v0.6.20
v0.6.19
v0.6.18
v0.6.17
v0.6.16
v0.6.15
v0.6.14
v0.6.12
v0.6.11
v0.6.10
v0.6.9
v0.6.8
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.12
v0.4.11
v0.4.10
v0.4.9
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.3.30
v0.3.29
v0.3.28
v0.3.27
v0.3.26
v0.3.25
v0.3.24
v0.3.23
v0.3.22
v0.3.21
v0.3.20
v0.3.19
v0.3.18
v0.3.17
v0.3.16
v0.3.15
v0.3.14
v0.3.13
v0.3.12
v0.3.11
v0.3.10
v0.3.9
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.7
v0.2.6
v0.2.5
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.0.3
v0.0.2
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#117
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Decided 2026-08-05 (Q7 on #100): revisit and implement in v0.6, beside — not instead of — Cairn's own peering.
Why. Open Cloud Mesh is the incumbent federation protocol: in the field since ~2016, implemented by Nextcloud, ownCloud, OpenCloud, CERNBox and Seafile, and on the IETF standards track since March 2026 (
draft-ietf-ocm-open-cloud-mesh-04). Speaking it turns "migrate off Nextcloud" into "put Cairn next to your Nextcloud and share across" — the single strongest migration story available to us, and a procurement checkbox in exactly the federated-research and public-sector markets that already deployed OCM.What it is not. OCM does not replace our peering (
IMPLEMENTED-PEERING.md). They answer different questions:Our positioning is the narrow trust model; OCM is the interop bridge. Both can exist — nothing in the peering design forecloses it, because OCM would sit beside the transfer plane rather than inside it.
Scope to settle at implementation time:
user@server). We have deliberately avoided identity federation. Does an OCM share map onto a local user, an Inbox drop, or a distinct "external shares" surface?Prerequisite: v0.5 peering shipped, so this is a bridge from something rather than the first federation implementation.
Triage: tandem (large; needs a real Nextcloud/ownCloud). OCM (Open Cloud Mesh) adapter for cross-product share/interop. Big surface; design + scope first, and interop testing needs a live Nextcloud/ownCloud peer. Post-launch tier — park until the closed beta settles.
Design approved 2026-09-07 and recorded in OCM.md (root, playing the role PEERING.md played for peering). Mockup rev 2 approved (
ocm-federation-mockup.html). Summary of the settled scope questions from this issue:draft-ietf-ocm-open-cloud-mesh-04, with deliberate dialect compat for what's deployed: legacy/ocm-provider+1.0-proposal1+publicKeyfor vanilla Nextcloud/ownCloud 10,/.well-known/ocm1.1 for OpenCloud/CERNBox. No/status.phpshim — that out-of-spec probe only matters for NC "trusted servers" directory sync, which is not our model.internal/ocm(Reva rejected as dependency; kept as dialect documentation), cs3org OCM Test Suite pattern as CI interop harness + live tests against the lab Nextcloud.ocm(registry + scanner per #433).Interop acceptance matrix and build phasing are in OCM.md §6/§10. Next: implementation plan, then the phased TDD build; ARCHITECTURE/handbook/wiki flowchart land with the ship per §10.7.
Shipped in v0.6.139 (PR #448), live on both dogfoods (
cairn_build_infoverified).Decision record (full design: OCM.md; guide: docs/handbook/federation-ocm.md; flowchart: wiki OCM-Federation)
Every scope question from this issue, settled and built:
draft-ietf-ocm-open-cloud-mesh-04target with deliberate dialect compat for what's deployed: we serve both/.well-known/ocm(1.1) and legacy/ocm-provider(1.0-proposal1 withpublicKey), and we parse all three field dialects including ownCloud 10's shareTypes-as-resourceTypes quirk and trailing-slash discovery. Signatures both ways: RFC 9421 and draft-cavage. No/status.phpshim (NC "trusted servers" directory sync is not federation).internal/ocm, stdlib crypto only; Reva rejected as dependency, kept as dialect documentation. Ten audit verbs in groupocm(the #433 scanner caught this feature's own non-literal carrier during development).Verification: TDD with witnessed reds throughout;
ocm-interop.yml(kept) black-boxes the real binary — discovery both dialects, jwks, inbound share, refusal-names-the-server, bearer-jailed grant, disabled-is-silent — ALL GREEN on main before tagging.Open follow-ups (deliberate v1 scope lines, filed here for the beta):
/spaces/paths (v1 shares Personal only).ocm-live-nc.ymlis ready but needs operator setup — enable OCM on the dogfood, allownextcloud.c0rdyceps.ch(policy "any user"), add Forgejo secretsNC_URL/NC_USER/NC_APP_PW— then run it watching the Federated view.UserExiststightening + per-peer full-URI signing conventions, both riding the interop findings.Archive: the implementation plan this feature was built from (written 2026-09-07 against OCM.md + mockup rev 3, executed 2026-09-07/08; kept here so the plan, the spec and the decision record live in one place).
OCM Federation Implementation Plan (#117)
Goal: Bidirectional Open Cloud Mesh federation (Nextcloud/ownCloud/OpenCloud/Seafile/CERNBox interop) beside Cairn Peering, per OCM.md.
Architecture: New
internal/ocmpackage following theinternal/peeringregistry idiom (atomic JSON throughstatestore.Read/Write, mutex-guarded, fail-closed). Three signed inbound JSON endpoints + two discovery documents + a jwks endpoint; outbound = dialect-detecting discovery client + signed share POSTs; bytes move over WebDAV (inbound: Cairn as WebDAV client proxying to the user; outbound: a bearer-scoped/dav/ocm/<providerId>/grant surface). UI per approved mockups rev 3.Tech Stack: Go stdlib only (crypto/rsa, crypto/sha256, net/http); no new dependencies. Frontend: vanilla JS in
web/static/index.htmlhouse style. CI: Forgejo one-shot workflows on the runner (house TDD: witnessed red → splice → green).Global Constraints
settings.OCMEnabledfalse ⇒ discovery/jwks/ocm endpoints return 404 and no outbound calls occur.contacts(strict).ocm-117; every task = red test pushed via MCP (witnessed failing on runner) → one-shot splice workflow → green full suite.ocmin the same task that first emits them (scanner tripwire enforces this).Tasks (each: red test → witnessed red → implement → green full suite → commit)
internal/ocm/state.go:Server(allow-list entry: fqdn, addedBy/At,Policycontacts|any, relaxedBy/At stamp, cachedDisco), per-userContact+ single-use 7-dayInvite,ShareIn/ShareOutledgers;Open(4 paths),Allow/Get/List/SetPolicy/Remove(Remove ends every share both ways and returns them), contacts CRUD +HasContact(user, addr),MintInvite/TakeInvite(prune on take), share status transitions + secret/providerId lookups. Persisted viastatestore.Read/Write, peering idiom.EnsureKey(stable RSA-2048, persisted),JWKS(),PublicPEM();ParseDiscoverynormalising IETF 1.1 / NC 1.0-proposal1 (legacy publicKey captured) / oC10 shareTypes-as-resourceTypes quirk;OurDiscovery(1.1) +OurLegacyDiscovery(1.0 shape), round-tripped through our own parser in tests. Fixtures verbatim from field research.Sign(RFC 9421 over @method/@target-uri/content-digest/date, rsa-v1_5-sha256, fqdn#key1),SignLegacy(draft-cavage: (request-target) content-length date digest),Verifyauto-detecting with errors naming exactly what failed;KeyFromJWKS/KeyFromPEM. (Execution finding: sign the request-target, not the absolute URL — the base must survive the client→server hop.)ocm.Servicewith injected closures (Enabled,UserExists,PeerKey): both discovery routes (+ oC10 trailing slash), jwks,POST /ocm/sharespipeline (allow-list → signature, unsigned tolerated only for keyless peers → per-server policy → known recipient → ledger, refusals naming the reason),POST /ocm/notifications(ACCEPTED/DECLINED/UNSHARED).settings.OCMEnabled; main wires the four state files into the statestore binds; every route 404s while disabled.Client.Discover(well-known → /ocm-provider → trailing slash),SendSharedialect-adaptive (legacy options vs protocol.webdav),SendNotification,FetchRemote(+ RFC 6749 code-flow client for must-exchange-token),ListRemote(namespace-agnostic multistatus, proven against our own grant);GrantHandlerfor/dav/ocm/<pid>/— constant-time bearer, subtree jail, GET/HEAD/PROPFIND always, PUT only on write shares, dead when the share ends; mounted over the unscoped driver (audit + #19 decryption apply).EncodeInvite/DecodeInvite(canonical base64 token@provider, last-@ split), inviter-side/ocm/invite-accepted(allow-list before token burn),Client.AcceptInvite; user API (shares list/send/accept/decline/end both directions, browse/fetch proxy, invites, contacts) + admin API (status, servers list/check/allow/policy/remove); ten audit verbs groupocm.ocm-interop.yml(kept) builds the real binary, seeds state, drives the wire with curl (discovery both dialects, jwks, inbound share, named refusal, grant jail, disabled-is-silent);ocm-live-nc.yml(kept, secrets-gated) drives the lab Nextcloud via OCS.federation-ocm.md, README bullet, ARCHITECTURE entry, CHANGELOG; wiki page with the end-to-end Mermaid flowchart; PR → CI → merge → interop green on main → tag → bump dogfoods → verify → close with decision record.Self-review notes
Store,Discovery,ShareIn/Out,Policyused identically across tasks;Verifyreturns(string, error)everywhere.(The full step-level plan with verbatim test code lives in the session file
2026-09-07-ocm-federation-plan.md; deltas between plan and execution are recorded in the closing decision-record comment above.)Dogfood finding 4 → fixed in v0.6.142 (PR #453, live on both dogfoods).
Finding: the Servers-tab policy chip toggled on a single click — accident-prone and not identifiable as a setting — and the mockup's Status column was absent (reachability had been deferred to the metrics pass, follow-up 4, without saying so in the UI).
Design (approved mockup
ocm-servers-policy-mockup.html, rev 1):POST /api/v1/admin/ocm/servers/check→ reachable/unreachable + "checked just now". Retention: nothing is stored and nothing is audited — the result lives only in the response/page memory, so no logs accumulate. The continuous reachability gauge + Prometheus alert remain deferred to the metrics pass (follow-up 4 stands for those). If "unreachable since N days" is ever wanted, that is one fixed-size timestamp per server in the servers doc, not a log.Cleanup:
.ocmchip/.ocmchip.strictand the click-to-toggle handler removed entirely. 12 new i18n keys ×4.