Backport of parse ACL token from authorization header into release/1.3.x #13261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #12534 to be assessed for backporting due to the inclusion of the label backport/1.3.x.
The below text is copied from the body of the original PR.
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!