Skip to content

OSS-368 P1: enrollment contract revision and harmless fixtures - #518

Merged
athNdev merged 2 commits into
mainfrom
codex/node-enrollment-p1
Nov 18, 2026
Merged

athNdev merged 2 commits into
mainfrom
codex/node-enrollment-p1

Conversation

@athNdev

@athNdev athNdev commented Nov 18, 2026

Copy link
Copy Markdown
Owner

OSS-368 / Track C — P1 enrollment contract revision + harmless fixtures ONLY

Executable preparation for the P1-DESIGN gate (design in PR517 / ADR 0019). No enrollment server RPC handler is mounted, no agent/daemon lifecycle, no live/owned deployment work, no releases. The fixture seam is test code only.

Contract (only node_control.proto, Track C owned)

  • CreateEnrollmentRequest: required approved_public_key_spki, approved_key_fingerprint, enrollment_secret_digest, enrollment_salt, node_id, plus registered csr_pre (pre-registration material only).
  • New bounded BeginEnrollmentChallenge RPC returns a single-use challenge_id + server_nonce and server-derived channel context; no secret.
  • ClaimEnrollmentRequest: challenge ID, fresh SIG_CLAIM by the approved key over node ID / enrollment ID / challenge / nonce / expiry / capabilities / verified channel context, channel-binding evidence. key_fingerprint remains descriptive metadata, never an auth factor. enrollment_token carries the node-generated secret only in this request.
  • ClaimEnrollmentResponse: signed public X.509 client certificate metadata (DER, serial, fingerprint, expiry, CA digest, generation). No plaintext secret in any response message.
  • OneTimeEnrollment metadata gains node ID and approved key fingerprint.
  • Regenerated Go+TS with pinned bun scripts/proto-generate.mjs; only this proto's generated outputs changed.

Harmless fixture seam (test-only)

internal/rpc/node_control_enrollment_fixture_test.go implements ten deterministic cases with synthetic Ed25519 keys, CSR_PRE, fake TLS channels and an owned in-memory snapshot: synthetic key/CSR/fresh signature, valid claim, mismatched approved key, stale/replayed nonce, replay, revoked/generation mismatch, wrong + preflight scope and unsupported topology, digest-only storage/no secret in reads, atomic rollback, durable rotation across a modelled restart.

Acceptance evidence

  • buf lint + buf format -d clean; canonical proto-generate.mjs --check outputs match.
  • go test ./internal/rpc ./pkg/proto/... -count=1 and go vet pass; all ten fixture subtests pass.
  • Descriptor secret scan extended (enrollment_secret added to forbidden response fields) and passes.
  • bun run check (0 errors/warnings), bun run test (360 pass), bun run lint pass.
  • knowledge-lint -fix + final pass (64 concepts, 38/38 queries). knowledge/decisions/adrs.md not edited.
  • Negative authz through the real interceptor now covers all ten procedures, including the new challenge RPC; all denied by default.

Limits

No production enrollment implementation, no stub success evidence, no live compatibility claim. docs/adr/0019-node-control-contract.md and knowledge/architecture/node-control-protocol.md gained explicit test-only status notes.

Do not merge here: independent review and green CI required.

Extends only node_control.proto with digest/salt, required approved SPKI/fingerprint, pre-registration CSR_PRE, bounded challenge nonce, fresh SIG_CLAIM proof, channel-binding evidence and signed public certificate response metadata. No plaintext secret in any response; key_fingerprint stays descriptive. Regenerates Go/TS with the pinned canonical script. Adds ten deterministic test-only fixtures covering synthetic key/CSR/signature, valid claim, mismatched key, stale nonce, replay, revoked/generation mismatch, wrong and preflight scope, topology refusal, digest-only storage/no secret reads, atomic rollback and durable rotation. No enrollment RPC handler is mounted; no stub success is claimed.
Add real domain/scope validation to the test-only fixture seam and assert all four ADR 0019 refusals: bootstrap credential on node operations, node certificate on operator enrollment management, cross-node object_id and over-scope preflight reports. Split topology refusal into its own fixture. Sign the mismatched-key and stale-nonce cases over the exact canonical context so each isolates one requirement, and assert CSR_PRE-as-proof is refused. Make the descriptor secret guard substring-based with explicit public-metadata suffixes.
@athNdev
athNdev merged commit 3bc430b into main Nov 18, 2026
22 checks passed
@athNdev
athNdev deleted the codex/node-enrollment-p1 branch November 18, 2026 06:22
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