token

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentityTokenProvider

type IdentityTokenProvider interface {
	// GetToken returns the current valid ID token.
	// It should handle refreshing internally if needed.
	GetToken(ctx context.Context, opts ...option.Option) (credential.Token, error)
}

IdentityTokenProvider provides ID tokens for access token exchange.

type IdentityTokenProviderFunc

type IdentityTokenProviderFunc func(context.Context, ...option.Option) (credential.Token, error)

IdentityTokenProviderFunc is a function type that implements the IdentityTokenProvider interface. This allows using a function directly as an IdentityTokenProvider without creating a new struct type.

func (IdentityTokenProviderFunc) GetToken

GetToken implements the IdentityTokenProvider interface by calling the function itself.

type StaticIdentityTokenProvider

type StaticIdentityTokenProvider struct {
	// contains filtered or unexported fields
}

StaticIdentityTokenProvider is a simple implementation of IdentityTokenProvider that holds a static token. The token can be updated using the SetToken method.

func NewStaticIdentityTokenProvider

func NewStaticIdentityTokenProvider(token string) *StaticIdentityTokenProvider

NewStaticIdentityTokenProvider creates a new StaticTokenProvider with the given initial token.

func (*StaticIdentityTokenProvider) GetToken

GetToken returns the current token.

func (*StaticIdentityTokenProvider) SetToken

func (s *StaticIdentityTokenProvider) SetToken(token string)

SetToken updates the token in a thread-safe manner.

type Token

type Token struct {
	Token string
}

Jump to

Keyboard shortcuts

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