clientcredentials

package
v2.24.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, logger log.Logger, tracerProvider trace.TracerProvider, cleanUpInterval time.Duration) (*Cache, error)

func (*Cache) Close

func (c *Cache) Close()

func (*Cache) GetToken

func (c *Cache) GetToken(ctx context.Context, key string, urlValues map[string]string, requiredClaims map[string]interface{}) (*oauth2.Token, error)

func (*Cache) GetTokenFromOAuth

func (c *Cache) GetTokenFromOAuth(ctx context.Context, urlValues map[string]string, requiredClaims map[string]interface{}) (*oauth2.Token, error)

type ClaimNotFoundError

type ClaimNotFoundError struct {
	Claim    string
	Expected interface{}
	Got      interface{}
}

func NewClaimNotFoundError

func NewClaimNotFoundError(claim string, expected, got interface{}) ClaimNotFoundError

func (ClaimNotFoundError) Error

func (e ClaimNotFoundError) Error() string

type Config

type Config struct {
	Authority        string              `yaml:"authority" json:"authority"`
	ClientID         string              `yaml:"clientID" json:"clientId"`
	ClientSecretFile urischeme.URIScheme `yaml:"clientSecretFile" json:"clientSecretFile"`
	Scopes           []string            `yaml:"scopes" json:"scopes"`
	TokenURL         string              `yaml:"-" json:"tokenUrl"`
	Audience         string              `yaml:"audience" json:"audience"`
	ClientSecret     string              `yaml:"-" json:"clientSecret"`
	HTTP             client.Config       `yaml:"http" json:"http"`
}

func (Config) ToClientCredentials

func (c Config) ToClientCredentials(tokenURL, clientSecret string) clientcredentials.Config

func (Config) ToDefaultClientCredentials

func (c Config) ToDefaultClientCredentials() clientcredentials.Config

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL