sbauth

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 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 {
	// 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(parsed *conn.ParsedConn) (*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