Skip to content

feat(config): SpiffeConfig edge fields + validators (proposal 012 PR-1) - #82

Closed
flg77 wants to merge 1 commit into
spiffe/config-surfacefrom
spiffe-edge/config-surface
Closed

flg77 wants to merge 1 commit into
spiffe/config-surfacefrom
spiffe-edge/config-surface

Conversation

@flg77

@flg77 flg77 commented May 15, 2026

Copy link
Copy Markdown
Owner

Summary

Extends proposal 011 PR-1's SpiffeConfig with the 11 edge-specific fields and three cross-field validators required by proposal 012. Stacked on top of #81 (011 PR-1) — that PR must merge first, then this rebases onto main.

Inert by design: every deploy_mode still defaults to signing_mode: ed25519 in v0.4.x; the new fields are read but not consumed. 012 PR-2..PR-4 wire the SPIRE manifests, bundle cache, federation handshakes, and edge-edge integration tests.

What's new

11 new SpiffeConfig fields (Q1–Q6 from proposal 012 §8):

Field Type Default Q
edge_topology nested | federated | ed25519 nested
edge_site_id str "" Q5
parent_spire_url str ""
federation_peers list[str] [] Q3
offline_bundle_cache_path str /run/spire/cache/bundle.pem
offline_max_age_h float 72.0
bundle_refresh_h float 6.0 Q1
offline_action rotate | degrade | shutdown rotate Q2
parent_unreachable_action block | degrade degrade Q4
nats_mtls_cert_path str "" Q6
nats_mtls_key_path str "" Q6

New ACCConfig._validate_edge_spiffe_fields model validator — enforces topology-specific requirements only when deploy_mode: edge AND spiffe.enabled: True AND signing_mode: spiffe:

  1. nested requires parent_spire_url + edge_site_id
  2. federated requires ≥ 1 federation_peers entry
  3. offline_action: rotate requires edge_topology: nested (rotation needs a local SPIRE server)

Non-edge deployments + edge with signing_mode: ed25519 skip the validator entirely — edge fields stay advisory.

Nine new env-var overrides for the scalar edge fields. federation_peers (list type) stays YAML-only since _apply_env writes scalar strings.

Test plan

  • 19 new tests in tests/test_config.py::TestSpiffeEdgeDefaults
    • Defaults for all 11 fields
    • All three cross-field validator failure paths (nested missing fields, federated missing peers, rotate requires nested)
    • Three happy paths (nested, federated, degrade-with-federated)
    • Non-edge deploy_mode skip for standalone + rhoai
    • Invalid-value rejection for edge_topology + offline_action Literals
    • Env-var roundtrip on every scalar override
  • Combined with 011 PR-1: 76/76 green on tests/test_config.py
  • +447 LOC across 3 files (budget 800)
  • Reviewer: confirm validator rules match proposal 012 §1 locked decisions

Proposal 012 reference

Vault: 012 - SPIRE for ACC edge deployments.md. Status: Proposed, Q1–Q6 resolved 2026-05-15 per inline answers folded into §11 amendments.

PR-2 next: edge-side SPIRE manifests + operator reconciler extension.

🤖 Generated with Claude Code

Extends proposal 011 PR-1's SpiffeConfig with the 11 edge-specific
fields from proposal 012 §5 step 1 + the three cross-field
validators that fall out of operator's §8 answers (Q1-Q6,
resolved 2026-05-15).

Inert by design: every deploy_mode still defaults to
signing_mode: ed25519 in v0.4.x, so the new fields are read but
not consumed.  012 PR-2..PR-4 wire the actual SPIRE manifests +
agent-side bundle cache + federation handshakes.

New SpiffeConfig fields:

  edge_topology              nested | federated | ed25519
  edge_site_id               operator-supplied (Q5)
  parent_spire_url           required for nested
  federation_peers           required for federated
  offline_bundle_cache_path  default /run/spire/cache/bundle.pem
  offline_max_age_h          default 72.0
  bundle_refresh_h           default 6.0  (Q1)
  offline_action             rotate | degrade | shutdown  (Q2)
  parent_unreachable_action  block | degrade              (Q4)
  nats_mtls_cert_path        Ed25519 fallback path        (Q6)
  nats_mtls_key_path         Ed25519 fallback path        (Q6)

New ACCConfig validator _validate_edge_spiffe_fields enforces
topology-specific requirements only when:

  - deploy_mode == "edge" AND
  - spiffe.enabled == True AND
  - signing_mode == "spiffe"  (operator actually consuming SPIFFE)

Three rules:

  1. nested needs parent_spire_url + edge_site_id
  2. federated needs >= 1 federation_peers entry
  3. offline_action=rotate requires edge_topology=nested

Non-edge deployments + edge with signing_mode=ed25519 pass
through the validator without raising — edge fields stay
advisory.

Nine new env-var overrides for the scalar edge fields.
federation_peers (list type) stays YAML-only since _apply_env
writes scalar strings.

Test coverage: 19 new tests in
tests/test_config.py::TestSpiffeEdgeDefaults covering defaults,
every cross-field validator path (nested missing fields,
federated missing peers, rotate requires nested), non-edge
topology skip for all three deploy_modes, all happy paths,
env-var roundtrip on every scalar override, and invalid-value
rejection for the two new Literal types.

Combined with 011 PR-1's 15 tests: 76/76 green on
tests/test_config.py.

Stacked on top of spiffe/config-surface (011 PR-1, PR #81).

Total: +447 / -0 LOC across 3 files.  Well under the 800-LOC
budget.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@flg77
flg77 deleted the branch spiffe/config-surface May 15, 2026 06:59
@flg77 flg77 closed this May 15, 2026
flg77 added a commit that referenced this pull request Jun 15, 2026
…(0.2.0) (#82)

#74 (webgui/tui spec) and #76 (SharedModel status) updated config/crd/bases/
but did not mirror into bundle/manifests/, so the OLM bundle's agentcorpora CRD
lacked spec.webgui/spec.tui + status.sharedModel and agentcollectives lacked the
assistant role enum. OLM installs the BUNDLE CRD, so without this the API server
would reject spec.webgui/spec.tui even on 0.2.0.

Mirror config/crd/bases/*.yaml -> bundle/manifests/ (the hand-maintained-bundle
convention; `make bundle` is unscaffolded — WS-A gap). Caught during the live
0.2.0 build on acc1.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
flg77 pushed a commit that referenced this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant