-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
relevant consul issue hashicorp/consul#4483 |
There was a problem hiding this 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.
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. |
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!