auth

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 59 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"
	// LoginFlagName is the name of the login flag for env command.
	LoginFlagName = "login"
	// FormatCredentialProcess is the format that prints AWS credential_process JSON instead of
	// environment variables. It is an alias for `atmos aws credential-process`.
	FormatCredentialProcess = "credential-process"
)
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", FormatCredentialProcess}

SupportedFormats lists the supported output formats for env command. JSON and credential-process are 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). Delegates to the package-level auth.NewDefaultManager so the construction logic lives in one place.

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. The Auth command and configuration interface is stable.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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