sbauth

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenProvider

type TokenProvider struct {

	// InsecureDisableTLS disables TLS. This is only used if the user is connecting to localhost
	// and is using an emulator connection string. See [ConnectionStringProperties.Emulator] for
	// details.
	InsecureDisableTLS bool
	// contains filtered or unexported fields
}

TokenProvider handles access tokens and expiration calculation for SAS keys (via connection strings) or TokenCredentials from Azure Identity.

func NewTokenProvider

func NewTokenProvider(tokenCredential azcore.TokenCredential) *TokenProvider

NewTokenProvider creates a tokenProvider from azcore.TokenCredential.

func NewTokenProviderWithConnectionString

func NewTokenProviderWithConnectionString(props conn.ConnectionStringProperties) (*TokenProvider, error)

NewTokenProviderWithConnectionString creates a tokenProvider from a connection string.

func (*TokenProvider) GetToken

func (tp *TokenProvider) GetToken(uri string) (*auth.Token, error)

GetToken will retrieve a new token. This function makes us compatible with auth.TokenProvider.

func (*TokenProvider) GetTokenAsTokenProvider

func (tp *TokenProvider) GetTokenAsTokenProvider(uri string) (*singleUseTokenProvider, time.Time, error)

GetToken returns a token (that is compatible as an auth.TokenProvider) and the calculated time when you should renew your token.

Jump to

Keyboard shortcuts

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