secret

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 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 secret resolves secret:// references at mount time without placing credential values in topology, Graph IR, diagrams, or evidence artifacts.

Index

Constants

View Source
const (
	APIVersion = "openrealtime.ai/secrets/v1alpha1"
)

Variables

This section is empty.

Functions

func MarshalJSON

func MarshalJSON(document Document) ([]byte, error)

func MarshalYAML

func MarshalYAML(document Document) ([]byte, error)

func Validate

func Validate(document Document) error

Validate checks a programmatically constructed document without resolving or reading any secret. ParseJSON and ParseYAML already perform this check.

func ValidateReference

func ValidateReference(reference string) error

Types

type Binding

type Binding struct {
	Provider string `json:"provider" yaml:"provider"`
	Locator  string `json:"locator" yaml:"locator"`
}

Binding identifies a provider and provider-specific non-secret locator. There is intentionally no inline/value/data field.

type Document

type Document struct {
	APIVersion string             `json:"apiVersion" yaml:"apiVersion"`
	Catalog    string             `json:"catalog" yaml:"catalog"`
	Secrets    map[string]Binding `json:"secrets,omitempty" yaml:"secrets,omitempty"`
}

func ParseJSON

func ParseJSON(path string, source []byte) (Document, error)

func ParseYAML

func ParseYAML(path string, source []byte) (Document, error)

type EnvironmentProvider

type EnvironmentProvider struct {
	Lookup func(string) (string, bool)
}

EnvironmentProvider is opt-in. It receives an injected lookup function so tests and embedders need not mutate process-global environment state.

func (EnvironmentProvider) Resolve

func (provider EnvironmentProvider) Resolve(ctx context.Context, locator string) ([]byte, error)

type Provider

type Provider interface {
	Resolve(context.Context, string) ([]byte, error)
}

Provider returns newly allocated secret bytes owned by the caller. It must honor cancellation and must not cache values past its own documented lifecycle. Providers can wrap an environment, file-descriptor broker, operating-system keychain, KMS, or remote secret manager.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is mutable deployment assembly state. NewStore snapshots every selected registration so later registration cannot change a mounted graph.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Register

func (registry *Registry) Register(
	name string, artifact inspect.ArtifactIdentity, provider Provider,
) error

type Resolution

type Resolution struct {
	Reference       string                   `json:"reference"`
	BindingDigest   string                   `json:"binding_digest"`
	Provider        string                   `json:"provider"`
	ProviderRuntime inspect.ArtifactIdentity `json:"provider_runtime"`
}

Resolution is safe management-plane evidence: it proves which catalog binding and provider implementation were selected, without exposing the locator or a digest of potentially low-entropy secret bytes.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an immutable catalog of provider selections. Fingerprint covers references and non-secret provider locators, never the resolved values.

func NewStore

func NewStore(document Document, registry *Registry) (*Store, error)

func (*Store) Identity

func (store *Store) Identity() inspect.ArtifactIdentity

func (*Store) Resolve

func (store *Store) Resolve(ctx context.Context, reference string) (*Value, Resolution, error)

Resolve obtains one fresh value. The returned handle must be closed. A provider error is wrapped without adding the locator to the message.

type Value

type Value struct {
	// contains filtered or unexported fields
}

Value owns an erasable secret buffer. Bytes returns a caller-owned copy; callers are responsible for minimizing and erasing any copies they retain.

func (*Value) Bytes

func (value *Value) Bytes() ([]byte, error)

func (*Value) Close

func (value *Value) Close() error

Jump to

Keyboard shortcuts

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