Documentation ¶
Index ¶
Constants ¶
View Source
const StoragePropagationKey = "storage.propagate.token"
StoragePropagationKey is a key for viper configuration to pass this option to storage plugins.
Variables ¶
This section is empty.
Functions ¶
func ContextWithBearerToken ¶
ContextWithBearerToken set bearer token in context.
func GetBearerToken ¶
GetBearerToken from context, or empty string if there is no token.
func PropagationHandler ¶
PropagationHandler returns a http.Handler containing the logic to extract the Bearer token from the Authorization header of the http.Request and insert it into request.Context for propagation. The token can be accessed via GetBearerToken.
Types ¶
type RoundTripper ¶
type RoundTripper struct { // Transport is the underlying http.RoundTripper being wrapped. Required. Transport http.RoundTripper // StaticToken is the pre-configured bearer token. Optional. StaticToken string // OverrideFromCtx enables reading bearer token from Context. OverrideFromCtx bool }
RoundTripper wraps another http.RoundTripper and injects an authentication header with bearer token into requests.
Click to show internal directories.
Click to hide internal directories.