auth

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential interface {
	Token(ctx context.Context, options ...TokenOption) (Token, error)
}

Credential is the interface that wraps around method Token.

type Scope added in v0.10.0

type Scope string

Scope represents a scope for a token.

const (
	// ScopeResourceManager is the scope needed for tokens to be used with Azure Resource Manager.
	ScopeResourceManager Scope = "https://management.azure.com/.default"
	// ScopeKeyVault is the scope needed for tokens to be used with Azure Key Vault.
	ScopeKeyVault Scope = "https://vault.azure.net/.default"
	// ScopeAppConfig is the scope needed for tokens to be used with Azure App Config.
	ScopeAppConfig Scope = "https://azconfig.io/.default"
)

type Token

type Token struct {
	ExpiresOn   time.Time
	AccessToken string
}

Token contains the access token and when it expires.

type TokenOption added in v0.10.0

type TokenOption func(o *TokenOptions)

TokenOption is a function that sets options for a token request.

func WithScope added in v0.10.0

func WithScope(scope Scope) TokenOption

WithScope sets the scope of the token request.

type TokenOptions added in v0.10.0

type TokenOptions struct {
	Scope Scope
}

TokenOptions contains options for a token request.

Jump to

Keyboard shortcuts

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