prometheus / common

Go libraries shared across Prometheus components and libraries.
Apache License 2.0
259 stars 306 forks source link

Expose secret as SecretReader and InlineSecret from config package #650

Closed pracucci closed 3 weeks ago

pracucci commented 3 weeks ago

https://github.com/prometheus/common/pull/572 broke the vendoring in Mimir, where we have an use case calling NewBasicAuthRoundTripper(). The problem is that the secret interface is private, but it's used in publicly exposed functions like NewBasicAuthRoundTripper().

In this PR I propose to expose secret as SecretReader (we already have type Secret string) and to also expose InlineSecret given passing a const secret is a common use case.

gotjosh commented 3 weeks ago

@SuperQ @ArthurSens any objections?

gotjosh commented 3 weeks ago

I'm going to proceed with the merge as exposing things public is most of the time uncontroversial, but do let me know if there's anything that needs addressing. I've checked Prometheus and the Alertmanger - and these aren't conflicting.

alanprot commented 3 weeks ago

Nice! this was also breaking Thanos: https://github.com/prometheus/common/pull/538#issuecomment-2150596862

alanprot commented 3 weeks ago

Actually thanos also need the FileSecret to be exposed: =/

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