Skip to content

Commit 5dbf1ba

Browse files
committed
test: cover worker identity migration lint
1 parent b6545a0 commit 5dbf1ba

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This checkpoint starts hardening remote worker identity for public and enterpris
3131
- TLS client support for control-plane calls to remote worker RPC.
3232
- Worker RPC mTLS conformance test with generated CA, server, and client certificates.
3333
- Config lint checks for worker RPC TLS certificate and CA settings.
34+
- Cluster conformance coverage for signed-token migration lint warnings.
3435
- Phase 14 release notes under `docs/releases/phase-14-worker-identity-hardening.md`.
3536

3637
### Changed

‎docs/cluster-conformance.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ It currently verifies:
2525
- Worker RPC mTLS completes a real client-authenticated request using generated certificates.
2626
- Worker lease renewal is guarded by `worker:lease`.
2727
- A production-aligned cluster config with `auth.worker_tokens` or `auth.worker_signing_key` passes `stacyvm config lint --production`.
28+
- Signed-token migration lint warns when shared worker tokens or invalid signing-key rotation state remain configured.
2829
- Postgres configuration with a valid DSN passes `stacyvm config lint --production`.
2930
- Live Postgres passes the reusable store contract when `STACYVM_POSTGRES_TEST_DSN` is set.
3031
- Live Postgres proves one active lease holder under concurrent acquire and expired takeover attempts.

‎docs/releases/phase-14-worker-identity-hardening.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Phase 14 begins the worker identity hardening lane for production multi-worker S
7878
- Updated the API docs for worker heartbeat and lease-renewal headers.
7979
- Updated the cluster conformance matrix to mark signed worker tokens as the public/enterprise worker identity path.
8080
- Updated production readiness notes to reflect signed worker tokens and the remaining issuer/rotation and mTLS work.
81+
- Added cluster conformance coverage for signed-token migration lint warnings.
8182

8283
## Code Areas Changed
8384

‎scripts/ci-cluster-conformance.sh‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,35 @@ sed \
116116
"$cluster_config" >"$signed_worker_config"
117117
go run ./cmd/stacyvm config lint --production --file "$signed_worker_config"
118118

119+
echo "==> Linting signed-token worker identity migration warnings"
120+
mixed_worker_config="$tmpdir/stacyvm.signed-worker-mixed.yaml"
121+
sed \
122+
-e '/worker_tokens:/,/admin_fallback_enabled:/c\
123+
worker_token: "shared-worker-token-with-at-least-32-bytes"\
124+
worker_signing_key: "worker-signing-key-with-at-least-32-bytes"\
125+
admin_fallback_enabled: false' \
126+
"$cluster_config" >"$mixed_worker_config"
127+
mixed_lint_output="$(go run ./cmd/stacyvm config lint --production --file "$mixed_worker_config")"
128+
if [[ "$mixed_lint_output" != *"shared worker token still configured with signed worker tokens"* ]]; then
129+
echo "$mixed_lint_output"
130+
echo "expected signed-token migration warning for shared worker token" >&2
131+
exit 1
132+
fi
133+
134+
invalid_rotation_config="$tmpdir/stacyvm.invalid-rotation.yaml"
135+
sed \
136+
-e '/worker_tokens:/,/admin_fallback_enabled:/c\
137+
worker_signing_key: "worker-signing-key-with-at-least-32-bytes"\
138+
worker_signing_keys: ["worker-signing-key-with-at-least-32-bytes"]\
139+
admin_fallback_enabled: false' \
140+
"$cluster_config" >"$invalid_rotation_config"
141+
rotation_lint_output="$(go run ./cmd/stacyvm config lint --production --file "$invalid_rotation_config")"
142+
if [[ "$rotation_lint_output" != *"rotation keys include the active worker signing key"* ]]; then
143+
echo "$rotation_lint_output"
144+
echo "expected signed-token migration warning for invalid rotation keys" >&2
145+
exit 1
146+
fi
147+
119148
echo "==> Linting production-aligned Postgres cluster config"
120149
postgres_config="$tmpdir/stacyvm.postgres.yaml"
121150
sed \

0 commit comments

Comments
 (0)