secrets

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package secrets resolves an api_key_ref (e.g. "env:BRAINJAR_API_KEY") to the plaintext bearer token a RemoteBackend sends on every request.

The env-var resolver is the only implementation that ships today. File-backed and OS-keyring resolvers can land later without pulling transitive dependencies into internal/backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvResolver

type EnvResolver struct{}

EnvResolver resolves refs of the form "env:NAME" by reading the named environment variable. Any other scheme (or a missing/empty env var) is surfaced as a structured error so the CLI can render it alongside every other apperror.

func (EnvResolver) Resolve

func (EnvResolver) Resolve(_ context.Context, ref string) (string, error)

Resolve implements Resolver.

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, ref string) (string, error)
}

Resolver maps an api_key_ref to the plaintext bearer token. The ref scheme is part of the contract so resolvers can refuse refs they don't understand with a BadRequest instead of silently falling back.

Jump to

Keyboard shortcuts

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