Repository navigation
Expand Infisical secret references when reading Fleet-OPS root (OPS-818) - #259
Conversation
The Fleet-OPS root secrets are now bare references such as ${prod.<folder>.<NAME>}. The reader asked Infisical not to expand them, so it would have exported the literal reference as the credential.
- `scripts/infisical-fetch.mjs`: `expandSecretReferences` is now `true` on the secrets list call, and a value that is still a bare reference makes the step fail naming the key only. This copy has no Fleet-OPS root caller today; it is fixed so it cannot hand out a reference later.
- `scripts/infisical-fetch-expand.node-test.mjs`: new test for the expansion parameter and the guard.
Refs OPS-818
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
🤔 Insufficient Task ContextI found a task linked to this PR, but it only contains minimal information (title only, no description or acceptance criteria). To perform a meaningful business rules validation, I need more details. 🔍 What I need to validate:
💡 How to improve the task context:
|
Refs OPS-818
Summary
Updates the Infisical export used by Fleet-OPS root CI so that secret values stored as bare references (for example
${prod.some-folder.NAME}) are returned already resolved, and so that any reference that still cannot be resolved halts the export instead of being injected into the workflow as if it were the credential.Functional changes
scripts/infisical-fetch.mjs): the raw-secrets list call now setsexpandSecretReferences=true(previouslyfalse). A secret whose stored value is a bare reference now comes back as the referenced value. Expanding requires the reading identity to also be able to read the referenced folder.isUnresolvedReferencehelper detects values that are still a single whole-value${...}reference (leading/trailing whitespace ignored; embedded references such asprefix-${...}or${...}-suffixare not treated as unresolved).::error::line names the key only with guidance to check that the target exists and the CI identity can read the referenced folder, and the value is skipped — it is not written toGITHUB_ENVand not passed through masking or logging.runthrows an error listing the affected key names (not values). This check runs before the existing missing-required-names error.GITHUB_ENVnormally.Tests added
New
scripts/infisical-fetch-expand.node-test.mjscovers:expandSecretReferences=true;GITHUB_ENV;isUnresolvedReferencematches only whole-value bare references and rejects partial, plain, empty, and undefined inputs.Review note
The automated review flagged [medium] that the task description is insufficient for business-logic validation; the description above documents the intended behavior (server-side expansion plus fail-closed export) for that validation.