providerauth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package providerauth is the Sahara OSS credential broker. It owns local credential profiles and login UX while delegating provider protocol details to go-llm.

Index

Constants

View Source
const (
	KindOpenAISubscription = "openai_subscription"
	DefaultProfile         = "personal"
)

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir() (string, error)

Types

type Broker

type Broker struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Broker, error)

func (*Broker) Authenticator

func (b *Broker) Authenticator(kind, profile string) (llmclient.Authenticator, error)

func (*Broker) OpenAI

func (b *Broker) OpenAI(profile string) (*openaiauth.Manager, error)

func (*Broker) RunCLI

func (b *Broker) RunCLI(ctx context.Context, args []string, output io.Writer) error

RunCLI implements `agent-harness auth login|status|logout`. Device login is the default because it works in local, SSH, container, and headless sessions.

type Config

type Config struct {
	Store      llmauth.Store
	Dir        string
	IssuerURL  string
	ClientID   string
	Originator string
}

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

FileStore is Sahara OSS's portable credential store. Files and their parent directory are private to the current user, and replacement is atomic. A host distribution can supply a different llmauth.Store (for example an OS keyring) without changing provider code.

func NewFileStore

func NewFileStore(dir string) (*FileStore, error)

func (*FileStore) Delete

func (s *FileStore) Delete(_ context.Context, profile string) error

func (*FileStore) Load

func (s *FileStore) Load(_ context.Context, profile string) (llmauth.Credential, error)

func (*FileStore) Save

func (s *FileStore) Save(_ context.Context, profile string, credential llmauth.Credential) error

Jump to

Keyboard shortcuts

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