Skip to content

Fix/expired user token in guest session - #3857

Merged
maki5 merged 5 commits into
opencloud-eu:mainfrom
maki5:fix/expired_user_token_in_guest_session
Nov 11, 2026
Merged

maki5 merged 5 commits into
opencloud-eu:mainfrom
maki5:fix/expired_user_token_in_guest_session

Conversation

@maki5

@maki5 maki5 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor
  • Register GuestLinkAuthenticator after PublicShareAuthenticator and SignedURLAuthenticator, so valid credentials win.
  • Restrict GuestLinkAuthenticator to not handle credentials already handled by other authenticators
  • Scope SuppressAuthenticationChallenge to guest-only requests on guest paths

closes: #3721

might need a separate acceptance test @v-scharf

@maki5
maki5 requested review from aduffeck and rhafer October 29, 2026 11:43
@codacy-production

codacy-production Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 77 complexity

Metric Results
Complexity 77

View in Codacy

🟢 Coverage 80.33% diff coverage

Metric Results
Coverage variation Report missing for 413082e1
Diff coverage ✅ 80.33% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (413082e) Report Missing Report Missing Report Missing
Head commit (ae2116d) 93504 26861 28.73%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3857) 61 49 80.33%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

rhafer
rhafer previously requested changes Nov 5, 2026

@rhafer rhafer 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.

This breaks downloads for guest-users. For downloads we use the signedURL from the oc:downloadURL webdav property. Validating that signed url fails for guest users as the signed url validator needs to resolve to a "real" user.

Before the change downloads where working because the guest link authenticator ran before the signedurl authenticator and as the cookie was present the guestlink authenticator succeeded and the request never reached the signedurl authenticator.

Get the the order and interdependencies of those authenticators straight is somewhat tricky. I don't have a straightforward idea how to really fix this. I guess it would be good if we first documented what is actually supposed to happen when different types of credentials are available for a request. And which one is supposed to take precedence.

Also we should problably fix the signedurl authenticator to properly work with tokens signed for guest users 🤔

@aduffeck aduffeck 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.

Hm, this also seems to break TUS uploads in the guest session for me, they now fail with 401.

@maki5
maki5 force-pushed the fix/expired_user_token_in_guest_session branch from 7e4df04 to ae2116d Compare November 6, 2026 11:29
@maki5

maki5 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@aduffeck @rhafer I did the fixes for both cases in guest links authenticator, please take a look and share your opinions

@aduffeck aduffeck 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.

Thanks, lgtm.

@maki5

maki5 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, lgtm.

@aduffeck @rhafer
should we merge this pr to main before the release or should we wait until the release is rolled out?

@aduffeck

Copy link
Copy Markdown
Member

@maki5 With the bug being a P2 I think this should be merged.

@rhafer
rhafer dismissed their stale review November 11, 2026 07:52

outdated

@maki5
maki5 merged commit d7e5b97 into opencloud-eu:main Nov 11, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expired user access token falls back to a guest session cookie in the proxy

4 participants