Fix #116: Fix authentication scheme in HttpBearer challenge according to RFC 6750 - #118
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes HttpBearer::challenge() to emit a RFC 6750-compliant WWW-Authenticate header by using the Bearer authentication scheme instead of the request header name (Authorization). This aligns bearer-auth challenges with how HttpBasic already formats its challenge and resolves issue #116.
Changes:
- Update
HttpBearer::challenge()to returnWWW-Authenticate: Bearer realm="...". - Update unit tests asserting the bearer challenge value (
HttpBearerTest,CompositeTest). - Add a changelog entry documenting the bug fix.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Method/HttpBearer.php | Hardcodes the Bearer scheme in the WWW-Authenticate challenge per RFC 6750. |
| tests/Method/HttpBearerTest.php | Updates challenge assertions to expect Bearer realm="...". |
| tests/Method/CompositeTest.php | Updates composite challenge assertion to reflect the corrected bearer challenge. |
| CHANGELOG.md | Documents the bug fix for #116 under the upcoming release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #118 +/- ##
=========================================
Coverage 95.87% 95.87%
Complexity 77 77
=========================================
Files 10 10
Lines 194 194
=========================================
Hits 186 186
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
HttpBearer challenge according to RFC 6750
Use the
Bearerauthentication scheme inHttpBearer::challenge()as required by RFC 6750, instead of using the request header name. Update the corresponding challenge assertions and changelog entry.Closes #116.