Repository navigation
OCM: Send local webdav url instead of the remote - #65480
mickenordin wants to merge 5 commits into
Conversation
996a4d5 to
c31ac25
Compare
|
Thanks for this @micke, the absolute sender-side One thing I noticed while tracing it: the new It goes to This happens whenever the remote advertises
I have some snippets from the code to show the process:
The receiver side already handles the same call by falling back ( server/apps/files_sharing/lib/External/Storage.php Lines 93 to 104 in c31ac25 Could the sender do the same and drop to the legacy share method? $webDavUri = '';
if ($useExchangeToken) {
try {
$webDavUri = $this->urlGenerator->getAbsoluteURL(
$this->ocmDiscoveryService->getLocalOCMProvider(false)->extractProtocolEntry('file', 'webdav'),
);
} catch (OCMArgumentException $e) {
$this->logger->warning('No local OCM webdav entry, using legacy share method', [
'exception' => $e->getMessage(),
]);
$useExchangeToken = false;
}
}(plus Separately, the exchange-token envelope still sends I'll open a small PR on top of this branch (Thanks to you for reminding me yesterday that I was already in this rabbit hole before 😄) that sends the mapped OCM permissions instead, so the two can be reviewed together. |
| ]); | ||
| } | ||
|
|
||
| $webDavUri = ''; |
There was a problem hiding this comment.
| $webDavUri = ''; | |
| $webDavUri = $remoteDomain; |
Why is it not like this to have the previous behaviour, when not using token exchange?
There was a problem hiding this comment.
Ah because in that case the parameter isn't even used. Please change it, to avoid this problem.
There was a problem hiding this comment.
Can you clarify what what to change?
1b8cd31 to
16a12a4
Compare
@MahdiBaghbani, I pushed another commit that ported over the general idea of what you had done in the PR to Enriques branch. Can you take another look on what you think? |
|
I also noticed that we were looking for the wrong capability to use the new format, we were using token-exchange as a proxy for the newer format, but there is an actual capability for protocol-object so I changed to that too. |
f5d8004 to
f8006ce
Compare
333550f to
81422b6
Compare
|
Fantastic this seems almost pretty much in line of what I intended to do, thanks @mickenordin ! |
| try { | ||
| $provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); | ||
| $ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions); | ||
| $ocmPermissions = CloudFederationShare::ncPermissions2ocmPermissions((int)$ncPermissions); |
There was a problem hiding this comment.
It’s a code smell to have an app call methods in OC\. Could you find a home for this method in a public API if it makes sense?
There was a problem hiding this comment.
I moved it to a separate public api now
e7aa0ab to
ee4849d
Compare
ee4849d to
af4a509
Compare
We are currently mixing up the local and remote webdav urls when sending a share that uses token exchange, so that needs to be fixed. Signed-off-by: Micke Nordin <kano@sunet.se> Co-authored-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Micke Nordin <kano@sunet.se>
Signed-off-by: Micke Nordin <kano@sunet.se> Co-authored-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Micke Nordin <kano@sunet.se>
Signed-off-by: Micke Nordin <kano@sunet.se>
0a414e7 to
13d43ba
Compare
Summary
During compatibility testing with CERNBox, this issue came up. The problem is that we are currently mixing up the local and remote webdav urls when sending a share that uses token exchange, so that needs to be fixed.
Checklist
3. to review, feature component)stable32)AI (if applicable)