secret

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package secret is the function-facing secret service (ADR-0249): it answers the local API's /secret routes with the keys and values of the Secrets a Function binds, on every read and with no cache, each Secret asked secret::read as the calling Function (ADR-0321), and the readiness check's question for each of them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Store    store.Store
	Resolver Resolver
}

Deps carries what the Facade needs.

type Facade

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

Facade implements local.Secrets.

func NewFacade

func NewFacade(d Deps) (*Facade, error)

NewFacade builds the Facade; both deps are required.

func (*Facade) CheckRead added in v0.42.0

func (f *Facade) CheckRead(ctx context.Context, ns v1.NamespaceName, fn v1.ObjectName, name string) error

CheckRead answers the readiness check for Secret name, which fn binds (ADR-0321 Decision 4): may fn read it.

func (*Facade) Get

func (f *Facade) Get(ctx context.Context, ns v1.NamespaceName, fn v1.ObjectName, key string) (string, bool, error)

Get returns key's value among the Secrets fn binds, or found false when none holds it.

func (*Facade) List

func (f *Facade) List(ctx context.Context, ns v1.NamespaceName, fn v1.ObjectName) ([]string, error)

List returns the sorted keys of the Secrets fn binds, an empty list when none (never nil, so the route answers {"keys": []}).

type Resolver

type Resolver interface {
	ResolveEnv(ctx context.Context, id auth.Identity, ns v1.NamespaceName, names []string) (map[string]string, error)
	CheckRead(ctx context.Context, id auth.Identity, ns v1.NamespaceName, name string) error
}

Resolver resolves Secret names into one key-value map for id (ADR-0057); *secrets.Resolver satisfies it.

Jump to

Keyboard shortcuts

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