auth

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package auth provides the legacy inference authorization facade. New credential-backed callers should use credentials/httpauth directly; the constructors here remain source-compatible wrappers for static API keys and explicit unauthenticated requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey string

APIKey is a bearer/API-key secret. A named type prevents a base URL from being passed where a key belongs, and keeps the old provider constructor API.

type AuthKind

type AuthKind string

AuthKind classifies the credential an authentication mechanism requires.

const (
	AuthNone   AuthKind = "none"
	AuthAPIKey AuthKind = "api_key"
)

type Authenticator

type Authenticator = httpauth.Authorizer

Authenticator is retained as the source-compatible name for Authorizer. New code should prefer Authorizer or credentials/httpauth.Authorizer when it supplies a fresh lease for a concrete request attempt.

func Header(k APIKey, name string) Authenticator

Header returns an Authorizer that sets an arbitrary header (for example "x-api-key") to the key value.

func Key

func Key(k APIKey) Authenticator

Key returns an Authorizer that sets "Authorization: Bearer <k>".

func None

func None() Authenticator

None returns an explicit no-credentials authorizer. Unlike a nil authorizer, it is safe to pass through the legacy transport path.

type Authorizer

type Authorizer = httpauth.Authorizer

Authorizer is the call-scoped HTTP authorization seam. It is an alias rather than a new interface so a credentials lease can be passed directly to inference transports.

type MissingCredentialsError

type MissingCredentialsError struct {
	Credential string
}

MissingCredentialsError reports a required credential that was not supplied.

func (*MissingCredentialsError) Error

func (e *MissingCredentialsError) Error() string

func (*MissingCredentialsError) Format

func (e *MissingCredentialsError) Format(state fmt.State, _ rune)

func (*MissingCredentialsError) GoString

func (e *MissingCredentialsError) GoString() string

func (*MissingCredentialsError) LogValue

func (e *MissingCredentialsError) LogValue() slog.Value

Jump to

Keyboard shortcuts

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