secrets

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 36 Imported by: ? 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 emulates Secret Manager (secretmanager.googleapis.com v1) over gRPC and REST on the gateway: global and regional secrets, versions and their payloads, version aliases, expiry, delayed version destruction, rotation notifications to Pub/Sub topics, managed rotation of Cloud SQL credentials, and secret IAM policies. Time-driven behaviour follows the Emulator clock (lifecycle.go). Replication policies and customer-managed encryption are Recorded.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(env *emu.Env) emu.Service

New returns the service.

Types

type Service

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

Service is the secrets service module.

func (*Service) AccessSecretVersion

func (s *Service) AccessSecretVersion(ctx context.Context, name string) ([]byte, string, error)

AccessSecretVersion implements emu.SecretAccessor.

func (*Service) ApplySeed

func (s *Service) ApplySeed(ctx context.Context, section *yaml.Node, baseDir string) error

ApplySeed creates the seeded secrets (or updates their labels) and adds their missing versions. It is idempotent.

func (*Service) ClockAdvanced

func (s *Service) ClockAdvanced(ctx context.Context) error

ClockAdvanced applies what became due before returning.

func (*Service) EnvVars

func (s *Service) EnvVars(gw string, endpoints map[string]string) map[string]string

EnvVars implements emu.EnvVarer (FR-CORE-004): the gcloud endpoint override for `gcloud secrets`.

func (*Service) ExportSeed added in v0.6.0

func (s *Service) ExportSeed(ctx context.Context) (any, error)

ExportSeed implements emu.SeedExporter: every secret with its replication, labels and versions in order, payloads inline. Version aliases, annotations, topics, rotation, expiry, CMEK, destroy TTLs and pending scheduled destructions have no seed form and are not exported.

func (*Service) Name

func (s *Service) Name() string

func (*Service) Ready

func (s *Service) Ready() error

func (*Service) Register

func (s *Service) Register(r emu.Router) error

Register installs the gRPC service and the REST surface, on the global and every regional hostname.

func (*Service) Reset added in v0.9.0

func (s *Service) Reset(ctx context.Context) error

Reset stops a sweep in flight, waiting for it (bounded by ctx), so none of its changes, notifications or rotations from the state before the Reset lands after it (#307); the store is reset by the instance, and the sweep runs again from ResetDone.

func (*Service) ResetDone added in v0.9.0

func (s *Service) ResetDone()

ResetDone runs the sweep again once the store is reset too.

func (*Service) ResourceCounts

func (s *Service) ResourceCounts() map[string]int

ResourceCounts implements emu.ResourceCounter.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start runs the sweep of time-driven changes, the first one at once.

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) error

Stop stops the sweep.

Jump to

Keyboard shortcuts

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