Documentation
¶
Overview ¶
Package providerauth contains provider-auth diagnostics shared by CLI and daemon settings surfaces.
Index ¶
- Constants
- func CommandEnv(homePaths aghconfig.HomePaths, providerName string, ...) ([]string, error)
- func NativeCLIAuthProblemMessage(provider aghconfig.ProviderConfig) string
- func NativeCLICommand(provider aghconfig.ProviderConfig) (string, string)
- func NativeCLILoginCommandMessage(providerName string, operatorCommand string) string
- func NativeCLILoginEnv(homePaths aghconfig.HomePaths, providerName string, ...) ([]string, error)
- func NativeCLIMissingMessage(providerName string, provider aghconfig.ProviderConfig, ...) string
- func NativeCLIReadyMessage(providerName string, provider aghconfig.ProviderConfig, ...) string
- func OperatorLoginCommand(command string, loginEnv []string) (string, error)
- type NativeCLIStatus
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 aghconfig.HomePaths, providerName string, provider aghconfig.ProviderConfig, environ []string, ) ([]string, error)
CommandEnv returns the provider-auth command environment used by CLI probes and settings diagnostics.
func NativeCLIAuthProblemMessage ¶
func NativeCLIAuthProblemMessage(provider aghconfig.ProviderConfig) string
NativeCLIAuthProblemMessage explains how to recover from a failed native auth status probe.
func NativeCLICommand ¶
func NativeCLICommand(provider aghconfig.ProviderConfig) (string, string)
NativeCLICommand returns the command string and source used for native CLI auth diagnostics.
func NativeCLILoginCommandMessage ¶
NativeCLILoginCommandMessage explains that AGH prints native login commands instead of running them.
func NativeCLILoginEnv ¶
func NativeCLILoginEnv( homePaths aghconfig.HomePaths, providerName string, provider aghconfig.ProviderConfig, _ []string, ) ([]string, error)
NativeCLILoginEnv returns only the env assignments operators need for native CLI login commands.
func NativeCLIMissingMessage ¶
func NativeCLIMissingMessage( providerName string, provider aghconfig.ProviderConfig, nativeCLI *NativeCLIStatus, ) string
NativeCLIMissingMessage explains how to recover when the configured native CLI is unavailable.
func NativeCLIReadyMessage ¶
func NativeCLIReadyMessage( providerName string, provider aghconfig.ProviderConfig, nativeCLI *NativeCLIStatus, ) string
NativeCLIReadyMessage explains the provider-owned login boundary when the CLI is present.
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 aghconfig.ProviderConfig, lookPath func(string) (string, error), ) (*NativeCLIStatus, error)
NativeCLIStatusForProvider resolves the native CLI command used for auth diagnostics.