Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Authorization Bearer token support as per RFC6750 #1

Merged
merged 3 commits into from
Aug 8, 2018
Merged

Added Authorization Bearer token support as per RFC6750 #1

merged 3 commits into from
Aug 8, 2018

Conversation

mbag
Copy link
Member

@mbag mbag commented Aug 7, 2018

  • appended Authorization header token parsing after X-Consul-Token
  • added test cases
  • updated website documentation to mention Authorization header

* appended Authorization header token parsing after X-Consul-Token
* added test cases
* updated website documentation to mention Authorization header
@mbag
Copy link
Member Author

mbag commented Aug 7, 2018

@splashx please review changes made to the Consul. If you are OK with them, create PR to consul master repo. I can continue discussion with consul maintainers on hashicorp#4483

Copy link
Member

@splashx splashx left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -736,6 +736,19 @@ func TestACLResolution(t *testing.T) {
reqBothTokens, _ := http.NewRequest("GET", "/v1/catalog/nodes?token=baz", nil)
reqBothTokens.Header.Add("X-Consul-Token", "zap")

// Request with Authorization token
Copy link
Member

Choose a reason for hiding this comment

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

Add on: Authorization *Bearer* token

reqAuthAndXToken, _ := http.NewRequest("GET", "/v1/catalog/nodes", nil)
reqAuthAndXToken.Header.Add("X-Consul-Token", "xtoken")
reqAuthAndXToken.Header.Add("Authorization", "Bearer notparsed")

a := NewTestAgent(t.Name(), "")
Copy link
Member

Choose a reason for hiding this comment

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

Add a test for when Authorization: Bearer is passed (we expect the test to fail because of this line )

@splashx
Copy link
Member

splashx commented Aug 8, 2018

LGTM please merge

@mbag mbag merged commit 3f26a94 into pan-net-security:master Aug 8, 2018
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