Documentation
¶
Overview ¶
Package cmd provides CLI commands for the CERN SSO tool.
Package cmd provides CLI commands for the CERN SSO tool.
Package cmd provides CLI commands for the CERN SSO tool.
Index ¶
- func Execute()
- func GetAuthConfig() auth.AuthConfig
- func GetOTPProvider() *auth.OTPProvider
- func GetPreferredMethod() string
- func GetWebAuthnProvider() *auth.WebAuthnProvider
- func SetVersion(v string)
- func ValidateAuthMethodFlags() error
- func ValidateMethodFlags() error
- type CookieOutput
- type DeviceOutput
- type HarborSecretOutput
- type OpenShiftLoginOutput
- type TokenOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetAuthConfig ¶ added in v0.24.0
func GetAuthConfig() auth.AuthConfig
GetAuthConfig returns the authentication configuration from CLI flags.
func GetOTPProvider ¶
func GetOTPProvider() *auth.OTPProvider
GetOTPProvider returns an OTP provider configured with CLI flags.
func GetPreferredMethod ¶ added in v0.18.0
func GetPreferredMethod() string
GetPreferredMethod returns the user's preferred 2FA method. Returns "otp", "webauthn", or "" (use server default).
func GetWebAuthnProvider ¶
func GetWebAuthnProvider() *auth.WebAuthnProvider
GetWebAuthnProvider returns a WebAuthn provider configured with CLI flags.
func ValidateAuthMethodFlags ¶ added in v0.24.0
func ValidateAuthMethodFlags() error
ValidateAuthMethodFlags checks that authentication method flags are mutually exclusive. It also handles the implication that --keytab implies --use-keytab.
func ValidateMethodFlags ¶ added in v0.18.0
func ValidateMethodFlags() error
ValidateMethodFlags checks that --use-otp and --use-webauthn are not both set.
Types ¶
type CookieOutput ¶ added in v0.21.0
type CookieOutput struct {
File string `json:"file"`
Count int `json:"count"`
User string `json:"user,omitempty"`
}
CookieOutput represents the JSON output for the cookie command.
type DeviceOutput ¶ added in v0.21.0
type DeviceOutput struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token,omitempty"`
Scope string `json:"scope,omitempty"`
}
DeviceOutput represents the JSON output for the device command.
type HarborSecretOutput ¶ added in v0.27.0
HarborSecretOutput represents the JSON output for the harbor command.
type OpenShiftLoginOutput ¶ added in v0.27.0
type OpenShiftLoginOutput struct {
Command string `json:"command"`
Token string `json:"token,omitempty"`
Server string `json:"server,omitempty"`
}
OpenShiftLoginOutput represents the JSON output for the openshift command.
type TokenOutput ¶ added in v0.21.0
type TokenOutput struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
}
TokenOutput represents the JSON output for the token command.