Generalize auth/base-url value sources: provider registry replaces hardcoded SSM #150

Closed
opened 2026-06-17 20:31:35 +00:00 by coilysiren · 0 comments
Owner

Replace the hardcoded SSM config hydration with a pluggable value-source mechanism so guardfiles can name other config stores.

Grammar

ssm "/path" becomes value <provider> "<address>" everywhere a secret or host is named (header-token, bearer, query-param param, base-url). A new ValueSource{Provider, Address} type replaces Auth.SSM, QueryAuthParam.SSM, BaseURLSSM.

Engine

TokenResolver becomes a Providers map[string]Provider registry (Provider = func(ctx, address) (string, error)). cli-guard ships no-SDK built-ins (env, file, literal); the consumer registers ssm and tailscale. Build-time fail-closed validation: a value foo whose provider isn't registered is a build error. base-url, auth token, and query-param secrets collapse onto the one resolver, deleting the parallel BaseURLFn/baseURLSSM path.

Codegen

The generated consumer main.go (specgen template) builds a providers map wiring ssm + tailscale, gating the AWS SDK imports on whether any guardfile actually uses ssm. base-url-via-value flows through the same map. This is where the real hardcoded SSM hydration lived.

Motivating non-ssm case

base-url { value tailscale "open-webui" } resolves a tailnet host live via tailscale ip -4, dropping an SSM entry.

v0.x break; ward/coily re-bump along the dependency arrow.

Replace the hardcoded SSM config hydration with a pluggable value-source mechanism so guardfiles can name other config stores. ## Grammar `ssm "/path"` becomes `value <provider> "<address>"` everywhere a secret or host is named (header-token, bearer, query-param param, base-url). A new `ValueSource{Provider, Address}` type replaces `Auth.SSM`, `QueryAuthParam.SSM`, `BaseURLSSM`. ## Engine `TokenResolver` becomes a `Providers map[string]Provider` registry (`Provider = func(ctx, address) (string, error)`). cli-guard ships no-SDK built-ins (env, file, literal); the consumer registers ssm and tailscale. Build-time fail-closed validation: a `value foo` whose provider isn't registered is a build error. base-url, auth token, and query-param secrets collapse onto the one resolver, deleting the parallel BaseURLFn/baseURLSSM path. ## Codegen The generated consumer main.go (specgen template) builds a providers map wiring ssm + tailscale, gating the AWS SDK imports on whether any guardfile actually uses ssm. base-url-via-value flows through the same map. This is where the real hardcoded SSM hydration lived. ## Motivating non-ssm case `base-url { value tailscale "open-webui" }` resolves a tailnet host live via `tailscale ip -4`, dropping an SSM entry. v0.x break; ward/coily re-bump along the dependency arrow.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/cli-guard#150
No description provided.