providerauth

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package providerauth contains provider-auth diagnostics shared by CLI and daemon settings surfaces.

Index

Constants

View Source
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

func NativeCLILoginCommandMessage(providerName string, operatorCommand string) string

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.

func OperatorLoginCommand

func OperatorLoginCommand(command string, loginEnv []string) (string, error)

OperatorLoginCommand prefixes a native login command with required env assignments.

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.

Jump to

Keyboard shortcuts

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