feat(ocm): gate remote webapp actions by protocol - #276
Open
MahdiBaghbani wants to merge 1 commit into
Open
MahdiBaghbani wants to merge 1 commit into
MahdiBaghbani wants to merge 1 commit into
Conversation
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
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.
This PR is part of the cs3org/OCM-STA#20 and cs3org/OCM-STA#48
Summary
Open remotely with <appName>only for resources that carry a usable received webapp name (ocmWebApp.appName, non-blank after trim) whileocm.openRemotelyis on. The stockstorageId.startsWith(OCM_PROVIDER_ID)check is removed: an OCM storage id, a remote share type, or a URL shape doesn't prove the sender offered a webapp, so a WebDAV-only share no longer shows the action.about:blankwindow synchronously, so the popup blocker allows it, then postsfile=<resource.id>to/sciencemesh/open-in-app(feat(ocm): add safe received webapp launch cs3org/reva#5850) and submits the returnedaccess_tokentoapp_urlin a hidden form POST that targets that window.app_url, empty token,submitthrowing). The error object isn't logged. No new config key; action id and extension point are unchanged.flowchart TD A["Open remotely with appName"] --> W["window.open about:blank, named ocm-remote-timestamp"] W -->|"null, popup blocked"| PW["popup warning, no request"] W -->|"window"| P["POST /sciencemesh/open-in-app, file = resource.id"] P -->|"error"| E["close window, Couldn't open remotely"] P -->|"ok"| V{"app_url is http(s) and access_token non-empty?"} V -->|"no"| E V -->|"yes"| F["hidden form POST of access_token to app_url, target = that window"]End to end, this launch only works when the Reva side can reach the sender. In the OCM Test Suite the providers sit on a private Docker network behind a MITM proxy, and Reva's launch client refuses private addresses until the hardening set (cs3org/reva#5833 to cs3org/reva#5839) is in master and the launch is wired to its
allowed_federation_cidrs. So these specs cover the web side, and the full testbed run waits on that.web-app-ocmgets@ownclouders/web-test-helpersas a dev dependency for the new specs, which is the only reasonpnpm-lock.yamlchanges.