auth

package
v1.1.6-rc Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Tenant                      string `yaml:"tenant_id" validate:"omitempty,uuid4"`
	ClientID                    string `yaml:"client_id" validate:"omitempty,uuid4"`
	ClientSecret                string `yaml:"client_secret"`
	ClientPKCS12Certificate     string `yaml:"client_pkcs12_certificate"`
	ClientCertificate           string `yaml:"client_certificate"`
	ClientCertificateThumbprint string `yaml:"client_certificate_thumbprint"`
	PrivateKey                  string `yaml:"client_private_key"`
	PrivateKeyPassword          string `yaml:"decrypt_password"`
}

Config is the configuration for using Azure authentication

func (*Config) Client

func (c *Config) Client(ctx context.Context, scopes []string) (*http.Client, error)

Client returns an HTTP client wrapping the context's HTTP transport and adding Authorization headers with tokens obtained from c.

func (*Config) TokenSource

func (c *Config) TokenSource(ctx context.Context, scopes []string) (ts oauth2.TokenSource, err error)

TokenSource returns new token source using the configuration.

Jump to

Keyboard shortcuts

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