config

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package config parses flags and environment strictly and fail-fast (system-architecture ADR § Tooling defaults): unknown HIKYO_* keys warn, missing prod-critical keys refuse to start, nothing silently conjures a database.

Index

Constants

View Source
const (
	// DefaultKeysPerProject preserves the original small-installation default.
	DefaultKeysPerProject = 1000
	// DefaultMaxKeysPerProject bounds project overrides unless the operator
	// selects a lower instance ceiling.
	DefaultMaxKeysPerProject = 10_000
	// MaxKeysPerProjectCeiling matches the definitions bundle and per-environment
	// validation budgets. Raising this requires a separate capacity review.
	MaxKeysPerProjectCeiling = 10_000
)
View Source
const (
	TLSProfileCompat = "compat"
	TLSProfileStrict = "strict"
)

TLS profile names. tlspolicy.Profile owns the semantics; a test pins equality.

View Source
const (
	DefaultBackupInterval    = 24 * time.Hour
	MinBackupInterval        = time.Hour
	DefaultBackupRPO         = 26 * time.Hour
	DefaultBackupRetainCount = 7
	// MaxBackupRetainCount is a loud sanity ceiling: a retain count is a small
	// operational number, and bounding it keeps the uint-to-int conversion
	// below safe on every platform.
	MaxBackupRetainCount    = 100_000
	DefaultBackupRetainDays = 180
	MaxBackupRetainDays     = 180
	DefaultBackupRTOTarget  = 30 * time.Minute
)

Backup schedule bounds (#145). The retention ceiling is ops-spec section 2: 180 days, no unlimited option, because the key hierarchy travels in every archive and an immortal backup is an immortal ciphertext archive.

View Source
const ManagedBootstrapSourcesKey = "HIKYO_BOOTSTRAP_SOURCES"
View Source
const ManagedNewRootSourceKey = "HIKYO_NEW_ROOT_SOURCE"
View Source
const ManagedNodeOverridesKey = "HIKYO_NODE_OVERRIDES"
View Source
const MaxManagedNodeValueBytes = 65536
View Source
const RemoteApplyDisabledReason = "" /* 166-byte string literal not displayed */

Remote apply is retired at configuration admission as well as runtime. Keep the shared refusal vocabulary here: config is a leaf package.

View Source
const TLSProfileKey = "HIKYO_TLS_PROFILE"

TLSProfileKey is the managed owner key that carries the profile.

Variables

View Source
var ErrRemoteApplyDisabled = errors.New(RemoteApplyDisabledReason)

Functions

func EffectiveDefaultKeysPerProject

func EffectiveDefaultKeysPerProject(limit int) int

func EffectiveMaxKeysPerProject

func EffectiveMaxKeysPerProject(limit int) int

EffectiveMaxKeysPerProject supplies the documented default for configurations constructed directly by embedded callers. Parsed settings are always nonzero.

func EmitHSTS

func EmitHSTS(externalOrigin string) bool

EmitHSTS reports whether responses should carry Strict-Transport-Security.

The gate is the CONFIGURED PUBLIC ORIGIN'S SCHEME, not the presence of a native certificate (#517). HSTS is a statement about how the browser reached this instance, and a reverse proxy terminating TLS in front of a plaintext listener is https to the browser in exactly the way native TLS is. The old certificate-presence gate silently withheld the header from every proxy deployment, which is the majority shape. The origin is operator configuration validated at load time, never a request header, so it cannot be talked into the header by a client.

Loopback still never promises: `Strict-Transport-Security` is stored per browser-visible HOST, so pinning `localhost` to https would break every other plaintext development server on the machine for one year. The bind address cannot answer that question: a supported same-host proxy uses a loopback bind for a non-loopback public origin.

func EncodeManagedNodeOverrides

func EncodeManagedNodeOverrides(nodes map[string]map[string]string) (string, error)

EncodeManagedNodeOverrides produces deterministic JSON from complete node projections. Validation uses the same closed parser as published candidates.

func IsLoopbackListen

func IsLoopbackListen(listen string) bool

IsLoopbackListen reports whether a configured TCP listen address is local-only.

func ManagedNodeKeys

func ManagedNodeKeys() []string

ManagedNodeKeys returns the closed ordinary-node setting allowlist. Bootstrap primary roots, databases and deployment identity are excluded. Development switches require the actual node to already run in development mode.

func ManagedOwnerKeys

func ManagedOwnerKeys() []string

ManagedOwnerKeys returns the application settings shared by one logical owner. Bootstrap and node settings require separate activation plans.

func ParseManagedNodeOverrides

func ParseManagedNodeOverrides(raw string) (map[string]map[string]string, error)

ParseManagedNodeOverrides decodes the only supported node document format. Every supplied value is a string; JSON null is never an empty-string alias. Duplicate fields, unknown outer fields and unknown node settings are refused.

func ValidManagedNodeID

func ValidManagedNodeID(id string) bool

ValidManagedNodeID accepts stable node names without patterns, whitespace, traversal syntax or control characters. Membership is a separate service-owned check against the exact admitted HA participant set.

func ValidateManagedNodeValues

func ValidateManagedNodeValues(values map[string]string) error

ValidateManagedNodeValues checks content and scalar syntax without assuming a deployment's database engine or development mode. Actual node admission must use ApplyManagedOwnerAndNodeValues with the real bootstrap context.

func ValidateManagedOwnerValues

func ValidateManagedOwnerValues(values map[string]string) error

ValidateManagedOwnerValues checks syntax and cross-owner dependencies without claiming a node can activate the configuration. Listener trust, development origin permission and backup destination checks require ApplyManagedOwnerValues with the actual node. Cryptographic policy and capacity checks belong to their owning runtime components; config remains a parsing-only leaf package.

func ValidatePostgresDSN

func ValidatePostgresDSN(raw string) error

ValidatePostgresDSN applies the exact syntax, explicit-host, and TLS policy used by startup. Rollout source proofs call this before attempting a connection so a descriptor cannot be approved if the replacement process would refuse it as HIKYO_DB.

Types

type Config

type Config struct {
	// ManagedInputs are unvalidated one-time seed inputs. The owning service
	// consults them only after the database confirms no managed binding exists.
	// In particular, stale file paths must never be read after adoption.
	ManagedInputs     map[string]string
	ManagedNodeInputs map[string]string
	Upgrade           UpgradeConfiguration
	// Applied upgrade selection is external bootstrap metadata, never user paths.
	UpgradeSource         string
	UpgradeMaterialDigest string
	Dev                   bool
	Listen                string
	OperationalListen     string
	// CLISocket is an optional same-user Unix socket for credential-bearing
	// local CLI traffic. It is bootstrap-only and never a managed runtime path.
	CLISocket string
	// SecurityMaintenanceStatusFile is an optional public file the separate
	// maintenance coordinator writes. The server only reads it.
	SecurityMaintenanceStatusFile string
	TLSCertFile                   string
	TLSKeyFile                    string
	ConfigRolloutEnrollment       string
	ConfigRolloutSigningKey       string
	// TLS PEM contents are consumed only after managed node activation. Runtime
	// callers must never reopen the original bootstrap file paths.
	TLSCertPEM        string
	TLSKeyPEM         string
	TrustedProxyCIDRs []string
	AutoMigrate       bool
	Store             Datastore

	// DirectoryProxy is the OPTIONAL forward proxy the outbound directory
	// client tunnels through, from HIKYO_DIRECTORY_PROXY. Empty is the default
	// and means direct egress.
	//
	// It is EXPLICIT CONFIGURATION and nothing else: http.ProxyFromEnvironment
	// is deliberately not consulted anywhere, because ambient HTTP_PROXY
	// discovery would let a process's environment redirect authenticated fleet
	// traffic. https only — the CONNECT request names the remote host, so a
	// plaintext proxy publishes the fleet topology to the path.
	DirectoryProxy string
	// PairingSPKIPin optionally states the externally served TLS public key.
	// Managed owner configuration is its authority after adoption.
	PairingSPKIPin string

	// AdapterEgressPolicy is loaded once at startup from the operator-owned
	// policy file. Entries are keyed by an exact canonical HTTPS origin; a
	// private address is usable only for the origin whose entry contains it.
	AdapterEgressPolicy map[string][]netip.Prefix

	// AdapterAWSWorkloadIdentity is the node operator's opt-in, from
	// HIKYO_ADAPTER_AWS_WORKLOAD_IDENTITY=allow, for AWS Secrets Manager
	// adapters that borrow this node's own AWS identity (ambient, assume-role,
	// web-identity). Off by default: without it only static keys are accepted,
	// so a project administrator cannot act with the server's IAM role.
	AdapterAWSWorkloadIdentity bool

	// OIDCEgressPolicy grants private-network access only to exact federation endpoint origins.
	OIDCEgressPolicy map[string][]netip.Prefix

	// SealedWebhook is the instance-admin registry of sealed webhook
	// receivers (#163), loaded once at startup from the operator-owned file
	// named by HIKYO_SEALED_WEBHOOK_FILE. Tenants can bind a sealed-webhook
	// adapter only to an origin listed here; nil means none is configured.
	// Cryptographic validation (fingerprint confirmation, key syntax) happens
	// in the app layer before the server serves.
	SealedWebhook *SealedWebhookConfig

	// DynamicEgressPolicy is the dynamic-secret (#147) equivalent, keyed by an
	// exact postgres:// origin. A self-hosted PostgreSQL target is normally on a
	// private address, so without an entry the default-deny public-egress rule
	// refuses it; this is the explicit operator allow-list that permits it.
	DynamicEgressPolicy map[string][]netip.Prefix

	// ExternalOrigin is the instance's public origin (scheme + host), used to
	// build per-provider OIDC redirect URIs (A1). Never derived from a request
	// header. When unset, uses the listen scheme and port with localhost for a
	// 127.0.0.1, ::1 or wildcard bind. Other listen hosts are retained.
	ExternalOrigin string
	// ExternalOriginExplicit records whether the operator supplied
	// ExternalOrigin (flag, HIKYO_EXTERNAL_ORIGIN or a managed value) rather
	// than it falling back to the listen-derived local origin. A registration policy
	// refuses to open on a derived origin (#579 d6, `no-public-origin`): a
	// sign-up mail or redirect naming 127.0.0.1 or a container hostname is
	// useless to a stranger.
	ExternalOriginExplicit bool

	// MCPEnabled gates the separately versioned MCP protocol endpoint. It is
	// off unless the operator explicitly enables it. MCPAllowedOrigins is the
	// exact allowlist for requests that carry a browser Origin header; an empty
	// list still permits non-browser clients that omit Origin.
	MCPEnabled        bool
	MCPAllowedOrigins []string
	// MCPWriteEnabled installs the stage-and-validate write tools into the MCP
	// registry (mcp-write ADR § 5). It is a second, independent flag: it
	// requires MCPEnabled, defaults off, and controls availability only; the
	// per-operation authorization formula and audit event stay the gate.
	MCPWriteEnabled bool

	// SecondFactor is the instance's sign-in second-factor policy (#760):
	// "required" gates a password login on an account with no factor into
	// enrolment; "optional" keeps today's local floor. Fresh installs default to
	// "required" (greenfield strict); an upgrade keeps "optional" via the
	// runtimeconfig migration so an existing instance's posture is unchanged.
	SecondFactor string
	// TLSProfile is the native listener's transport key-exchange policy (#1127):
	// "compat" is today's behavior and the default; "strict" requires TLS 1.3 and
	// the hybrid X25519MLKEM768 group (handshake confidentiality only, not
	// post-quantum authentication). Owner-managed: an adopted value outranks the
	// bootstrap environment, which only seeds it. Vocabulary is owned by
	// tlspolicy.ParseProfile; config stays a leaf package and mirrors the names.
	TLSProfile string
	// MaxKeysPerProject is shared owner policy, reloaded through managed config.
	MaxKeysPerProject     int
	DefaultKeysPerProject int

	// Root-key source descriptor — never the key material itself; the crypto
	// package reads and validates it at boot. Only `hikyo server` consults it.
	RootKeyFile    string // --root-key-file (also covers systemd LoadCredential paths)
	RootKeyFromEnv bool   // HIKYO_ROOT_KEY is set (documented weakest tier)
	// NewRootKeyFile is the NEW root source consulted only by
	// `rotate-root-key --prepare` (HIKYO_NEW_ROOT_KEY_FILE). Empty means no
	// rotation is configured, and prepare refuses rather than reading the wire —
	// no root key material ever crosses the API.
	NewRootKeyFile string
	// NewRootSource is the managed node alias for explicit root preparation.
	// It never contains a file path or root key.
	NewRootSource string

	// Auth tuning. The Argon2id parameters may be raised for stronger
	// hardware and never lowered: boot verifies them against the floor the
	// human-auth ADR fixes and refuses to start below it, rather than
	// degrading quietly. AdmissionBudgetMiB derives the pre-authentication
	// concurrency, so raising the KDF memory lowers concurrency automatically
	// instead of silently doubling the memory bill.
	Argon2MemoryKiB    uint32
	Argon2Time         uint32
	Argon2Parallelism  uint8
	AdmissionBudgetMiB int

	// Backup export configuration (#76, ops spec section 11). Recipients are
	// PUBLIC age recipients; the private backup identity never touches this
	// process, this configuration or the datastore — it is a separate custody
	// store from the root key by requirement, not by convention.
	//
	// Dir is where automatic exports are published. It is REQUIRED when
	// recipients are configured: an export policy with no destination is a
	// backup that silently goes nowhere, which is the failure mode the loud
	// skip exists to prevent.
	BackupRecipients []string
	BackupDir        string
	// Disaster-recovery schedule (#145, ops spec section 11). Scheduling is
	// enabled exactly when recipients and a destination are configured
	// (BackupScheduled); the knobs below then bound it. Each has a default
	// and a range, and a value outside the range is a startup error rather
	// than a clamp: a retention of 400 days silently becoming 180 is the
	// kind of quiet correction the ops spec forbids.
	BackupInterval          time.Duration // HIKYO_BACKUP_INTERVAL, default 24h, minimum 1h
	BackupRPO               time.Duration // HIKYO_BACKUP_RPO, default 26h, at least the interval
	AuditAccessRetainDays   int           // HIKYO_AUDIT_ACCESS_RETAIN_DAYS, 90 by default
	AuditSecurityRetainDays int           // HIKYO_AUDIT_SECURITY_RETAIN_DAYS, 365 by default
	BackupRetainCount       int           // HIKYO_BACKUP_RETAIN_COUNT, default 7, minimum 1; protects only within 180 days
	BackupRetainDays        int           // HIKYO_BACKUP_RETAIN_DAYS, earlier pruning outside count; default/max 180
	BackupRTOTarget         time.Duration // HIKYO_BACKUP_RTO_TARGET, default 30m; the drill's verdict line

	// DevAdmissionPerIPPerMinute raises the per-source-IP pre-auth allowance.
	// Zero means the locked default.
	//
	// It exists for one caller — the browser flow suite, which drives every
	// login of every flow from one loopback address, a traffic shape the
	// default is deliberately not sized for. It is refused outside development
	// mode (see Load), so no production instance can have its ceiling raised
	// by an environment variable, and the key name says so out loud for anyone
	// who copies it into a compose file.
	DevAdmissionPerIPPerMinute int
	// DevServiceBudgetsDisabled disables the authenticated, in-memory expensive
	// operation budgets for a development server. It exists for the browser flow
	// suite, whose scenarios intentionally reuse one principal while exercising
	// more than the production publish allowance. Load refuses the override
	// outside --dev; false keeps the production budget enabled.
	DevServiceBudgetsDisabled bool
	// DevAdapterFakeProvider replaces the deployment-adapter provider modules
	// with an in-process, in-memory stand-in (#157). It exists for the browser
	// flow suite, which cannot reach a real HTTPS provider from inside the
	// harness; every other part of the adapter path (ceremonies, outbox,
	// ledger, INTENT/OUTCOME journaling, audit) stays real. Load refuses the
	// override outside --dev.
	DevAdapterFakeProvider bool
	// ReauthWindow is the instance-default disclosure reauthentication
	// window (human-auth ADR section Assurance; permission-model ADR's
	// per-environment knob inherits it). Zero - the production default - means
	// every disclosure takes its own ceremony, which only WebAuthn can honour;
	// a non-zero window lets TOTP open a sliding window. --dev sets 15 minutes
	// when the key is absent so an evaluation instance can reveal with an
	// authenticator alone.
	ReauthWindow time.Duration
	// UpdateChannel is this server installation's release notification track.
	UpdateChannel string
	// UpdaterSocket is retained only to reject legacy enablement explicitly.
	// A nonempty value fails config loading and server boot.
	UpdaterSocket string

	// HA enables multi-node application-tier high availability (#146): the
	// scheduler runs singleton work under a fenced datastore lease, admission
	// counters are shared across nodes, and this node registers in the live
	// node table. It requires PostgreSQL, a stable unique NodeID, and an
	// explicitly configured shared root-key authority. It is refused on sqlite
	// and refused when no root-key source is configured, at boot rather than
	// as a degraded single-node fallback.
	HA bool
	// NodeID is this node's stable unique identity (HIKYO_NODE_ID). The chart
	// uses Pod identity for HA and Deployment identity for enrolled singletons.
	// An empty standalone identity is normalized to local by the runtime.
	NodeID string
}

func ApplyManagedNodeValues

func ApplyManagedNodeValues(base *Config, values map[string]string) (*Config, error)

ApplyManagedNodeValues applies a complete node projection while retaining the supplied owner's effective policy. It performs no filesystem or network I/O.

func ApplyManagedOwnerAndNodeValues

func ApplyManagedOwnerAndNodeValues(base *Config, ownerValues, nodeValues map[string]string) (*Config, error)

ApplyManagedOwnerAndNodeValues validates one candidate's owner and local-node settings together, so a simultaneous destination/policy or TLS/listener change is judged against its own complete configuration rather than an older graph.

func ApplyManagedOwnerValues

func ApplyManagedOwnerValues(base *Config, values map[string]string) (*Config, error)

ApplyManagedOwnerValues validates a complete owner configuration with the actual node's deployment context. Missing owner keys use documented defaults, never stale process environment. Validation reuses the startup parser with explicit synthetic datastore metadata and no file-source inputs: it does not open databases, files, listeners, or network connections. The returned config preserves node/bootstrap fields and owns independent copies of mutable data.

func Load

func Load(subcommand string, args []string, getenv func(string) string, environ []string) (*Config, []string, error)

Load parses configuration for a subcommand. getenv supplies single keys; environ (os.Environ() shape) is scanned for unknown HIKYO_* keys and may be nil. Returned warnings are for the caller to log — Load itself never logs.

func LoadBootstrap

func LoadBootstrap(subcommand string, args []string, getenv func(string) string, environ []string) (*Config, []string, error)

LoadBootstrap parses the external settings needed to open the instance. Managed settings are validated later, after their authority is known. Load remains available to callers that explicitly validate a standalone seed.

func (*Config) BackupScheduled

func (c *Config) BackupScheduled() bool

BackupScheduled reports whether the in-process export schedule runs: it does exactly when an export policy is complete. There is no separate enable switch, so an instance with a policy cannot have its schedule quietly turned off by one more variable.

func (*Config) MaintenanceOperationalListen

func (c *Config) MaintenanceOperationalListen() (string, error)

MaintenanceOperationalListen resolves only the operational binding before runtime admission. Bootstrap retains explicit flags and environment inputs separately from the ordinary config fields. Recovery health must honor that binding without importing seed files or opening managed runtime configuration.

func (*Config) ManagedOwnerValues

func (c *Config) ManagedOwnerValues() map[string]string

ManagedOwnerValues exports effective application settings, including defaults. Mail and release-channel values have their own runtime components and are not included. A disabled backup policy omits schedule knobs that require a policy.

func (*Config) ManagedSeed

func (c *Config) ManagedSeed() (map[string]string, error)

ManagedSeed resolves one-time file imports. Call only for an unmanaged instance: an existing binding must not evaluate stale files or seed values. Error messages identify the setting, never its contents or filesystem path.

func (*Config) ManagedSeedForNode

func (c *Config) ManagedSeedForNode(nodeValues map[string]string) (map[string]string, error)

ManagedSeedForNode reuses an exact already-captured node seed. HA aggregation calls SeedNodeValues once, then this method, so file edits cannot split one node's owner seed and encrypted node projection across different bytes.

func (*Config) SeedNodeValues

func (c *Config) SeedNodeValues() (map[string]string, error)

SeedNodeValues captures one node's effective settings and imports only its explicitly configured startup file sources. The caller aggregates each HA node separately; no source path is retained as an applied configuration value.

type Datastore

type Datastore struct {
	Engine          Engine
	Path            string // sqlite file path
	DSN             string // postgres DSN
	PostgresStorage PostgresStorage
	PostgresPoolMax int32 // HIKYO_PG_POOL_MAX override; zero uses DSN/locked default
}

Datastore is the parsed, validated datastore selection.

type Engine

type Engine string
const (
	EngineSQLite   Engine = "sqlite"
	EnginePostgres Engine = "postgres"
)

type ManagedBootstrapSources

type ManagedBootstrapSources struct {
	Topology       ManagedSingletonTopology `json:"topology,omitempty"`
	Version        int                      `json:"version"`
	DatabaseSource string                   `json:"database_source,omitempty"`
	RootSource     string                   `json:"root_source,omitempty"`
	UpgradeSource  string                   `json:"upgrade_source,omitempty"`
}

ManagedBootstrapSources selects installation-owned aliases. It cannot carry a locator, path, credential or root key. Enrollment determines their custody.

func ParseManagedBootstrapSources

func ParseManagedBootstrapSources(raw string) (ManagedBootstrapSources, error)

func (ManagedBootstrapSources) MarshalJSON

func (s ManagedBootstrapSources) MarshalJSON() ([]byte, error)

type ManagedOwnerPolicy

type ManagedOwnerPolicy struct {
	Argon2MemoryKiB   uint32
	Argon2Time        uint32
	Argon2Parallelism uint8
	BackupRecipients  []string
}

ManagedOwnerPolicy contains parsed inputs for the runtime cryptographic policy validators. It has no bootstrap context and cannot construct an application.

func ParseManagedOwnerPolicy

func ParseManagedOwnerPolicy(values map[string]string) (ManagedOwnerPolicy, error)

ParseManagedOwnerPolicy returns independently parsed policy inputs so runtime owners can enforce their cryptographic floors and recipient rules.

type ManagedSingletonTopology

type ManagedSingletonTopology struct {
	HA     bool   `json:"ha"`
	NodeID string `json:"node_id"`
}

ManagedSingletonTopology is the configured process identity. The app converts this wire value into the domain correspondence used by controlled rollouts.

type PostgresStorage

type PostgresStorage struct {
	KubeletURL string
	Namespace  string
	PVC        string
	Node       string
}

PostgresStorage identifies the kubelet and PVC hosting the database filesystem. Empty fields disable measurement. These are deployment bootstrap inputs.

func (PostgresStorage) Validate

func (storage PostgresStorage) Validate() error

Validate checks the complete operator-supplied database volume mapping. An empty mapping is only accepted by Load as an explicit disabled state.

type SealedWebhookConfig

type SealedWebhookConfig struct {
	InstanceID string
	// SigningKeyPEM is the instance's Ed25519 envelope signing key, read from
	// the file named by signing_key_file. It is never logged or exported.
	SigningKeyPEM []byte
	// SigningKeyMLDSA65PEM is the instance's ML-DSA-65 envelope signing key
	// (seed-only PKCS#8), required exactly when a target speaks protocol 2.
	SigningKeyMLDSA65PEM []byte
	Targets              []SealedWebhookTarget
}

SealedWebhookConfig is the operator-owned sealed webhook registry (#163). Endpoints are instance-admin configuration: the file lives on the server, and every endpoint must carry the fingerprint the admin verified out of band. No tenant request can add, move, or re-key one.

type SealedWebhookTarget

type SealedWebhookTarget struct {
	ID                   string
	Origin               string
	RecipientKey         string
	AckKey               string
	Generation           int64
	Timeout              time.Duration
	MaxResponseBytes     int64
	ConfirmedFingerprint string
	// Protocol is the wire protocol version, 1 (default) or 2. A protocol 2
	// target never falls back to protocol 1 after an error.
	Protocol      int
	AckKeyMLDSA65 string
}

SealedWebhookTarget is one receiver as written by the instance admin.

type UpgradeConfiguration

type UpgradeConfiguration struct {
	Unattended            bool
	ScratchPostgresDSN    string
	BundleDirectory       string
	StateDirectory        string
	EvidenceDirectory     string
	CiphertextPath        string
	OperatorPublicKeyFile string
	OperatorInstanceID    string
	TargetManifestSHA256  string
	LegacyWritersStopped  bool
}

UpgradeConfiguration holds installation paths, public evidence and the dedicated scratch database connection. Private custody keys stay in the vault.

type VariableActivation

type VariableActivation string

VariableActivation describes the lifecycle a setting belongs to. It does not claim that the current build implements Apply for that lifecycle.

const (
	VariableLive       VariableActivation = "live"
	VariableComponent  VariableActivation = "component"
	VariableAppReload  VariableActivation = "app-reload"
	VariableBootstrap  VariableActivation = "bootstrap"
	VariableDeployment VariableActivation = "deployment"
	VariableNone       VariableActivation = "none"
)

type VariableAudience

type VariableAudience string

VariableAudience identifies the consumer of a recognized environment key.

const (
	VariableServer  VariableAudience = "server"
	VariableClient  VariableAudience = "client"
	VariableCommand VariableAudience = "command"
	VariableRetired VariableAudience = "retired"
)

type VariableDescriptor

type VariableDescriptor struct {
	ManagedField            string             `json:"managedField,omitempty"`
	Key                     string             `json:"key"`
	Audience                VariableAudience   `json:"audience"`
	Scope                   VariableScope      `json:"scope"`
	Activation              VariableActivation `json:"activation"`
	Secret                  bool               `json:"secret"`
	Import                  VariableImport     `json:"import"`
	FileContentKey          string             `json:"fileContentKey,omitempty"`
	ReferencedContentSecret bool               `json:"referencedContentSecret,omitempty"`
	DevelopmentOnly         bool               `json:"developmentOnly,omitempty"`
}

VariableDescriptor contains metadata only, never a configured value. Secret classifies the value or explicitly imported contents, including credentials embedded in compound values. For external file references it classifies only the path metadata. Root-key file references remain external; their private bytes have ReferencedContentSecret=true. TLS key sources import secret bytes once into the reviewed node document and therefore also have Secret=true. FileContentKey is set only for supported one-time content imports; the source path itself is never the imported value. Other filesystem references remain external until a dedicated content or deployment workflow owns them.

func VariableInventory

func VariableInventory() []VariableDescriptor

VariableInventory returns an independent, key-sorted copy of the complete recognized environment inventory. Its descriptors are values without mutable children, so callers cannot mutate the package's admission metadata.

type VariableImport

type VariableImport string

VariableImport describes the source boundary, not permission to import a key. The active managed catalogue must independently admit each value. External inputs require their dedicated operator workflow; a generic importer must never read their contents.

const (
	VariableValue       VariableImport = "value"
	VariableFileContent VariableImport = "file-content"
	VariableExternal    VariableImport = "external"
)

type VariableScope

type VariableScope string

VariableScope distinguishes shared logical-owner values from local node inputs. A node-scoped file import may produce an owner-scoped managed value.

const (
	VariableOwner VariableScope = "owner"
	VariableNode  VariableScope = "node"
)

Jump to

Keyboard shortcuts

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