secret

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package secret serves the cluster's secret store over RPC.

It is the only path by which a value enters or leaves the store. Storing and resolving both happen here, where the keyring lives, so a client never holds key material — and a node that holds none can still materialize a secret by asking for it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyRotator

type KeyRotator interface {
	// Begin starts a rotation now, failing if one is already in flight.
	Begin(ctx context.Context) error
}

KeyRotator starts and reports on cluster-key rotations. The server holds it as an interface so the secrets service does not depend on the controller package, and so a cluster without rotation wired up simply has none.

type Server

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

Server implements the secret_v1alpha.Secrets RPC interface over a backend registry.

func NewServer

func NewServer(log *slog.Logger, registry *secret.Registry, rotator KeyRotator) *Server

NewServer builds the secrets RPC server.

func (*Server) Keyring

func (s *Server) Keyring(ctx context.Context, state *secret_v1alpha.SecretsKeyring) error

Keyring reports the cluster keyring and any rotation in flight.

This is the only view an operator has of rotation. Without it a stalled backfill and a finished one look identical, and there is no way to tell whether retiring the old key is safe yet.

func (*Server) List

func (s *Server) List(ctx context.Context, state *secret_v1alpha.SecretsList) error

List returns every secret a backend holds, without their values.

func (*Server) ListVersions

func (s *Server) ListVersions(ctx context.Context, state *secret_v1alpha.SecretsListVersions) error

ListVersions returns one secret's versions, without their values.

func (*Server) Resolve

func (s *Server) Resolve(ctx context.Context, state *secret_v1alpha.SecretsResolve) error

Resolve returns a reference's value, for a caller that cannot decrypt it itself.

A distributed runner holds no key material, so this is how a sandbox on one materializes its secrets: the bytes are decrypted here, where the keyring lives, and travel to the runner, which holds them only long enough to hand them to a container.

Access control comes from the RPC layer, not from here: the method is not marked Public, so the server rejects it before dispatch unless the caller presented an identity it authenticated (mTLS or OIDC — see the non-public branch in pkg/rpc.Server). Naming that explicitly because this is the one place plaintext leaves the coordinator, and the guarantee is otherwise invisible at the call site.

What that does *not* yet give us is per-secret scoping — any authenticated caller can resolve any reference. RFD-90 leaves that open ("Per-secret access scoping"), and it wants deciding before secrets carry anything an operator would not hand every workload in the cluster.

It is deliberately not logged at Info. Unlike a write or a revocation, a resolve happens on every sandbox start, so recording each one would drown the audit tier it sits in without telling an operator anything they did not already know from the deploy.

func (*Server) RotateKey

func (s *Server) RotateKey(ctx context.Context, state *secret_v1alpha.SecretsRotateKey) error

RotateKey starts a rotation now.

func (*Server) Set

func (s *Server) Set(ctx context.Context, state *secret_v1alpha.SecretsSet) error

Set stores a new version of a secret and returns its handle.

A value identical to the current version reports back as unchanged rather than minting a duplicate, so re-running the same command does not invalidate every pin.

func (*Server) SetState

func (s *Server) SetState(ctx context.Context, state *secret_v1alpha.SecretsSetState) error

SetState transitions one version between enabled, disabled and destroyed.

Jump to

Keyboard shortcuts

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