Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCredentialsFromJSONFile ¶ added in v1.16.6
func LoadCredentialsFromJSONFile(filePath string) (clientID, clientSecret, issuerURL string, err error)
LoadCredentialsFromJSONFile reads client_id, client_secret, and issuer_url from a JSON file.
Types ¶
type ClientCredentials ¶
type ClientCredentials struct {
// contains filtered or unexported fields
}
ClientCredentials is an OAuth2 Token Source that uses the client_credentials grant type to fetch a token.
func NewClientCredentials ¶
func NewClientCredentials(ctx context.Context, opts ClientCredentialsOptions) (*ClientCredentials, error)
func (*ClientCredentials) Token ¶
func (c *ClientCredentials) Token() (string, error)
type ClientCredentialsMetadata ¶
type ClientCredentialsMetadata struct {
TokenCAPEM string `mapstructure:"oauth2TokenCAPEM"`
TokenURL string `mapstructure:"oauth2TokenURL"`
ClientID string `mapstructure:"oauth2ClientID"`
ClientSecret string `mapstructure:"oauth2ClientSecret"`
ClientSecretPath string `mapstructure:"oauth2ClientSecretPath"`
CredentialsFilePath string `mapstructure:"oauth2CredentialsFile"`
Audiences []string `mapstructure:"oauth2Audiences"`
Scopes []string `mapstructure:"oauth2Scopes"`
}
ClientCredentialsMetadata is the metadata fields which can be used by a component to configure an OIDC client_credentials token source.
func (*ClientCredentialsMetadata) ResolveCredentials ¶ added in v1.16.6
func (m *ClientCredentialsMetadata) ResolveCredentials() error
ResolveCredentials loads client_id and client_secret from files if configured.
func (*ClientCredentialsMetadata) ToOptions ¶ added in v1.16.6
func (m *ClientCredentialsMetadata) ToOptions(logger logger.Logger) ClientCredentialsOptions
ToOptions converts ClientCredentialsMetadata to ClientCredentialsOptions.
type CredentialsFile ¶ added in v1.16.6
type CredentialsFile struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
IssuerURL string `json:"issuer_url"`
}
CredentialsFile represents a JSON credentials file.
Click to show internal directories.
Click to hide internal directories.