Help us shape the future of Go! Take the 2026 Go Developer Survey

modelauth

package
v0.13.13 Latest Latest
Warning

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

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

Documentation

Overview

Package modelauth owns encrypted run credentials, never user login state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedactKnownSecret added in v0.11.2

func RedactKnownSecret(value, secret string) string

RedactKnownSecret masks a known credential in both its literal and JSON-escaped forms.

func Validate

func Validate(provider string, c sdk.ModelCredential) error

func ValidateModel

func ValidateModel(model *sdk.RunModel) error

Types

type AuthenticationError

type AuthenticationError struct{ Provider, ConnectionID, Reason string }

func (*AuthenticationError) Error

func (e *AuthenticationError) Error() string

type Callback

type Callback struct {
	URL   string
	Token string
}

type Manager

type Manager struct {
	Store          agentcore.ModelCredentialStore
	Key            []byte
	ChatGPTEnabled bool
	Callbacks      map[string]Callback
	HTTPClient     *http.Client
}

func (*Manager) Prepare

func (m *Manager) Prepare(appID, runID, provider string, c sdk.ModelCredential) (*agentcore.RunModelCredential, error)

func (*Manager) RedactReviewContext added in v0.11.2

func (m *Manager) RedactReviewContext(ctx context.Context, appID, runID, value string) (string, error)

RedactReviewContext masks locally known run credentials without refreshing tokens or exposing them to the caller. Failure makes external review unsafe.

func (*Manager) Replace

func (m *Manager) Replace(ctx context.Context, appID, runID string, c sdk.ModelCredential) error

func (*Manager) Transport

func (m *Manager) Transport(base http.RoundTripper, run *agentcore.AgentRun, provider string) http.RoundTripper

Transport resolves the current credential for every request, including summaries. It retries only an HTTP authentication rejection before a response stream starts.

Jump to

Keyboard shortcuts

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