Documentation
¶
Index ¶
- func NewFactory() extension.Factory
- type BearerAuthRoundTripper
- type BearerTokenAuth
- func (b *BearerTokenAuth) Authenticate(ctx context.Context, headers map[string][]string) (context.Context, error)
- func (b *BearerTokenAuth) PerRPCCredentials() (credentials.PerRPCCredentials, error)
- func (b *BearerTokenAuth) RoundTripper(base http.RoundTripper) (http.RoundTripper, error)
- func (b *BearerTokenAuth) Shutdown(_ context.Context) error
- func (b *BearerTokenAuth) Start(ctx context.Context, _ component.Host) error
- type Config
- type PerRPCAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for the static bearer token Authenticator extension.
Types ¶
type BearerAuthRoundTripper ¶ added in v0.39.0
type BearerAuthRoundTripper struct {
// contains filtered or unexported fields
}
BearerAuthRoundTripper intercepts and adds Bearer token Authorization headers to each http request.
type BearerTokenAuth ¶
type BearerTokenAuth struct {
// contains filtered or unexported fields
}
BearerTokenAuth is an implementation of auth.Client. It embeds a static authorization "bearer" token in every rpc call.
func (*BearerTokenAuth) Authenticate ¶ added in v0.80.0
func (b *BearerTokenAuth) Authenticate(ctx context.Context, headers map[string][]string) (context.Context, error)
Authenticate checks whether the given context contains valid auth data.
func (*BearerTokenAuth) PerRPCCredentials ¶
func (b *BearerTokenAuth) PerRPCCredentials() (credentials.PerRPCCredentials, error)
PerRPCCredentials returns PerRPCAuth an implementation of credentials.PerRPCCredentials that
func (*BearerTokenAuth) RoundTripper ¶ added in v0.38.0
func (b *BearerTokenAuth) RoundTripper(base http.RoundTripper) (http.RoundTripper, error)
RoundTripper is not implemented by BearerTokenAuth
type Config ¶
type Config struct { // Scheme specifies the auth-scheme for the token. Defaults to "Bearer" Scheme string `mapstructure:"scheme,omitempty"` // BearerToken specifies the bearer token to use for every RPC. BearerToken configopaque.String `mapstructure:"token,omitempty"` // Filename points to a file that contains the bearer token to use for every RPC. Filename string `mapstructure:"filename,omitempty"` }
Config specifies how the Per-RPC bearer token based authentication data should be obtained.
type PerRPCAuth ¶
type PerRPCAuth struct {
// contains filtered or unexported fields
}
PerRPCAuth is a gRPC credentials.PerRPCCredentials implementation that returns an 'authorization' header.
func (*PerRPCAuth) GetRequestMetadata ¶
GetRequestMetadata returns the request metadata to be used with the RPC.
func (*PerRPCAuth) RequireTransportSecurity ¶
func (c *PerRPCAuth) RequireTransportSecurity() bool
RequireTransportSecurity always returns true for this implementation. Passing bearer tokens in plain-text connections is a bad idea.