Documentation
¶
Overview ¶
Package providerauth contains provider-auth diagnostics shared by CLI and daemon settings surfaces.
Index ¶
- Constants
- func CommandEnv(homePaths compozyconfig.HomePaths, providerName string, ...) ([]string, error)
- func DiagnosticCommandEnv(homePaths compozyconfig.HomePaths, providerName string, ...) ([]string, error)
- func NativeCLICommand(provider compozyconfig.ProviderConfig) (string, string)
- func NativeCLILoginEnv(homePaths compozyconfig.HomePaths, providerName string, ...) ([]string, error)
- func NativeCLIMissingMessage(providerName string, nativeCLI *NativeCLIStatus) string
- type NativeCLIStatus
- type ParsedCommand
Constants ¶
const ( // NativeCLISourceAuthStatus reports that the probe binary came from auth_status_command. NativeCLISourceAuthStatus = "auth_status_command" // NativeCLISourceAuthLogin reports that the probe binary came from auth_login_command. NativeCLISourceAuthLogin = "auth_login_command" // NativeCLISourceCommand reports that the probe binary came from the provider launch command. NativeCLISourceCommand = "provider_command" )
Variables ¶
This section is empty.
Functions ¶
func CommandEnv ¶
func CommandEnv( homePaths compozyconfig.HomePaths, providerName string, provider compozyconfig.ProviderConfig, environ []string, ) ([]string, error)
CommandEnv returns the provider-auth command environment used by CLI probes and settings diagnostics.
func DiagnosticCommandEnv ¶
func DiagnosticCommandEnv( homePaths compozyconfig.HomePaths, providerName string, provider compozyconfig.ProviderConfig, environ []string, ) ([]string, error)
DiagnosticCommandEnv returns the provider auth environment without creating provider state.
func NativeCLICommand ¶
func NativeCLICommand(provider compozyconfig.ProviderConfig) (string, string)
NativeCLICommand returns the command string and source used for native CLI auth diagnostics.
func NativeCLILoginEnv ¶
func NativeCLILoginEnv( homePaths compozyconfig.HomePaths, providerName string, provider compozyconfig.ProviderConfig, _ []string, ) ([]string, error)
NativeCLILoginEnv returns only the env assignments operators need for native CLI login commands.
func NativeCLIMissingMessage ¶
func NativeCLIMissingMessage( providerName string, nativeCLI *NativeCLIStatus, ) string
NativeCLIMissingMessage explains how to recover when the configured native CLI is unavailable.
Types ¶
type NativeCLIStatus ¶
type NativeCLIStatus struct {
Command string `json:"command,omitempty"`
Present bool `json:"present"`
Path string `json:"path,omitempty"`
Source string `json:"source,omitempty"`
Error string `json:"error,omitempty"`
}
NativeCLIStatus reports whether the provider-owned CLI binary is available.
func NativeCLIStatusForCommand ¶
func NativeCLIStatusForCommand( command string, source string, lookPath func(string) (string, error), ) (*NativeCLIStatus, error)
NativeCLIStatusForCommand resolves the first argv token in a provider-owned CLI command.
func NativeCLIStatusForProvider ¶
func NativeCLIStatusForProvider( provider compozyconfig.ProviderConfig, lookPath func(string) (string, error), ) (*NativeCLIStatus, error)
NativeCLIStatusForProvider resolves the native CLI command used for auth diagnostics.
type ParsedCommand ¶
ParsedCommand separates private leading environment assignments from the executable and arguments.
func ParseCommand ¶
func ParseCommand(command string) (ParsedCommand, error)
ParseCommand parses one shell-style provider auth command without executing a shell.
func (ParsedCommand) ApplyEnvironment ¶
func (p ParsedCommand) ApplyEnvironment(base []string) []string
ApplyEnvironment returns base with this command's leading assignments applied in order.