package sbauth

import "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/internal/sbauth"

Index

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 exported.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.

Source Files

token_provider.go

Version
v1.3.0 (latest)
Published
Feb 8, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
4 months ago

Tools for package owners.