auth

package
v1.218.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IdentityFlagName is the name of the identity flag (from pkg/config/const.go).
	IdentityFlagName = cfg.IdentityFlagName
	// IdentityFlagSelectValue is the sentinel value for interactive selection (from pkg/config/const.go).
	IdentityFlagSelectValue = cfg.IdentityFlagSelectValue
)
View Source
const (
	// ConsoleLabelWidth is the width for label styling in console output.
	ConsoleLabelWidth = 18
	// ConsoleOutputFormat is the format string for label-value pairs.
	ConsoleOutputFormat = "%s %s\n"
)
View Source
const (
	// FormatFlagName is the name of the format flag for env command.
	FormatFlagName = "format"
	// OutputFileFlagName is the name of the output-file flag for env command.
	OutputFileFlagName = "output-file"
)
View Source
const (

	// ListFormatFlagName is the name of the format flag for list command.
	ListFormatFlagName = "format"
)
View Source
const (

	// OutputFlagName is the name of the output flag for whoami command.
	OutputFlagName = "output"
)

Variables

View Source
var SupportedFormats = []string{"json", "bash", "dotenv", "env", "github"}

SupportedFormats lists the supported output formats for env command. JSON is handled separately in the command, all other formats are delegated to pkg/env.

Functions

func AddIdentityCompletion

func AddIdentityCompletion(cmd *cobra.Command)

AddIdentityCompletion registers shell completion for the identity flag if present on the command.

func BuildConfigAndStacksInfo

func BuildConfigAndStacksInfo(cmd *cobra.Command, v *viper.Viper) schema.ConfigAndStacksInfo

BuildConfigAndStacksInfo parses global flags and builds ConfigAndStacksInfo. This ensures auth commands honor global flags like --base-path, --config, --config-path, and --profile. Wraps flags.BuildConfigAndStacksInfo for convenience.

func ComponentsArgCompletion

func ComponentsArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

ComponentsArgCompletion provides shell completion for component arguments. This delegates to the cmd package's ComponentsArgCompletion. Note: For auth commands, we use cobra.NoFileCompletions since auth doesn't deal with components.

func CreateAuthManager

func CreateAuthManager(authConfig *schema.AuthConfig, cliConfigPath string) (auth.AuthManager, error)

CreateAuthManager creates a new auth manager with all required dependencies. Exported for use by command packages (e.g., terraform package).

func GetAuthCmd

func GetAuthCmd() *cobra.Command

GetAuthCmd returns the auth command for subcommand registration.

func GetIdentityFromFlags

func GetIdentityFromFlags(cmd *cobra.Command) string

GetIdentityFromFlags retrieves the identity flag value, handling the NoOptDefVal quirk. The identity flag uses NoOptDefVal="__SELECT__" which causes Viper to always return "__SELECT__" after parsing, even when the flag wasn't provided. This function checks the actual flag state to return the correct value.

Returns:

  • Empty string if --identity was not provided (use config/env default).
  • IdentityFlagSelectValue if --identity was provided without a value (user wants selection).
  • The actual value if --identity=value was provided.

func IdentityArgCompletion

func IdentityArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

IdentityArgCompletion provides shell completion for identity positional arguments. It returns a list of available identities from the Atmos configuration.

Honors --base-path, --config, --config-path, and --profile from the current command context so completion sees the same atmos config the command would actually run against.

func ProviderArgCompletion

func ProviderArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

ProviderArgCompletion provides shell completion for provider positional arguments. It returns a list of available providers from the Atmos configuration.

Honors --base-path, --config, --config-path, and --profile from the current command context so completion sees the same atmos config the command would actually run against.

Types

type AuthCommandProvider

type AuthCommandProvider struct{}

AuthCommandProvider implements the CommandProvider interface.

func (*AuthCommandProvider) GetAliases

func (a *AuthCommandProvider) GetAliases() []internal.CommandAlias

GetAliases returns command aliases.

func (*AuthCommandProvider) GetCommand

func (a *AuthCommandProvider) GetCommand() *cobra.Command

GetCommand returns the auth command.

func (*AuthCommandProvider) GetCompatibilityFlags

func (a *AuthCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag

GetCompatibilityFlags returns compatibility flags for this command.

func (*AuthCommandProvider) GetFlagsBuilder

func (a *AuthCommandProvider) GetFlagsBuilder() flags.Builder

GetFlagsBuilder returns the flags builder for this command.

func (*AuthCommandProvider) GetGroup

func (a *AuthCommandProvider) GetGroup() string

GetGroup returns the command group for help organization.

func (*AuthCommandProvider) GetName

func (a *AuthCommandProvider) GetName() string

GetName returns the command name.

func (*AuthCommandProvider) GetPositionalArgsBuilder

func (a *AuthCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder

GetPositionalArgsBuilder returns the positional args builder for this command.

func (*AuthCommandProvider) IsExperimental

func (a *AuthCommandProvider) IsExperimental() bool

IsExperimental returns whether this command is experimental. Auth commands are currently experimental as part of Pro Features.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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