Repository navigation
feat(ocm): gate outbound webapp offers - #5854
MahdiBaghbani wants to merge 14 commits into
Conversation
a3bd09a to
f0d2b84
Compare
42618f8 to
ce6e2c2
Compare
ce6e2c2 to
8d92353
Compare
8d92353 to
dabda12
Compare
1b5cbb5 to
21457bc
Compare
3f90e32 to
d69da61
Compare
c672abd to
a8652c6
Compare
a8652c6 to
8e43a2e
Compare
4d33d76 to
367927b
Compare
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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>
7cbf8b0 to
7098442
Compare
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 PR is part of the cs3org/OCM-STA#20 and cs3org/OCM-STA#48
Summary
offer_webappis on (default false), the request carries a webapp candidate, the remote resource type listsblankinwebapp-receive, and remote discovery advertisesexchange-token. Otherwise every webapp method is dropped and the WebDAV method still goes out.freshAccessMethods, beforeNewShare, and store that same list. The wire request used to be filtered bygetProtocolswhile the share was stored fromreq.AccessMethods, so storage kept webapp methods the remote never received.webapp_nameandwebapp_endpointon the offer. Empty requirements default tomust-exchange-token; supplied ones must be known, non-blank, unique, and match the WebDAV set, otherwiseInvalidArgumentwith 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_webappstays 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"]