Skip to content

Conversation

@SureneruS
Copy link

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:47
  • permit/api/base.py:177
  • permit/pdp_api/base.py:51
  • permit/pdp_api/pdp_api_client.py:22

Testing

  • Verified 401 error with lowercase bearer
  • Verified success with uppercase Bearer

Fixes #122

The Cloud PDP requires uppercase "Bearer" in the Authorization header
per RFC 6750. Using lowercase "bearer" causes 401 Unauthorized errors.

Fixes permitio#122
@zeevmoney zeevmoney requested a review from Copilot December 31, 2025 18:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}" to f"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.

Copy link

@zeevmoney zeevmoney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

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.

Cloud PDP returns 401 due to lowercase "bearer" in Authorization header

2 participants