Visitar URL original
feat(ocm): gate outbound webapp offers by MahdiBaghbani · Pull Request #5854 · cs3org/reva · GitHub
Skip to content

feat(ocm): gate outbound webapp offers - #5854

Open
MahdiBaghbani wants to merge 14 commits into
received-webapp-metadata-producerfrom
gate-outbound-webapp-offers
Open

MahdiBaghbani wants to merge 14 commits into
received-webapp-metadata-producerfrom
gate-outbound-webapp-offers

Conversation

@MahdiBaghbani

@MahdiBaghbani MahdiBaghbani commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

This PR is part of the cs3org/OCM-STA#20 and cs3org/OCM-STA#48

Summary

  • Offer webapp access on outbound shares only when all four hold: offer_webapp is on (default false), the request carries a webapp candidate, the remote resource type lists blank in webapp-receive, and remote discovery advertises exchange-token. Otherwise every webapp method is dropped and the WebDAV method still goes out.
  • Build the access-method list once in freshAccessMethods, before NewShare, and store that same list. The wire request used to be filtered by getProtocols while the share was stored from req.AccessMethods, so storage kept webapp methods the remote never received.
  • Use the configured webapp_name and webapp_endpoint on the offer. Empty requirements default to must-exchange-token; supplied ones must be known, non-blank, unique, and match the WebDAV set, otherwise InvalidArgument with no POST and no store. With the offer on, startup requires a non-blank name and an absolute http(s) endpoint with no userinfo, and the offer path re-checks the endpoint with the same rule, so a service built without startup validation drops the webapp rather than offering a scheme-less endpoint. enable_webapp stays the discovery advertisement and doesn't turn the offer on.
flowchart TD
    REQ["req.AccessMethods"] --> F{"freshAccessMethods"}
    F -->|"bad requirements, or two webapps"| STOP["InvalidArgument, no POST, no store"]
    F -->|"offer_webapp off, no candidate, invalid webapp_endpoint, or remote lacks blank or exchange-token"| DROP["webapp dropped, WebDAV kept"]
    F -->|"all four hold, endpoint valid"| KEEP["one webapp, AppName = webapp_name"]
    DROP --> L["one access-method list"]
    KEEP --> L
    L -->|"empty"| STOP
    L -->|"non-empty"| OUT["NewShare, then StoreShare with the same list"]
Loading

@MahdiBaghbani MahdiBaghbani self-assigned this Sep 29, 2026
@MahdiBaghbani MahdiBaghbani added feature New feature OCM Open Cloud Mesh labels Sep 29, 2026
@MahdiBaghbani
MahdiBaghbani force-pushed the gate-outbound-webapp-offers branch from a3bd09a to f0d2b84 Compare September 29, 2026 12:37
@MahdiBaghbani
MahdiBaghbani force-pushed the gate-outbound-webapp-offers branch 2 times, most recently from 42618f8 to ce6e2c2 Compare October 6, 2026 08:23
@MahdiBaghbani
MahdiBaghbani force-pushed the gate-outbound-webapp-offers branch from ce6e2c2 to 8d92353 Compare October 7, 2026 08:39
@MahdiBaghbani
MahdiBaghbani force-pushed the gate-outbound-webapp-offers branch from 8d92353 to dabda12 Compare October 8, 2026 08:29
@glpatcern
glpatcern force-pushed the gate-outbound-webapp-offers branch 3 times, most recently from 1b5cbb5 to 21457bc Compare October 12, 2026 14:26
@MahdiBaghbani
MahdiBaghbani force-pushed the gate-outbound-webapp-offers branch 2 times, most recently from 3f90e32 to d69da61 Compare October 15, 2026 16:20
@MahdiBaghbani
MahdiBaghbani force-pushed the gate-outbound-webapp-offers branch 2 times, most recently from c672abd to a8652c6 Compare October 15, 2026 20:56
@glpatcern
glpatcern force-pushed the gate-outbound-webapp-offers branch from a8652c6 to 8e43a2e Compare October 19, 2026 10:18
@glpatcern
glpatcern force-pushed the gate-outbound-webapp-offers branch 2 times, most recently from 4d33d76 to 367927b Compare October 20, 2026 09:20

@glpatcern glpatcern left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this one we have an extension to do. The webapp name is not necessarily fixed but should be worked out from the underlying files being exposed. Which actually brings a shortcoming in the spec: there could be multiple apps, all served from the same endpoint according to the file's mimetype, so we should be able to pass multiple app names.

To be further expanded, but to start with, the config should boil down to offer_webapp and webapp_endpoint


log := appctx.GetLogger(ctx)
log.Info().Str("url", url).Str("payload", string(body)).Msg("Sending OCM share")
logNewShareDiagnostic(log, r.ProviderID, "", "Sending OCM share")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I believe we still need to log the outgoing payload, for debugging reasons. And we need to reintroduce it also on the receiving side. I know it contains a secret, which may be redacted, but we still need all the rest, so this is to be reverted.

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 gate-outbound-webapp-offers branch from 7cbf8b0 to 7098442 Compare October 30, 2026 15:37
@MahdiBaghbani

Copy link
Copy Markdown
Member Author

To be further expanded, but to start with, the config should boil down to offer_webapp and webapp_endpoint

Should it first be added to OCM specification?

@glpatcern

Copy link
Copy Markdown
Member

Should it first be added to OCM specification?

It's in my to-do list for next week, if you want to draft something feel free ;)

This branch has not been deployed

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

Labels

feature New feature OCM Open Cloud Mesh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants