Documentation
¶
Overview ¶
Package config loads and validates the HCL policy file (.tfstackplan.hcl), resolving classification presets+rules into a single ordered rule list while preserving source declaration order.
Index ¶
Constants ¶
const DefaultFilename = ".tfstackplan.hcl"
DefaultFilename is auto-discovered in the working directory.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApprovalConfig ¶ added in v0.6.0
type ApprovalConfig struct {
Backend string // the block label, e.g. "gcp-pam"
Location string
Duration string
RequesterPool []string
}
ApprovalConfig is the `approval "<backend>" {}` sub-block. Entitlement ids per class come from the top-level `class` blocks, not here.
type ClassBinding ¶ added in v0.6.0
type ClassBinding struct {
Name string
Backend string
Entitlement string
EntitlementScope string
Required bool
}
ClassBinding is a `class "<name>" {}` block: binds a classification class to an approval backend + entitlement, and whether it gates (required).
type Classification ¶
Classification holds the resolved, ordered rules and the fallback class.
type Config ¶
type Config struct {
Classification *Classification // nil when no classification block present
Diff DiffConfig
Links *LinksConfig // nil when no links block present
Server *ServerConfig // nil when no server block
Serve *ServeConfig // nil when no serve block (added in a later task)
Classes []ClassBinding // class "<name>" {} bindings
}
Config is the parsed policy file.
type DiffConfig ¶
type DiffConfig struct {
Detect bool
MaxAttributeLines int // 0 = no cap
Overrides []DiffOverride
}
DiffConfig holds diff defaults and per-attribute overrides.
func (DiffConfig) Resolve ¶
func (d DiffConfig) Resolve(resourceType, attr string) string
Resolve returns the differ kind ("" = auto) for a resource type + attribute.
type DiffOverride ¶
DiffOverride forces a differ for a (resource type, attribute) pair.
type GitHubAppConfig ¶ added in v0.6.0
GitHubAppConfig is the `github_app {}` sub-block.
type GroupConfig ¶ added in v0.6.0
GroupConfig configures the live-DAG grouping. Depth groups by the first Depth path segments (default 2 when the block is absent); Pattern (a regexp) overrides it — the first capture group (or whole match) of the stack path is the group key.
type HeaderLink ¶ added in v0.3.0
HeaderLink is one templated report-header link.
type LinksConfig ¶ added in v0.3.0
type LinksConfig struct {
Resource string
Stack string
Header []HeaderLink
}
LinksConfig holds URL templates for header / stack / resource links.
type ObjectsConfig ¶ added in v0.6.0
ObjectsConfig configures the log-offload object store (currently GCS).
type PubSubConfig ¶ added in v0.6.0
type PubSubConfig struct {
Audience string // expected OIDC audience (default: <public_base_url>/pubsub/push)
ServiceAccount string // the push subscription's OIDC service-account email
}
PubSubConfig configures the Pub/Sub push ingestion endpoint.
type ServeConfig ¶ added in v0.6.0
type ServeConfig struct {
DBPath string
PublicBaseURL string
UseChecks bool
WebhookSecretEnv string // env var name holding the bearer secret (not the secret itself)
GitHubWebhookSecretEnv string // env var name holding the GitHub webhook HMAC secret
GitHubApp *GitHubAppConfig
Approval *ApprovalConfig
Group *GroupConfig
LogsDir string
Objects *ObjectsConfig
PubSub *PubSubConfig
}
ServeConfig is the `serve {}` block: the control-plane server runtime config.
type ServerConfig ¶ added in v0.6.0
ServerConfig is the `server {}` block: where the control-plane server lives and which environment this repo's CI reports to. Used by `run` (CI) and `serve`.