Documentation
¶
Overview ¶
Package auth provides authentication checking for AI model providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyDetails ¶ added in v0.0.17
type APIKeyDetails struct {
EnvVar string // Environment variable name
IsSet bool // Whether the env var is set
IsValid bool // Whether the value matches required pattern
Source string // Where credentials come from (e.g., "env")
}
APIKeyDetails contains API key authentication details.
type Checker ¶
type Checker struct {
}
Checker checks authentication status for providers.
func (*Checker) CheckProvider ¶
CheckProvider checks authentication status for a provider. Performs local checks only - no network calls are made.
Returns a Status with type-safe details:
- Status.GoogleCloud for Google Cloud providers
- Status.APIKey for API key providers
type GCloudStatus ¶
type GCloudStatus struct {
Authenticated bool
Project string
Location string
HasVertexProvider bool
}
GCloudStatus represents Google Cloud authentication status. Deprecated: Use GoogleCloudDetails instead.
type State ¶
type State int
State represents the authentication state of a provider.
const ( // StateConfigured means the provider has credentials configured. StateConfigured State = iota // StateMissing means required credentials are missing. StateMissing // StateInvalid means credentials are found but malformed or invalid. StateInvalid // StateOptional means the provider has optional or no auth requirements. StateOptional // StateUnsupported means the provider has no client implementation. StateUnsupported )
type Status ¶
type Status struct {
State State
Summary string // Brief one-line summary
APIKey *APIKeyDetails // For API key providers (nil if not applicable)
GoogleCloud interface{} // For Google Cloud providers (*adc.Details, nil if not applicable)
}
Status represents authentication status with type-safe details.
GoogleCloud field contains *adc.Details (from internal/auth/adc package). It's defined as interface{} to avoid import cycles, but callers can safely type assert to *adc.Details when needed.