auth

package
v0.14.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: 13 Imported by: 0

Documentation

Overview

Package auth provides the provider-specific AWS Signature Version 4 (SigV4) Authenticator for the inference client seam. The generic Key/Header/None auth helpers live in inference/auth; only provider request-signing schemes belong here. It imports inference for the Authenticator interface; inference never imports this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SigV4

func SigV4(creds SigV4Credentials, region, service string) inferauth.Authenticator

SigV4 returns an Authenticator that signs requests with AWS Signature Version 4 for the given region and service (e.g. region "us-east-1", service "bedrock"). The signature is computed at sign time from the current UTC clock. Empty AccessKeyID/SecretAccessKey make Authorize fail closed with *MissingSigV4CredentialsError.

Types

type BodyReadError

type BodyReadError struct {
	Err error
}

BodyReadError is returned when the request body cannot be read to compute the payload hash. Fail-closed: the request is not signed. Err is the underlying I/O cause.

func (*BodyReadError) Error

func (e *BodyReadError) Error() string

func (*BodyReadError) Unwrap

func (e *BodyReadError) Unwrap() error

type MissingSigV4CredentialsError

type MissingSigV4CredentialsError struct {
	Region  string
	Service string
}

MissingSigV4CredentialsError is returned by a SigV4 Authenticator when the AccessKeyID or SecretAccessKey is empty. Fail-closed: the request is neither signed nor mutated. Carries only the non-secret region/service for diagnostics.

func (*MissingSigV4CredentialsError) Error

type SigV4Credentials

type SigV4Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

SigV4Credentials is an AWS credential set for the Bedrock signer. Its String/LogValue/GoString methods redact the secret and session token so they never leak through any format verb or structured log.

func (SigV4Credentials) GoString

func (SigV4Credentials) GoString() string

GoString redacts the credential under the %#v verb (fmt.GoStringer), so even Go-syntax debug formatting never exposes the secret/session values.

func (SigV4Credentials) LogValue

func (SigV4Credentials) LogValue() slog.Value

LogValue redacts the credential for slog structured logging.

func (SigV4Credentials) String

func (SigV4Credentials) String() string

String redacts the credential so %v, %+v, and %s never expose the secret or session token.

Jump to

Keyboard shortcuts

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