Skip to content

Conversation

@fsul7o
Copy link
Contributor

@fsul7o fsul7o commented Jan 6, 2026

Description

Support custom authorization header for access token extraction

Type of change

  • Bug fix
  • New feature
  • Refactoring (no functional changes, no api changes)
  • Non-code changes (update documentation, pipeline, etc.)

Flags

  • Breaks backward compatibility
  • Requires a documentation update
  • Has untestable code

Related issue/PR

Delete this section if there are no issues or pull requests that relate to this pull request.

  • Fixes #issue
  • Closes #PR

Checklist

  • Followed the guidelines in the CONTRIBUTING document
  • Added prefix [skip ci]/[ci skip]/[no ci]/[skip actions]/[actions skip] in the PR title if necessary
  • Tested and linted the code
  • Commented the code
  • Made corresponding changes to the documentation
  • Passed all pipeline checking

Checklist for maintainer

  • Use Squash and merge
  • Double-confirm the merge message has prefix [skip ci]/[ci skip]/[no ci]/[skip actions]/[actions skip]
  • Delete the branch after merge

Signed-off-by: fsul7o <75571344+fsul7o@users.noreply.github.com>
@fsul7o fsul7o requested a review from Copilot January 7, 2026 05:27
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 adds support for custom authorization headers for access token extraction. Previously, the system used a hardcoded header name, but now allows configuration of which HTTP header contains the access token.

Key changes:

  • Added AccessTokenAuthHeader configuration field with a default value of "Authorization"
  • Updated the authorization daemon initialization to pass the custom header name to the access token parameter
  • Added test coverage for both custom header and default header scenarios

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
config/config.go Updated comment to reflect that AccessTokenAuthHeader is now supported for both gRPC and HTTP
config/config_test.go Added expected test value for the new AccessTokenAuthHeader field
test/data/example_config.yaml Added example configuration showing the new accessTokenAuthHeader field
usecase/authz_proxyd.go Implemented default value logic and passed AccessTokenAuthHeader to authorization daemon initialization
usecase/authz_proxyd_test.go Added test cases for custom header and empty header (default) scenarios
go.mod Updated athenz-authorizer dependency and removed indirect dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: fsul7o <75571344+fsul7o@users.noreply.github.com>
@fsul7o fsul7o merged commit 4e3de93 into master Jan 7, 2026
2 checks passed
@fsul7o fsul7o deleted the add-custom-authorization-header branch January 7, 2026 06:46
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.

3 participants