auth

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginCmdName = "auth login"
)
View Source
const (
	OIDCCmdName = "auth oidc"
)

Variables

This section is empty.

Functions

func ContextName

func ContextName(cluster *infrastructure.KubernetesCluster) string

func RemoveClusterFromConfig

func RemoveClusterFromConfig(client *api.Client, clusterContext string) error

Types

type ClusterCmd

type ClusterCmd struct {
	Name       string `arg:"" help:"Name of the cluster to authenticate with. Also accepts 'name/namespace' format."`
	ExecPlugin bool   `help:"Automatically run exec plugin after writing the kubeconfig."`
}

func (*ClusterCmd) Run

func (a *ClusterCmd) Run(ctx context.Context, client *api.Client) error

type Cmd

type Cmd struct {
	Login   LoginCmd   `cmd:"" help:"Login to nineapis.ch."`
	Cluster ClusterCmd `cmd:"" help:"Authenticate with Kubernetes Cluster."`
	OIDC    OIDCCmd    `cmd:"" help:"Perform interactive OIDC login." hidden:""`
}

type LoginCmd

type LoginCmd struct {
	Organization string `arg:"" help:"Name of the organization to login to."`
	APIURL       string `help:"The URL of the Nine API" default:"https://nineapis.ch"`
	IssuerURL    string `help:"Issuer URL is the OIDC issuer URL of the API." default:"https://auth.nine.ch/auth/realms/pub"`
	ClientID     string `help:"Client ID is the OIDC client ID of the API." default:"nineapis.ch-f178254"`
	ExecPlugin   bool   `help:"Automatically run exec plugin after writing the kubeconfig." hidden:"" default:"true"`
}

func (*LoginCmd) Run

func (l *LoginCmd) Run(command string) error

type OIDCCmd

type OIDCCmd struct {
	IssuerURL     string
	ClientID      string
	ClientSecret  string
	ExtraScopes   []string
	UsePKCE       bool
	TokenCacheDir string
}

func (*OIDCCmd) Run

func (o *OIDCCmd) Run(ctx context.Context, out io.Writer) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL