secrets

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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