fix: treat the OAuth2 user id as opaque - #392
Merged
Merged
Conversation
The 0.6 line was branched from v0.6.1, whose tree still carries the drone configuration only. Releases are tag triggered through .github/workflows/release.yml, and GitHub resolves that file from the tagged commit, so without the workflows a v0.6.x tag would build nothing at all and the branch would have no CI. Port the workflow set from master, adapted for this line: - CI and the dist build run on php 7.4 against owncloud/core 10.16, because appinfo/info.xml declares max-version="10" and php min-version="7.4". - Trivy builds the tree to scan with php 7.4 for the same reason. - The acceptance job is left out: the reusable acceptance workflow installs a hardcoded owncloud-daily-master-qa.tar.bz2 (11.x) with the owncloudci/core:php83 image and offers no input to point it elsewhere, so an app declaring max-version="10" cannot be enabled on that server. Signed-off-by: Thomas M眉ller <323649642+oc-tmueller@users.noreply.github.com>
The token endpoint and the bearer auth module split the user id stored on an authorization code, access token or refresh token at the first colon and then resolved whatever user the remainder named. That is a leftover of the `login name:user id` format which only v0.5.0 - v0.5.2 ever wrote: e5b508c restored raw user id storage in 2022, so the parsers see a plain user id today, and a legacy pair value cannot reach them either - authorization codes expire after 10 minutes, access tokens after 1 hour, and refresh tokens were always stored with the already-split value. The parsing is therefore dead code, and a user id which legitimately contains a colon must not be reinterpreted. Treat the stored value as an opaque user id in all three places. The AuthModuleTest case which asserted the splitting behaviour is replaced by one asserting that the stored user id is used verbatim. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Thomas M眉ller <323649642+oc-tmueller@users.noreply.github.com>
phil-davis
approved these changes
Sep 9, 2026
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.
Backport of #389 to the 0.6 / ownCloud 10 line. The code diff is identical to what was merged
on
master.The token endpoint and the bearer auth module split the user id stored on an authorization code,
access token or refresh token at the first colon and then resolved whatever user the remainder
named. That is a leftover of the
login name:user idformat which only v0.5.0 - v0.5.2 everwrote: e5b508c restored raw user id storage in 2022, so the parsers see a plain user id today,
and a legacy pair value cannot reach them either - authorization codes expire after 10 minutes,
access tokens after 1 hour, and refresh tokens were always stored with the already-split value.
The parsing is therefore dead code, and a user id which legitimately contains a colon must not be
reinterpreted. This treats the stored value as an opaque user id in all three places.
The
AuthModuleTestcase which asserted the splitting behaviour is replaced by one asserting thatthe stored user id is used verbatim, and
OAuthApiControllerTestgains regression coverage forboth grant paths.
Stacked on #391 so that it runs under the CI that PR adds - the
release-0.6branch has noworkflows until #391 lands. GitHub retargets this PR to
release-0.6automatically when #391 ismerged. Review #391 first.