Documentation
¶
Index ¶
Constants ¶
View Source
const ClientCredentialsCmdName = api.ClientCredentialsCmdName
View Source
const CmdName = "auth"
View Source
const ErrNonInteractiveEnvironmentEmptyToken = "a static API token is required in non-interactive environments"
View Source
const OIDCCmdName = api.OIDCCmdName
Variables ¶
This section is empty.
Functions ¶
func LoginKongVars ¶ added in v1.12.0
LoginKongVars returns all variables which are used in the login command
Types ¶
type API ¶ added in v1.12.0
type API struct {
URL string `help:"The URL of the Nine API" default:"https://nineapis.ch" env:"NCTL_API_URL" hidden:""`
Token string `` /* 136-byte string literal not displayed */
ClientID string `help:"Use an API client ID to login. Requires the --organization to also be set." env:"NCTL_API_CLIENT_ID"`
ClientSecret string `help:"Use an API client secret to login. Requires the --organization to also be set." env:"NCTL_API_CLIENT_SECRET"`
TokenURL string `help:"Override the default client token URL" hidden:"" default:"${token_url}" env:"NCTL_API_TOKEN_URL"`
}
func (*API) Oauth2Token ¶ added in v1.12.0
type ClientCredentialsCmd ¶ added in v1.12.0
type ClientCredentialsCmd struct {
API `embed:""`
}
type ClusterCmd ¶
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:""`
ClientCredentials ClientCredentialsCmd `cmd:"" help:"Perform APIServiceAccount client-credentials 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 {
API API `embed:"" prefix:"api-"`
Organization string `help:"The name of your organization to use when providing an API client ID/secret." env:"NCTL_ORGANIZATION"`
IssuerURL string `help:"Issuer URL is the OIDC issuer URL of the API." default:"${issuer_url}" hidden:""`
ClientID string `help:"Client ID is the OIDC client ID of the API." default:"${client_id}" hidden:""`
ForceInteractiveEnvOverride bool `` /* 193-byte string literal not displayed */
// contains filtered or unexported fields
}
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"`
// contains filtered or unexported fields
}
type PrintAccessTokenCmd ¶ added in v1.5.0
type PrintAccessTokenCmd struct{}
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"`
}
type SetProjectCmd ¶ added in v1.1.0
type SetProjectCmd struct {
Name string `arg:"" help:"Name of the default project to be used." predictor:"project_name"`
}
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"`
}
Click to show internal directories.
Click to hide internal directories.