Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(name string, tokenSource oauth2.TokenSource) tokenauth.Source
New constructs Oauth2 tokenauth that returns valid access token. It is up to token source to do login or not.
func NewGCP ¶
func NewGCP(name string, userName string, configPath string, initialConfig Config) (tokenauth.Source, error)
NewGCP constructs Oauth2 for Google provider tokenauth.Source which returns valid access tokens. Since saving and loading config is complainant with kube/config you are free to reuse that by putting kube config path inside `configPath` variable. This config file will be also used for caching valid tokens.
Types ¶
type Config ¶
type Config struct { CmdPath string `json:"cmd-path,omitempty"` CmdArgs string `json:"cmd-args,omitempty"` TokenKey string `json:"token-key,omitempty"` ExpiryKey string `json:"expiry-key,omitempty"` TimeFmt string `json:"time-fmt,omitempty"` AccessToken string `json:"access-token,omitempty"` Expiry string `json:"expiry,omitempty"` }
Config represents Oauth2 config with additional CLI configuration to get access token. Compliant with k8s config.
Click to show internal directories.
Click to hide internal directories.