auth

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const OIDCCmdName = "auth oidc"

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterCmd

type ClusterCmd struct {
	Name       string `arg:"" help:"Name of the cluster to authenticate with. Also accepts 'name/project' 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."`
	Logout           LogoutCmd           `cmd:"" help:"Logout from nineapis.ch."`
	Cluster          ClusterCmd          `cmd:"" help:"Authenticate with Kubernetes Cluster."`
	OIDC             OIDCCmd             `cmd:"" help:"Perform interactive OIDC login." hidden:""`
	SetProject       SetProjectCmd       `cmd:"" help:"Set the default project to be used."`
	SetOrg           SetOrgCmd           `cmd:"" help:"Set the organization to be used."`
	Whoami           WhoAmICmd           `cmd:"" help:"Show who you are logged in as, your active organization and all your available organizations."`
	PrintAccessToken PrintAccessTokenCmd `cmd:"" help:"Print short-lived access token to authenticate against the API to stdout and exit."`
}

type LoginCmd

type LoginCmd struct {
	APIURL       string `help:"The URL of the Nine API" default:"https://nineapis.ch" env:"NCTL_API_URL" name:"api-url"`
	APIToken     string `` /* 140-byte string literal not displayed */
	Organization string `` /* 207-byte string literal not displayed */
	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"`
}

func (*LoginCmd) Run

func (l *LoginCmd) Run(ctx context.Context, command string, tk api.TokenGetter) error

type LogoutCmd added in v1.2.2

type LogoutCmd struct {
	APIURL    string `help:"The URL of the Nine API" default:"https://nineapis.ch" env:"NCTL_API_URL" name:"api-url"`
	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"`
}

func (*LogoutCmd) Run added in v1.2.2

func (l *LogoutCmd) Run(ctx context.Context, command string, tk api.TokenGetter) error

type OIDCCmd

type OIDCCmd struct {
	IssuerURL string
	ClientID  string
	UsePKCE   bool
}

func (*OIDCCmd) Run

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

type PrintAccessTokenCmd added in v1.5.0

type PrintAccessTokenCmd struct{}

func (*PrintAccessTokenCmd) Run added in v1.5.0

func (o *PrintAccessTokenCmd) Run(ctx context.Context, client *api.Client) error

type SetOrgCmd added in v1.2.0

type SetOrgCmd struct {
	Organization string `arg:"" help:"Name of the organization to login to." default:""`
	APIURL       string `help:"The URL of the Nine API" default:"https://nineapis.ch" env:"NCTL_API_URL" name:"api-url"`
	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"`
}

func (*SetOrgCmd) Run added in v1.2.0

func (s *SetOrgCmd) Run(ctx context.Context, client *api.Client) error

type SetProjectCmd added in v1.1.0

type SetProjectCmd struct {
	Name string `arg:"" predictor:"resource_name" help:"Name of the default project to be used."`
}

func (*SetProjectCmd) Run added in v1.1.0

func (s *SetProjectCmd) Run(ctx context.Context, client *api.Client) error

type WhoAmICmd added in v1.2.0

type WhoAmICmd struct {
	APIURL    string `help:"The URL of the Nine API" default:"https://nineapis.ch" env:"NCTL_API_URL" name:"api-url"`
	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"`
}

func (*WhoAmICmd) Run added in v1.2.0

func (s *WhoAmICmd) Run(ctx context.Context, client *api.Client) error

Jump to

Keyboard shortcuts

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