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

parse ACL token from authorization header #12534

Merged
merged 3 commits into from
Jun 6, 2022
Merged

Conversation

kevinschoonover
Copy link
Contributor

Adds support for reading ACL token from the RFC6750 Bearer token (Authorization: Bearer <token>).

The code samples / documentation were taken from Consul:
https://github.com/hashicorp/consul/blob/973d2d0f9a2d32f6f3eae506c2b5b89f98007b58/agent/http.go#L1021-L1041
https://github.com/hashicorp/consul/blob/1d817f683a4922756db44b991428cd5f582ea6ae/website/content/api-docs/index.mdx

Background behind this is I'm using prometheus static_config to scrape metrics from nomad and the static_config configuration doesn't support custom headers, only authorization tokens. This would allow me to properly embed and use the token.

I have yet to test the locally, but will update here when I have a chance to do. Wanted to start the conversation of if this is something y'all wanted to support.

Let me know your thoughts and if there is anything else I should add!

@kevinschoonover
Copy link
Contributor Author

kevinschoonover commented Apr 10, 2022

relevant consul issue hashicorp/consul#4483

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @kevinschoonover. I'm going to push a changelog entry commit onto this PR and then we'll get it merged for the next planned release of Nomad (1.3.2).

GitHub won't let me add a commit to this PR for some reason, so I'll add the changelog independently.

@tgross tgross merged commit d725acb into hashicorp:main Jun 6, 2022
Nomad - Community Issues Triage automation moved this from Needs Triage to Done Jun 6, 2022
@tgross tgross added the backport/1.3.x backport to 1.3.x release line label Jun 6, 2022
@tgross tgross added this to the 1.3.2 milestone Jun 6, 2022
tgross added a commit that referenced this pull request Jun 6, 2022
tgross added a commit that referenced this pull request Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Oct 7, 2022

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.3.x backport to 1.3.x release line
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants