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 ¶
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 ¶
func (f IdentityTokenProviderFunc) GetToken(ctx context.Context, opts ...option.Option) (credential.Token, error)
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 ¶
func (s *StaticIdentityTokenProvider) GetToken(ctx context.Context, opts ...option.Option) (credential.Token, error)
GetToken returns the current token.
func (*StaticIdentityTokenProvider) SetToken ¶
func (s *StaticIdentityTokenProvider) SetToken(token string)
SetToken updates the token in a thread-safe manner.