feat: deliver secrets as env vars instead of inlining in YAML#25
feat: deliver secrets as env vars instead of inlining in YAML#25TerrifiedBug merged 7 commits intomainfrom
Conversation
Secret names with hyphens or dots (e.g. "db-password") produced
invalid env var names like ${VF_SECRET_db-password}. Now normalized
to uppercase with underscores: ${VF_SECRET_DB_PASSWORD}.
Both the YAML placeholder and secrets dict key use the same
secretNameToEnvVar function to ensure they always match.
- Include secrets dict in checksum computation so secret rotation triggers agent restart (previously, YAML-only checksum wouldn't change when env var placeholders stayed the same) - Log warning when secret name normalization produces a collision (e.g. "db-password" and "db_password" both → VF_SECRET_DB_PASSWORD)
…ordering Move the secrets findMany + decrypt loop above the pipeline iteration so it runs once per request instead of once per pipeline. Add orderBy name asc to ensure deterministic collision resolution when multiple secret names normalize to the same env var key.
Vector's YAML parser (yaml-rust) rejects unquoted ${VF_SECRET_*}
placeholders because { is a flow indicator character. Force double-
quoting all string values in the YAML dump so the output produces
password: "${VF_SECRET_NAME}" instead of password: ${VF_SECRET_NAME}.
Vector interpolates env vars from parsed string values, so quoting
does not affect interpolation.
Greptile SummaryThis PR implements the secret-delivery redesign for the agent config endpoint. The key change is adding Key findings:
The broader secret-delivery infrastructure (pre-resolving secrets, collision detection, env-var placeholders, normalized naming) appears solid and is already landed. Confidence Score: 3/5
|
Summary
resolveSecretRefs(which inlined decrypted credentials into pipeline YAML) withconvertSecretRefsToEnvVarsthat convertsSECRET[name]→"${VF_SECRET_NAME}"env var placeholderssecretNameToEnvVar()(e.g.db-password→VF_SECRET_DB_PASSWORD) on both placeholder and delivery sidesorderBy: name asc) for consistent collision resolution${...}flow indicatorsTest plan
SECRET[name]references in sensitive fields"${VF_SECRET_NAME}"placeholders, not real valuessecretsdict in API response contains decrypted values with normalized keys