auth

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

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 NewChecker

func NewChecker() *Checker

NewChecker creates a new authentication checker.

func (*Checker) CheckProvider

func (c *Checker) CheckProvider(provider *catalogs.Provider, supportedMap map[string]bool) *Status

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.

Directories

Path Synopsis
Package adc handles Google Application Default Credentials.
Package adc handles Google Application Default Credentials.

Jump to

Keyboard shortcuts

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