exporter-toolkit icon indicating copy to clipboard operation
exporter-toolkit copied to clipboard

feat: HTTP Bearer Authorization for simple use cases

Open robbat2 opened this issue 1 year ago • 4 comments

Add support for HTTP Bearer Authorization for simple use cases, where HTTP Basic might not fit workflows.

Signed-off-by: Robin H. Johnson [email protected]

robbat2 avatar Jan 07 '24 00:01 robbat2

I wonder if we should support arbitrary headers, rather than specifically one kind of bearer token. The reason we have the basic auth here is because there's some standard encoding involved. Authorization: Bearer xxxx is a simple opaque string.

SuperQ avatar Jan 07 '24 13:01 SuperQ

I actually started considering other auth to add, including HTTP Digest (which also needs special handling like Basic)

For your proposal, it would be match header to accept:

match_header:
  authorization:
    - "Bearer foo"
    - "FakeAuth value2"
  x-random-stuff:
    - "abc123"

robbat2 avatar Jan 07 '24 23:01 robbat2

Some work on Digest auth was being done over in the common package.

https://github.com/prometheus/common/pull/553

SuperQ avatar Jan 08 '24 11:01 SuperQ

@SuperQ hmm, reading that, I realize there is more auth support in common already that not being exposed in toolkit; should I include that in this PR?

robbat2 avatar Jan 10 '24 17:01 robbat2