Skip to content

ChallengeScheme.valueOf: Bearer and MAC no longer resolve to HTTP_OAuth - #1621

Merged
thboileau-git merged 2 commits into
2.6from
fix/challenge-scheme-lookup-2.6
Nov 1, 2026
Merged

thboileau-git merged 2 commits into
2.6from
fix/challenge-scheme-lookup-2.6

Conversation

@thboileau-git

Copy link
Copy Markdown
Collaborator

The aim

Fixes #1618.

ChallengeScheme.valueOf("HTTP_Bearer") and valueOf("HTTP_MAC") returned HTTP_OAUTH instead of HTTP_OAUTH_BEARER and HTTP_OAUTH_MAC: a copy-paste slip in the lookup table. Since ChallengeScheme equality compares names, a scheme read back by name was not equal to the constant it came from.

The solution

The two entries of the lookup table now map to their own constants. HTTP_AWS_IAM and HTTP_AWS_QUERY still resolve to HTTP_AWS_S3, which looks intentional, so they are left unchanged.

The same two lines are fixed in 2.6, 2.7 and 3.0. Tests: Bearer, MAC and OAuth are looked up by name, and every ChallengeScheme constant must be found again by valueOf(name) (the two AWS aliases excepted), so a similar slip fails the build.

Reproduction

ChallengeScheme.valueOf("HTTP_Bearer") returns HTTP_OAuth (technical name OAuth) before the fix; no code of the core calls valueOf itself, so only applications and extensions that do are affected.

Check-list

  • PR size
    • Under 300 lines ✅
    • Can't be split without complicating the process even more
  • Tests
    • Added
  • Doc
    • Added (changes.md)
  • Reviewer
    • Asked for a review

🤖 Generated with Claude Code

thboileau and others added 2 commits November 1, 2026 13:05
…th (#1618)

The lookup table mapped the names of HTTP_OAUTH_BEARER (HTTP_Bearer) and
HTTP_OAUTH_MAC (HTTP_MAC) to HTTP_OAUTH, a copy-paste slip. valueOf now
returns the matching constants. Added tests checking the two schemes and
that every constant is found again by its name (HTTP_AWS_IAM and
HTTP_AWS_QUERY deliberately resolve to HTTP_AWS_S3).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

@thboileau-git
thboileau-git merged commit 9fb9c46 into 2.6 Nov 1, 2026
3 checks passed
@thboileau-git
thboileau-git deleted the fix/challenge-scheme-lookup-2.6 branch November 1, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants