@@ -3,10 +3,12 @@ import assert from "node:assert/strict"
33import {
44 SECRET_ENV_PROJECTIONS_ENV ,
55 defaultRecipeSecretEnvProviders ,
6+ mergeRecipeSecretEnvSummary ,
67 parseSecretEnvProjections ,
78 resolveRecipeSecretEnv ,
89 type RecipeSecretEnvProvider ,
910} from "../packages/cli/src/recipe-secret-env.js"
11+ import { recipeSecretEnvelope } from "../packages/cli/src/recipe-evidence.js"
1012import { planWorkspaceRecipe } from "../packages/cli/src/recipe-dry-run.js"
1113
1214const source = {
@@ -27,6 +29,20 @@ assert.deepEqual(resolved.summary, [
2729 { name : "MISSING_SECRET" , status : "missing" } ,
2830] )
2931assert . doesNotMatch ( JSON . stringify ( resolved . summary ) , / d i r e c t - v a l u e - 1 2 3 | p r o j e c t e d - v a l u e - 4 5 6 / )
32+ const generatedSummary = mergeRecipeSecretEnvSummary ( resolved . summary , [ "DB_PASSWORD" ] )
33+ assert . deepEqual ( recipeSecretEnvelope ( generatedSummary ) , {
34+ schema : "wp-codebox/redacted-secret-envelope/v1" ,
35+ provided : true ,
36+ count : 3 ,
37+ secrets : [
38+ { name : "DB_PASSWORD" , status : "available" , source : "managed-runtime-service" } ,
39+ { name : "DIRECT_SECRET" , status : "available" , source : "process-env" } ,
40+ { name : "MISSING_SECRET" , status : "missing" } ,
41+ { name : "PROJECTED_SECRET" , status : "available" , source : "env-projection" } ,
42+ ] ,
43+ redaction : "names-only" ,
44+ } )
45+ assert . doesNotMatch ( JSON . stringify ( recipeSecretEnvelope ( generatedSummary ) ) , / d i r e c t - v a l u e - 1 2 3 | p r o j e c t e d - v a l u e - 4 5 6 / )
3046
3147const customProvider : RecipeSecretEnvProvider = ( name ) => name === "DERIVED_SECRET"
3248 ? { value : `derived:${ name . toLowerCase ( ) } ` , source : "test-provider" }
0 commit comments