Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTokenCredentials ¶
func NewTokenCredentials(source TokenSource) *tokenCredentials
NewTokenCredentials creates a new tokenCredentials instance for the given token source.
Types ¶
type ServiceAccount ¶
type ServiceAccount struct {
// contains filtered or unexported fields
}
ServiceAccount impersonates a service account using the Kubernetes TokenRequest API.
func NewServiceAccount ¶
func NewServiceAccount(client serviceAccountInterface, serviceAccountName string) *ServiceAccount
NewServiceAccount returns a new ServiceAccount with the given name and using the given Kubernetes client.
func (*ServiceAccount) Prune ¶
func (m *ServiceAccount) Prune(unusedSince time.Time) int
Prunes unused token sources from the cache. Returns a count of pruned token sources.
func (*ServiceAccount) TokenSource ¶
func (m *ServiceAccount) TokenSource(audience string) TokenSource
TokenSource returns a (cached) token source for the given audience.
type TokenSource ¶
TokenSource is an interface for requesting a token, similar to oauth2.TokenSource but accepting a context.
type TokenSourceFactory ¶
type TokenSourceFactory interface { TokenSource(audience string) TokenSource Prune(olderThan time.Time) int }
TokenSourceFactory is an interface for creating TokenSources for a given audience.
Click to show internal directories.
Click to hide internal directories.