fix(provenance): read signing key credstore-first via resolveSecret (#2308) - #2317
Merged
Merged
Conversation
…2308) provenance-keys.js read process.env.PROVENANCE_SIGNING_KEY directly, but a BTP Credential Store binding does not auto-inject entries into process.env. A key rotated in via /admin-ui/#secrets lands in the credstore, so provenance never saw it -> jwks.json empty + provenance endpoint 503 on PROD. Route the read through resolveSecret('PROVENANCE_SIGNING_KEY') (credstore -> env fallback -> null), the same seam as CONTENT_API_KEY and every other secret, matching the #2245 design intent. Env fallback is preserved for local/dev. - add regression test that primes the resolver cache (not process.env) and asserts the signer loads - register PROVENANCE_SIGNING_KEY in seed-secrets so the presence/expiry cron surfaces a missing key - fix gotchas doc line that wrongly claimed the credstore binding surfaces the key as an env var
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (not just missing provisioning)
Issue #2308 is framed as "provision the PROD signing key", but a live probe + code read shows the issue's own plan (set via `/admin-ui/#secrets` + restart) cannot work as-is — it's a code bug:
Change
Tests
```
vitest run test/unit/provenance-keys.test.js test/unit/provenance-envelope.test.js test/lib/provenance-endpoint.test.js
→ 3 files, 10 passed
```
Still required after this merges (ops — needs Tom)
This code fix is necessary but not sufficient; the key must still be provisioned:
Closes #2308 once the ops steps land + are verified live on PROD.