Conversation
The Cloud PDP requires uppercase "Bearer" in the Authorization header per RFC 6750. Using lowercase "bearer" causes 401 Unauthorized errors. Fixes permitio#122
There was a problem hiding this comment.
Pull request overview
This PR fixes Authorization header formatting to comply with RFC 6750 by changing "bearer" to "Bearer" (uppercase). The Cloud PDP was rejecting requests with lowercase "bearer" and returning 401 Unauthorized errors.
- Changed Authorization header format from
f"bearer {token}"tof"Bearer {token}"across all API client implementations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| permit/pdp_api/pdp_api_client.py | Updated Authorization header to use uppercase "Bearer" in PDP API client initialization |
| permit/pdp_api/base.py | Updated Authorization header to use uppercase "Bearer" in HTTP client builder |
| permit/enforcement/enforcer.py | Updated Authorization header to use uppercase "Bearer" in enforcer initialization |
| permit/api/base.py | Updated Authorization header to use uppercase "Bearer" in API base HTTP client builder |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zeevmoney
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
|
Thanks @SureneruS, both for the report in #122 and for this fix. Your change is merged to main as part of #126, with you credited as co-author on the commit, and ships in permit 3.0.0. The SDK now sends the canonical Closing this as incorporated into #126. Thanks again! |
Summary
The Cloud PDP requires uppercase "Bearer" in the Authorization header per RFC 6750. Using lowercase "bearer" causes 401 Unauthorized errors.
Changes
Fixed 4 files:
permit/enforcement/enforcer.py:47permit/api/base.py:177permit/pdp_api/base.py:51permit/pdp_api/pdp_api_client.py:22Testing
bearerBearerFixes #122