Documentation
¶
Overview ¶
Package auth resolves credentials for the Marmot SDK.
Index ¶
Constants ¶
View Source
const K8sSATokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token" //nolint:gosec
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Credential ¶
type Credential interface {
Token() string
Scheme() Scheme
Source() string
AuthInfo() runtime.ClientAuthInfoWriter
}
Credential signs requests to the Marmot API.
func APIKey ¶
func APIKey(token string) Credential
func Bearer ¶
func Bearer(token string) Credential
func CachedToken ¶
func CachedToken(context string) Credential
CachedToken returns the OAuth token written by `marmot login` for the named context, or nil if missing or expired.
func WorkloadCredential ¶
func WorkloadCredential() Credential
WorkloadCredential returns an in-cluster Kubernetes service-account credential, or nil if none is available.
Click to show internal directories.
Click to hide internal directories.