Documentation ¶
Index ¶
- Constants
- func GetToken(ctx context.Context, issuerURL, clientID string, usePKCE bool, out io.Writer) error
- func GetTokenFromConfig(ctx context.Context, cfg *rest.Config) (string, error)
- func GetTokenFromExecConfig(ctx context.Context, execConfig *api.ExecConfig) (string, error)
- func LoadingRules() (*clientcmd.ClientConfigLoadingRules, error)
- func NamespacedName(name, project string) types.NamespacedName
- func NewScheme() (*runtime.Scheme, error)
- func ObjectName(obj runtimeclient.Object) types.NamespacedName
- type Client
- type ClientOpt
- type DefaultTokenGetter
- type TokenGetter
- type UserInfo
Constants ¶
View Source
const ( IssuerURLArg = "--issuer-url=" ClientIDArg = "--client-id=" UsePKCEArg = "--use-pkce" CustomersPrefix = "/Customers/" )
Variables ¶
This section is empty.
Functions ¶
func GetToken ¶ added in v1.1.0
GetToken executes the OIDC login flow using the kubelogin with the provided OIDC parameters writes the raw JSON ExecCredential result to out.
func GetTokenFromConfig ¶ added in v1.1.0
GetTokenFromConfig takes a rest.Config and returns a valid OIDC access token or the static bearer token if it's set in the config.
func GetTokenFromExecConfig ¶ added in v1.1.0
GetTokenFromExecConfig takes the provided execConfig, parses out the args and gets the token by executing the login flow.
func LoadingRules ¶
func LoadingRules() (*clientcmd.ClientConfigLoadingRules, error)
func NamespacedName ¶ added in v1.1.0
func NamespacedName(name, project string) types.NamespacedName
func ObjectName ¶ added in v1.0.1
func ObjectName(obj runtimeclient.Object) types.NamespacedName
Types ¶
type Client ¶
type Client struct { runtimeclient.WithWatch Config *rest.Config KubeconfigPath string Project string Log *log.Client Token string KubeconfigContext string }
func New ¶
func New(ctx context.Context, apiClusterContext, project string, opts ...ClientOpt) (*Client, error)
New returns a new Client by loading a kubeconfig with the supplied context and project. The kubeconfig is discovered like this: * KUBECONFIG environment variable pointing at a file * $HOME/.kube/config if exists
func (*Client) GetConnectionSecret ¶
type DefaultTokenGetter ¶ added in v1.2.0
type DefaultTokenGetter struct{}
func (*DefaultTokenGetter) GetTokenString ¶ added in v1.2.0
type TokenGetter ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.