Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
func Equal(a, b Credential) bool
Types ¶
type AWSCreds ¶
type AWSCreds aws.Credentials
type Credential ¶
type Credential interface {
// contains filtered or unexported methods
}
Credential is a marker interface for credential types. Implementations include Token, AWSCredentials, and other credential types.
type EventType ¶
type EventType string
EventType represents the type of credential event. It indicates whether a credential is being updated or removed.
type Oauth2Creds ¶
func (*Oauth2Creds) IsEqual ¶
func (a *Oauth2Creds) IsEqual(b *Oauth2Creds) bool
type Provider ¶
type Provider interface {
// GetCredentialsWithOptions returns a channel that receives credential results.
// The channel provides updates when credentials are refreshed or removed.
// For the first credential and each refresh, an Update event is sent.
// If credentials are removed, a Remove event is sent.
// In case of errors, the Err field is populated, Credential is nil, and the refresh loop exits.
// When the refresh loop exits, the channel is closed.
// Options can be provided to configure the credentials request.
GetCredentialsWithOptions(ctx context.Context, opts ...option.Option) (<-chan Result, error)
}
Provider defines the interface for obtaining credentials. It is implemented by all credential providers in the tokenex library.
type Result ¶
type Result struct {
Credential Credential
Event EventType
Err error
}
Result encapsulates the credentials received from a credential provider (e.g. cloud providers, k8s etc.) and any error that might occur. When a credential is first obtained or refreshed, Event is set to UpdateEventType. When a credential is removed, Event is set to RemoveEventType. If an error occurs, Err is populated and Credential is set to nil. In case of an error, the credential refresh loop exits, the channel is closed, and it's the caller's responsibility to implement retry logic.
type VaultSecret ¶ added in v0.2.0
func (*VaultSecret) IsEqual ¶ added in v0.2.0
func (a *VaultSecret) IsEqual(b *VaultSecret) bool