credentials

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvKey

func EnvKey(ref string) string

EnvKey normalizes refs like "env:OPENAI_API_KEY" to "OPENAI_API_KEY".

func WithSecrets added in v0.1.1

func WithSecrets(ctx context.Context, secrets map[string]string) context.Context

WithSecrets returns a ctx whose refs resolve from secrets before a Store's default backend (for example environment variables).

Types

type Secret

type Secret struct {
	Value string
	Ref   string
}

func SecretFromContext added in v0.1.1

func SecretFromContext(ctx context.Context, ref string) (Secret, bool)

SecretFromContext returns a secret when ctx carries an override for ref.

type Store

type Store interface {
	Resolve(context.Context, string) (Secret, error)
}

Jump to

Keyboard shortcuts

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