Documentation ¶
Overview ¶
Package oauth2clientauthextension implements `cauth.Client` This extension provides OAuth2 Client Credentials flow authenticator for HTTP and gRPC based exporters. The extension fetches and refreshes the token after expiry For further details about OAuth2 Client Credentials flow refer https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for the oauth2 client Authenticator extension.
Types ¶
type Config ¶
type Config struct { // ClientID is the application's ID. // See https://datatracker.ietf.org/doc/html/rfc6749#section-2.2 ClientID string `mapstructure:"client_id"` // ClientIDFile is the file path to read the application's ID from. ClientIDFile string `mapstructure:"client_id_file"` // ClientSecret is the application's secret. // See https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1 ClientSecret configopaque.String `mapstructure:"client_secret"` // ClientSecretFile is the file pathg to read the application's secret from. ClientSecretFile string `mapstructure:"client_secret_file"` // EndpointParams specifies additional parameters for requests to the token endpoint. EndpointParams url.Values `mapstructure:"endpoint_params"` // TokenURL is the resource server's token endpoint // URL. This is a constant specific to each server. // See https://datatracker.ietf.org/doc/html/rfc6749#section-3.2 TokenURL string `mapstructure:"token_url"` // Scope specifies optional requested permissions. // See https://datatracker.ietf.org/doc/html/rfc6749#section-3.3 Scopes []string `mapstructure:"scopes,omitempty"` // TLSSetting struct exposes TLS client configuration for the underneath client to authorization server. TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` // Timeout parameter configures `http.Client.Timeout` for the underneath client to authorization // server while fetching and refreshing tokens. Timeout time.Duration `mapstructure:"timeout,omitempty"` }
Config stores the configuration for OAuth2 Client Credentials (2-legged OAuth2 flow) setup.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.