secrets

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package secrets manages encrypted secrets using SOPS and age encryption.

It provides utilities for resolving secret file paths by environment and integrating encrypted secrets with Terraform variables.

Index

Constants

View Source
const AgePublicKey = "age1mcl448l48v0e4t5ljek8htn5s07amz5zwr54hkq5qpawgapc9dpstnhksq"

AgePublicKey is the public key for encrypting SOPS files.

Variables

View Source
var FilePath = filepath.Join("resources", "secrets")

FilePath defines the path where SOPS encrypted YAML files reside in the Webkit app. Needs a base path prepended.

Functions

func FilePathFromEnv

func FilePathFromEnv(e env.Environment) string

FilePathFromEnv returns a filepath based off the environment.

For example, resources/secrets/{production}.yaml

func Resolve

func Resolve(ctx context.Context, def *appdef.Definition, cfg ResolveConfig) error

func ResolveForEnvironment added in v0.0.25

func ResolveForEnvironment(ctx context.Context, def *appdef.Definition, targetEnv env.Environment, cfg ResolveConfig) error

ResolveForEnvironment resolves variables for a specific environment only. This is more efficient when you only need one environment (e.g., env generation).

Types

type OutputKey added in v0.0.25

type OutputKey struct {
	Environment  env.Environment
	ResourceName string
	OutputName   string
}

OutputKey uniquely identifies a Terraform output value.

type ResolveConfig

type ResolveConfig struct {
	SOPSClient      sops.EncrypterDecrypter
	BaseDir         string
	TerraformOutput *TerraformOutputProvider
}

ResolveConfig defines the data needed in order to decrypt the definitions environments secrets.

type TerraformOutputProvider added in v0.0.25

type TerraformOutputProvider map[OutputKey]any

TerraformOutputProvider provides access to Terraform outputs for resource resolution.

func TransformOutputs added in v0.0.30

func TransformOutputs(result infra.OutputResult, environment env.Environment) TerraformOutputProvider

TransformOutputs converts an OutputResult from Terraform into a TerraformOutputProvider that can be used for secret resolution.

This function extracts resource outputs and creates OutputKeys for each environment/resource/output combination.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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