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 {
// contains filtered or unexported fields
}
Checker checks authentication status for providers.
func NewChecker ¶
func NewChecker(options ...CheckerOption) *Checker
NewChecker creates a new authentication checker.
func (*Checker) CheckProvider ¶
CheckProvider checks authentication status for a provider. Performs local checks only - no network calls are made.
Resolver selection uses catalog authentication metadata. Endpoint protocols do not select credentials.
type CheckerOption ¶ added in v0.3.0
type CheckerOption func(*Checker)
CheckerOption configures a Checker.
func WithCredentialResolver ¶ added in v0.3.0
func WithCredentialResolver( method catalogs.ProviderCatalogAuthMethod, resolver CredentialResolver, ) CheckerOption
WithCredentialResolver registers or replaces a credential resolver.
type CredentialChainDetails ¶ added in v0.3.0
type CredentialChainDetails struct {
Method catalogs.ProviderCatalogAuthMethod
Source string
Details any
}
CredentialChainDetails describes which catalog-acquisition chain was selected. Details can contain provider-specific inspection data but never a credential value.
type CredentialResolver ¶ added in v0.3.0
CredentialResolver checks one catalog-acquisition credential method.
type CredentialResolverFunc ¶ added in v0.3.0
CredentialResolverFunc adapts a function to CredentialResolver.
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 // API key details, when applicable
CredentialChain *CredentialChainDetails // Cloud credential-chain details, when applicable
}
Status represents catalog-acquisition authentication status.