envilder 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/ROADMAP.md +1 -1
  3. package/docs/changelogs/cli.md +24 -0
  4. package/docs/changelogs/gha.md +12 -0
  5. package/docs/validate-command.md +112 -25
  6. package/lib/envilder/apps/cli/Startup.d.ts +12 -5
  7. package/lib/envilder/apps/cli/Startup.d.ts.map +1 -1
  8. package/lib/envilder/apps/cli/Startup.js +19 -10
  9. package/lib/envilder/apps/cli/Startup.js.map +1 -1
  10. package/lib/envilder/apps/cli/entry/Cli.d.ts.map +1 -1
  11. package/lib/envilder/apps/cli/entry/Cli.js +104 -22
  12. package/lib/envilder/apps/cli/entry/Cli.js.map +1 -1
  13. package/lib/envilder/apps/gha/Startup.d.ts.map +1 -1
  14. package/lib/envilder/apps/gha/Startup.js +7 -0
  15. package/lib/envilder/apps/gha/Startup.js.map +1 -1
  16. package/lib/envilder/apps/gha/entry/Gha.d.ts.map +1 -1
  17. package/lib/envilder/apps/gha/entry/Gha.js +2 -1
  18. package/lib/envilder/apps/gha/entry/Gha.js.map +1 -1
  19. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommand.d.ts +6 -0
  20. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommand.d.ts.map +1 -0
  21. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommand.js +9 -0
  22. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommand.js.map +1 -0
  23. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommandHandler.d.ts +17 -0
  24. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommandHandler.d.ts.map +1 -0
  25. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommandHandler.js +59 -0
  26. package/lib/envilder/core/application/validateRemoteKeys/ValidateRemoteKeysCommandHandler.js.map +1 -0
  27. package/lib/envilder/core/domain/SecretExistence.d.ts +34 -0
  28. package/lib/envilder/core/domain/SecretExistence.d.ts.map +1 -0
  29. package/lib/envilder/core/domain/SecretExistence.js +25 -0
  30. package/lib/envilder/core/domain/SecretExistence.js.map +1 -0
  31. package/lib/envilder/core/domain/ports/ISecretProvider.d.ts +9 -0
  32. package/lib/envilder/core/domain/ports/ISecretProvider.d.ts.map +1 -1
  33. package/lib/envilder/core/infrastructure/aws/AwsSsmSecretProvider.d.ts +9 -0
  34. package/lib/envilder/core/infrastructure/aws/AwsSsmSecretProvider.d.ts.map +1 -1
  35. package/lib/envilder/core/infrastructure/aws/AwsSsmSecretProvider.js +81 -1
  36. package/lib/envilder/core/infrastructure/aws/AwsSsmSecretProvider.js.map +1 -1
  37. package/lib/envilder/core/infrastructure/azure/AzureKeyVaultSecretProvider.d.ts +11 -0
  38. package/lib/envilder/core/infrastructure/azure/AzureKeyVaultSecretProvider.d.ts.map +1 -1
  39. package/lib/envilder/core/infrastructure/azure/AzureKeyVaultSecretProvider.js +98 -0
  40. package/lib/envilder/core/infrastructure/azure/AzureKeyVaultSecretProvider.js.map +1 -1
  41. package/lib/envilder/core/infrastructure/github/GitHubActionsLogger.d.ts +16 -0
  42. package/lib/envilder/core/infrastructure/github/GitHubActionsLogger.d.ts.map +1 -0
  43. package/lib/envilder/core/infrastructure/github/GitHubActionsLogger.js +32 -0
  44. package/lib/envilder/core/infrastructure/github/GitHubActionsLogger.js.map +1 -0
  45. package/lib/envilder/core/types.d.ts +2 -0
  46. package/lib/envilder/core/types.d.ts.map +1 -1
  47. package/lib/envilder/core/types.js +1 -0
  48. package/lib/envilder/core/types.js.map +1 -1
  49. package/package.json +1 -1
package/README.md CHANGED
@@ -84,7 +84,7 @@ No SaaS middleman. One versioned mapping contract. Secrets stay in your cloud.
84
84
  | 📋 **Declarative Mapping** | One JSON file defines how application variables map to cloud secrets. Git-versioned, PR-reviewable, and diff-able |
85
85
  | ☁️ **Cloud-native Providers** | AWS SSM and Azure Key Vault today |
86
86
  | ⚡ **Exec Mode** | `envilder exec -- <command>` runs any command with the secrets in its environment. Nothing written to disk, fail-closed, exit codes propagated. [Guide](docs/exec-command.md) |
87
- | ✅ **Validate** | `envilder validate --offline` checks the map file against the schema and the provider rules, without credentials and without printing values. [Guide](docs/validate-command.md) |
87
+ | ✅ **Validate** | `envilder validate` checks the map file against the schema and the provider rules, then checks that every declared secret exists, without reading or printing values. `--offline` checks the map file only, without credentials. [Guide](docs/validate-command.md) |
88
88
  | 🔌 **Runtime SDKs** | Load secrets into memory at app startup: [.NET](./src/sdks/dotnet/README.md), [Python](./src/sdks/python/README.md), [Node.js](./src/sdks/nodejs/README.md). No `.env` on disk |
89
89
  | ⚙️ **GitHub Action** | Pull secrets in CI/CD. Same mapping, zero manual config |
90
90
  | 🔄 **Pull & Controlled Push** | Pull secrets to `.env`, or intentionally push local values to your cloud provider when bootstrapping or rotating |
package/ROADMAP.md CHANGED
@@ -52,7 +52,7 @@ Versions refer to each component's own changelog: [CLI](./docs/changelogs/cli.md
52
52
  | **Go SDK** (`envilder`) | 🔴 High | Runtime library for Go: cloud-native apps, Kubernetes tooling. Published as Go module ([#561](https://github.com/macalbert/envilder/issues/561) → [#562](https://github.com/macalbert/envilder/issues/562) → [#563](https://github.com/macalbert/envilder/issues/563)) |
53
53
  | **Java SDK** (`envilder`) | 🔴 High | Runtime library for Java/Kotlin: Spring Boot, Android backends. Published to Maven Central ([#569](https://github.com/macalbert/envilder/issues/569)) |
54
54
  | **SDK conformance tests** | 🔴 High | Language-agnostic test fixtures (JSON input → expected output) that all SDKs must pass |
55
- | **Validate command** (`envilder validate`) | 🟡 Medium | Preflight check: map file, remote key existence and optional `.env` comparison, without printing values. CLI first, then the SDKs ([#532](https://github.com/macalbert/envilder/issues/532)). The offline map file check (`--offline`) is available since CLI v0.18.0. [Guide](./docs/validate-command.md) |
55
+ | **Validate command** (`envilder validate`) | 🟡 Medium | Preflight check: map file, remote key existence and optional `.env` comparison, without printing values. CLI first, then the SDKs ([#532](https://github.com/macalbert/envilder/issues/532)). The offline map file check (`--offline`) is available since CLI v0.18.0, and the remote key existence check since v0.20.0. [Guide](./docs/validate-command.md) |
56
56
  | **GCP Secret Manager** | 🟡 Medium | Third cloud provider: similar DX to AWS SSM. Completes the multi-cloud trident (AWS + Azure + GCP) ([#573](https://github.com/macalbert/envilder/issues/573)) |
57
57
  | **AWS Secrets Manager** | 🟡 Medium | Support AWS Secrets Manager alongside SSM Parameter Store for teams using JSON-structured secrets |
58
58
 
@@ -5,6 +5,30 @@ For SDK-specific changes, see `sdk-dotnet.md`, `sdk-python.md`, or `sdk-nodejs.m
5
5
 
6
6
  ---
7
7
 
8
+ ## [0.20.0] - 2026-11-01
9
+
10
+ ### Added
11
+
12
+ * **`envilder validate` checks that every declared secret exists**: without
13
+ `--offline`, `validate` now asks the provider whether each secret path in
14
+ the map file exists, without reading any value, and lists every variable
15
+ with its path and status: `exists`, `missing`, `access denied` (never
16
+ reported as `missing`), `authentication failed` or `provider error`. A path
17
+ shared by several variables is checked once. It ends with
18
+ `✓ All N secrets exist` and exit code `0`, or with a summary such as
19
+ `✗ Validation failed: 2 missing, 1 access denied` and exit code `1`. An
20
+ invalid map file fails with the offline result and no provider is called.
21
+ Expired credentials and SSO sessions show the same message as a pull,
22
+ including the `aws sso login` recovery on a terminal. AWS SSM is checked
23
+ with `GetParameters` in batches of ten and `WithDecryption: false`, which
24
+ needs `ssm:GetParameters`; Azure Key Vault lists the vault's secret
25
+ metadata once, which needs the `List` secret permission (access policies)
26
+ or `secrets/readMetadata` (Azure RBAC, included in Key Vault Secrets User)
27
+ ([#558](https://github.com/macalbert/envilder/issues/558)).
28
+ [Guide](../validate-command.md)
29
+
30
+ ---
31
+
8
32
  ## [0.19.0] - 2026-10-30
9
33
 
10
34
  ### Changed
@@ -1,3 +1,15 @@
1
+ ## [0.20.0] - 2026-11-01
2
+
3
+ ### Changed
4
+
5
+ * **Secret existence check in the provider adapters**: The AWS SSM and Azure
6
+ Key Vault adapters bundled with the Action can now check whether secrets
7
+ exist without reading them, for the CLI's `envilder validate`. The Action
8
+ does not use it, and its behavior is unchanged
9
+ ([#558](https://github.com/macalbert/envilder/issues/558))
10
+
11
+ ---
12
+
1
13
  ## [0.19.0] - 2026-10-30
2
14
 
3
15
  ### Changed
@@ -2,34 +2,31 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- `envilder validate` is a preflight check for the map file. It answers *"is
6
- this map file valid?"* before a pull, a push or `envilder exec` runs, locally
7
- or as a CI step, and it never prints a secret value.
5
+ `envilder validate` is a preflight check. It answers *"is this map file
6
+ valid, and can every declared secret be resolved with the current
7
+ credentials?"* before a pull, a push or `envilder exec` runs, locally or as a
8
+ CI step. It never reads or prints a secret value.
8
9
 
9
10
  ```bash
11
+ envilder validate
12
+ envilder validate --map=config/envilder.json --profile=dev
13
+ envilder validate --provider=azure --vault-url=https://my-vault.vault.azure.net
10
14
  envilder validate --offline
11
- envilder validate --offline --map=config/envilder.json
12
- envilder validate --offline --provider=azure --vault-url=https://my-vault.vault.azure.net
13
15
  ```
14
16
 
15
- With `--offline`, only the map file is read: no provider is called and no
16
- cloud credentials are needed.
17
-
18
- > **Status:** `--offline` is the only mode available today. Checking that each
19
- > declared secret exists in the provider with the current credentials is
20
- > planned ([#558](https://github.com/macalbert/envilder/issues/558)). Until
21
- > then, `envilder validate` without `--offline` fails with a message that
22
- > points to `--offline`.
17
+ By default, `validate` checks the map file and then asks the provider whether
18
+ each declared secret exists. With `--offline`, only the map file is read: no
19
+ provider is called and no cloud credentials are needed.
23
20
 
24
21
  ## Usage
25
22
 
26
23
  ```text
27
- envilder validate --offline [--map <path>] [--provider <name>] [--profile <name>] [--vault-url <url>]
24
+ envilder validate [--offline] [--map <path>] [--provider <name>] [--profile <name>] [--vault-url <url>]
28
25
  ```
29
26
 
30
27
  | Option | Description |
31
28
  |--------|-------------|
32
- | `--offline` | Validate the map file locally without calling the provider. Required for now |
29
+ | `--offline` | Validate the map file locally without calling the provider |
33
30
  | `--map <path>` | Map file to check. Defaults to `envilder.json` in the current directory, as for pull and `exec` |
34
31
  | `--provider <name>` | Provider to check against: `aws` or `azure`. Overrides `$config.provider` |
35
32
  | `--profile <name>` | AWS CLI profile. Overrides `$config.profile` |
@@ -41,6 +38,8 @@ after `validate`; options written before it are rejected.
41
38
 
42
39
  ## What is checked
43
40
 
41
+ ### The map file (always)
42
+
44
43
  1. **The file parses as JSON.** A parse error is reported with the file path
45
44
  and, when the parser gives one, the line and column. The text around the
46
45
  error is never quoted, because it can be a secret pasted into the file.
@@ -62,22 +61,106 @@ after `validate`; options written before it are rejected.
62
61
  - `azure` has a `vaultUrl`.
63
62
 
64
63
  These are the same messages that pull, push and `exec` use for the same
65
- problems.
64
+ problems. Every problem found is reported, not only the first one, each with
65
+ the key that causes it (`$config.profile`, `--vault-url`, `DB_URL`, ...).
66
+ Messages name keys and types only, never mapped values.
67
+
68
+ When the map file is invalid, `validate` stops there: no provider is called,
69
+ with or without `--offline`.
70
+
71
+ ### The remote keys (without `--offline`)
72
+
73
+ Every secret path declared in the map file is checked in the provider, without
74
+ reading its value. A path that several variables map to is checked once. Each
75
+ variable gets one of these statuses:
76
+
77
+ | Status | Meaning |
78
+ |--------|---------|
79
+ | `exists` | The secret exists and the identity can see it |
80
+ | `missing` | The provider answered that there is no such secret |
81
+ | `access denied` | The identity is not allowed to check the secret, so whether it exists is unknown. Never reported as `missing` |
82
+ | `authentication failed` | The provider rejected the credentials, or none could be found |
83
+ | `provider error` | Anything else, for example an unreachable provider or an invalid secret name |
84
+
85
+ Expired AWS credentials and expired AWS SSO sessions are reported with the
86
+ same message as pull and `exec`. On an interactive terminal, an expired SSO
87
+ session offers to run `aws sso login` and then retries, as pull does.
88
+
89
+ #### AWS SSM Parameter Store
90
+
91
+ The paths are checked with
92
+ [`GetParameters`](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_GetParameters.html),
93
+ ten per call, with `WithDecryption: false`: SecureString parameters are never
94
+ decrypted, and the values returned are ignored. Names that do not exist come
95
+ back in `InvalidParameters` and are reported as `missing`. When a call is
96
+ denied, each path in it is checked on its own, so `access denied` is reported
97
+ only for the paths the identity cannot read.
98
+
99
+ The identity needs `ssm:GetParameters` on the parameters. This is a separate
100
+ IAM action from the `ssm:GetParameter` that pull uses, so add it to the
101
+ policy, scoped to the same paths:
102
+
103
+ ```json
104
+ {
105
+ "Effect": "Allow",
106
+ "Action": ["ssm:GetParameter", "ssm:GetParameters"],
107
+ "Resource": "arn:aws:ssm:*:*:parameter/myapp/*"
108
+ }
109
+ ```
110
+
111
+ No `kms:Decrypt` permission is needed for `validate`.
112
+
113
+ #### Azure Key Vault
66
114
 
67
- Every problem found is reported, not only the first one, each with the key
68
- that causes it (`$config.profile`, `--vault-url`, `DB_URL`, ...). Messages
69
- name keys and types only, never mapped values.
115
+ The vault's secret names are listed once with
116
+ [`Get Secrets`](https://learn.microsoft.com/rest/api/keyvault/secrets/get-secrets/get-secrets),
117
+ which returns metadata only, and each declared name (after the usual `/` to `-`
118
+ translation) is matched against it, ignoring case as Key Vault does. A
119
+ disabled secret cannot be read by pull, so it is reported as `missing`.
120
+
121
+ Listing needs a permission that pull does not:
122
+
123
+ - **Azure RBAC:** `Microsoft.KeyVault/vaults/secrets/readMetadata/action`,
124
+ which the built-in **Key Vault Secrets User** and **Key Vault Reader** roles
125
+ include, assigned on the vault.
126
+ - **Access policies:** the `List` secret permission, besides `Get`.
127
+
128
+ Because the list covers the whole vault, an identity without it gets
129
+ `access denied` for every key, with the reason Key Vault returns.
70
130
 
71
131
  ## Output
72
132
 
73
- A valid map file:
133
+ Every secret exists (exit code `0`):
134
+
135
+ ```text
136
+ ✓ Map file valid: envilder.json
137
+ Checking 3 secrets in aws, profile=dev
138
+ ✓ DB_URL /myapp/db-url exists
139
+ ✓ DATABASE_URL /myapp/db-url exists
140
+ ✓ API_KEY /myapp/api-key exists
141
+ ✓ All 3 secrets exist
142
+ ```
143
+
144
+ Some secrets are missing or cannot be checked (exit code `1`; the summary goes
145
+ to stderr):
146
+
147
+ ```text
148
+ ✓ Map file valid: envilder.json
149
+ Checking 3 secrets in aws, profile=dev
150
+ ✓ DB_URL /myapp/db-url exists
151
+ ✗ API_KEY /myapp/api-key missing
152
+ ✗ TOKEN /myapp/token access denied (User: arn:aws:sts::123456789012:assumed-role/dev/ci is not authorized to perform: ssm:GetParameters ...)
153
+ ✗ Validation failed: 1 missing, 1 access denied
154
+ ```
155
+
156
+ With `--offline`:
74
157
 
75
158
  ```text
76
159
  ✓ Map file valid: envilder.json
77
160
  Remote validation skipped (--offline): no provider was called, so the secrets were not checked.
78
161
  ```
79
162
 
80
- An invalid one, on stderr:
163
+ An invalid map file, on stderr:
81
164
 
82
165
  ```text
83
166
  ✗ Map file invalid: envilder.json (3 problems)
@@ -90,18 +173,22 @@ An invalid one, on stderr:
90
173
 
91
174
  | Code | Meaning |
92
175
  |------|---------|
93
- | `0` | The map file is valid |
94
- | `1` | The map file is missing, is not valid JSON, breaks the schema or the provider rules, or the options are invalid |
176
+ | `0` | The map file is valid and, without `--offline`, every declared secret exists |
177
+ | `1` | Anything else: the map file is missing, is not valid JSON, breaks the schema or the provider rules, the options are invalid, a secret is missing or cannot be checked, or the credentials are missing or expired |
95
178
 
96
179
  ## In CI
97
180
 
98
181
  ```yaml
99
182
  - name: Check the map file
100
183
  run: npx envilder validate --offline --map=envilder.json
184
+
185
+ - name: Check that every secret exists
186
+ run: npx envilder validate --map=envilder.json
101
187
  ```
102
188
 
103
- The step needs no cloud credentials, so it can run on every pull request,
104
- including from forks.
189
+ The offline step needs no cloud credentials, so it can run on every pull
190
+ request, including from forks. The second step needs the same credentials as
191
+ a pull, plus the permissions listed above.
105
192
 
106
193
  ## What validate does not do
107
194
 
@@ -1,5 +1,6 @@
1
1
  import { Container } from 'inversify';
2
2
  import type { MapFileConfig } from '../../core/domain/MapFileConfig.js';
3
+ import type { ILogger } from '../../core/domain/ports/ILogger.js';
3
4
  import type { ISecretMasker } from '../../core/domain/ports/ISecretMasker.js';
4
5
  export declare class Startup {
5
6
  private readonly container;
@@ -7,18 +8,24 @@ export declare class Startup {
7
8
  static build(): Startup;
8
9
  configureServices(): this;
9
10
  /**
10
- * Wires the services specific to `envilder exec`: its handler, a logger that keeps
11
- * stdout free for the child, the process runner, and the given secret
12
- * masker. Call it before `configureInfrastructure`, which only binds the
13
- * defaults left unbound.
11
+ * Wires the services specific to `envilder exec`: its handler, the process
12
+ * runner, and the given logger and secret masker. The logger must keep
13
+ * stdout free for the child. Call it before `configureInfrastructure`,
14
+ * which only binds the defaults left unbound.
14
15
  */
15
- configureExec(secretMasker: ISecretMasker): this;
16
+ configureExec(secretMasker: ISecretMasker, logger: ILogger): this;
16
17
  /**
17
18
  * Wires `envilder validate --offline`: the map file is read and checked
18
19
  * locally, so no secret provider is bound. Use it instead of
19
20
  * `configureServices` and `configureInfrastructure`.
20
21
  */
21
22
  configureOfflineValidation(): this;
23
+ /**
24
+ * Wires the remote part of `envilder validate`, which checks that each
25
+ * declared secret exists. Call `configureInfrastructure` afterwards to bind
26
+ * the secret provider, the logger and the variable store.
27
+ */
28
+ configureRemoteValidation(): this;
22
29
  configureInfrastructure(config?: MapFileConfig): this;
23
30
  create(): Container;
24
31
  getServiceProvider(): Container;
@@ -1 +1 @@
1
- {"version":3,"file":"Startup.d.ts","sourceRoot":"","sources":["../../../../src/envilder/apps/cli/Startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAIxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAa9E,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IAEtC,cAEC;IAED,MAAM,CAAC,KAAK,IAAI,OAAO,CAEtB;IAED,iBAAiB,IAAI,IAAI,CAGxB;IAED;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,aAAa,GAAG,IAAI,CAqB/C;IAED;;;;OAIG;IACH,0BAA0B,IAAI,IAAI,CAcjC;IAED,uBAAuB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CAGpD;IAED,MAAM,IAAI,SAAS,CAElB;IAED,kBAAkB,IAAI,SAAS,CAE9B;CACF"}
1
+ {"version":3,"file":"Startup.d.ts","sourceRoot":"","sources":["../../../../src/envilder/apps/cli/Startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAGlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAY9E,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IAEtC,cAEC;IAED,MAAM,CAAC,KAAK,IAAI,OAAO,CAEtB;IAED,iBAAiB,IAAI,IAAI,CAGxB;IAED;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAkBhE;IAED;;;;OAIG;IACH,0BAA0B,IAAI,IAAI,CAcjC;IAED;;;;OAIG;IACH,yBAAyB,IAAI,IAAI,CAQhC;IAED,uBAAuB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CAGpD;IAED,MAAM,IAAI,SAAS,CAElB;IAED,kBAAkB,IAAI,SAAS,CAE9B;CACF"}
@@ -1,8 +1,8 @@
1
1
  import { Container } from 'inversify';
2
2
  import { ExecWithSecretsCommandHandler } from '../../core/application/execWithSecrets/ExecWithSecretsCommandHandler.js';
3
3
  import { ValidateMapFileCommandHandler } from '../../core/application/validateMapFile/ValidateMapFileCommandHandler.js';
4
+ import { ValidateRemoteKeysCommandHandler } from '../../core/application/validateRemoteKeys/ValidateRemoteKeysCommandHandler.js';
4
5
  import { ConsoleLogger } from '../../core/infrastructure/logger/ConsoleLogger.js';
5
- import { StderrConsoleLogger } from '../../core/infrastructure/logger/StderrConsoleLogger.js';
6
6
  import { CrossSpawnProcessRunner } from '../../core/infrastructure/process/CrossSpawnProcessRunner.js';
7
7
  import { NodeProcessContext } from '../../core/infrastructure/process/NodeProcessContext.js';
8
8
  import { FileVariableStore } from '../../core/infrastructure/variableStore/FileVariableStore.js';
@@ -20,16 +20,13 @@ export class Startup {
20
20
  return this;
21
21
  }
22
22
  /**
23
- * Wires the services specific to `envilder exec`: its handler, a logger that keeps
24
- * stdout free for the child, the process runner, and the given secret
25
- * masker. Call it before `configureInfrastructure`, which only binds the
26
- * defaults left unbound.
23
+ * Wires the services specific to `envilder exec`: its handler, the process
24
+ * runner, and the given logger and secret masker. The logger must keep
25
+ * stdout free for the child. Call it before `configureInfrastructure`,
26
+ * which only binds the defaults left unbound.
27
27
  */
28
- configureExec(secretMasker) {
29
- this.container
30
- .bind(TYPES.ILogger)
31
- .to(StderrConsoleLogger)
32
- .inSingletonScope();
28
+ configureExec(secretMasker, logger) {
29
+ this.container.bind(TYPES.ILogger).toConstantValue(logger);
33
30
  this.container
34
31
  .bind(TYPES.ISecretMasker)
35
32
  .toConstantValue(secretMasker);
@@ -67,6 +64,18 @@ export class Startup {
67
64
  .inTransientScope();
68
65
  return this;
69
66
  }
67
+ /**
68
+ * Wires the remote part of `envilder validate`, which checks that each
69
+ * declared secret exists. Call `configureInfrastructure` afterwards to bind
70
+ * the secret provider, the logger and the variable store.
71
+ */
72
+ configureRemoteValidation() {
73
+ this.container
74
+ .bind(TYPES.ValidateRemoteKeysCommandHandler)
75
+ .to(ValidateRemoteKeysCommandHandler)
76
+ .inTransientScope();
77
+ return this;
78
+ }
70
79
  configureInfrastructure(config) {
71
80
  configureInfrastructureServices(this.container, config);
72
81
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"Startup.js","sourceRoot":"","s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EAAE,CAAC,6BAA6B,CAAC;aACjC,gBAAgB,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,0BAA0B;QACxB,IAAI,CAAC,SAAS;aACX,IAAI,CAAU,KAAK,CAAC,OAAO,CAAC;aAC5B,EAAE,CAAC,aAAa,CAAC;aACjB,gBAAgB,EAAE,CAAC;QACtB,IAAI,CAAC,SAAS;aACX,IAAI,CAAiB,KAAK,CAAC,cAAc,CAAC;aAC1C,EAAE,CAAC,iBAAiB,CAAC;aACrB,gBAAgB,EAAE,CAAC;QACtB,IAAI,CAAC,SAAS;aACX,IAAI,CAAgC,KAAK,CAAC,6BAA6B,CAAC;aACxE,EAAE,CAAC,6BAA6B,CAAC;aACjC,gBAAgB,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,yBAAyB;QACvB,IAAI,CAAC,SAAS;aACX,IAAI,CACH,KAAK,CAAC,gCAAgC,CACvC;aACA,EAAE,CAAC,gCAAgC,CAAC;aACpC,gBAAgB,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uBAAuB,CAAC,MAAsB;QAC5C,+BAA+B,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Cli.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/apps/cli/entry/Cli.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAuF1B,wBAAsB,IAAI,kBA6MzB"}
1
+ {"version":3,"file":"Cli.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/apps/cli/entry/Cli.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAgG1B,wBAAsB,IAAI,kBA6MzB"}
@@ -27,12 +27,16 @@ import pc from 'picocolors';
27
27
  import { DispatchActionCommand } from '../../../core/application/dispatch/DispatchActionCommand.js';
28
28
  import { formatArgument, formatProgram, } from '../../../core/application/execWithSecrets/CommandLineFormatter.js';
29
29
  import { ValidateMapFileCommand } from '../../../core/application/validateMapFile/ValidateMapFileCommand.js';
30
+ import { ValidateRemoteKeysCommand } from '../../../core/application/validateRemoteKeys/ValidateRemoteKeysCommand.js';
30
31
  import { EXEC_COMMAND_NOT_EXECUTABLE, EXEC_COMMAND_NOT_FOUND, EXEC_ENVILDER_FAILURE, } from '../../../core/domain/ExecExitCode.js';
31
32
  import { CommandNotExecutableError, CommandNotFoundError, InvalidArgumentError, } from '../../../core/domain/errors/DomainErrors.js';
32
33
  import { resolveMapFileTarget } from '../../../core/domain/MapFileUpdate.js';
33
34
  import { OperationMode } from '../../../core/domain/OperationMode.js';
35
+ import { describeSecretExistenceStatus, summarizeFailures, } from '../../../core/domain/SecretExistence.js';
36
+ import { GitHubActionsLogger } from '../../../core/infrastructure/github/GitHubActionsLogger.js';
34
37
  import { GitHubActionsSecretMasker } from '../../../core/infrastructure/github/GitHubActionsSecretMasker.js';
35
38
  import { NoOpSecretMasker } from '../../../core/infrastructure/github/NoOpSecretMasker.js';
39
+ import { StderrConsoleLogger } from '../../../core/infrastructure/logger/StderrConsoleLogger.js';
36
40
  import { PackageVersionReader } from '../../../core/infrastructure/package/PackageVersionReader.js';
37
41
  import { readMapFileConfig } from '../../../core/infrastructure/variableStore/FileVariableStore.js';
38
42
  import { TYPES } from '../../../core/types.js';
@@ -86,8 +90,8 @@ export function main() {
86
90
  ${pc.yellow('>')} ${pc.bold('Run a command with secrets')} ${pc.dim('(nothing written to disk)')}
87
91
  ${pc.cyan('envilder exec -- npm run dev')} ${pc.dim('# see: envilder exec --help')}
88
92
 
89
- ${pc.green('>')} ${pc.bold('Check the map file')} ${pc.dim('(no secret is read)')}
90
- ${pc.cyan('envilder validate --offline')} ${pc.dim('# see: envilder validate --help')}
93
+ ${pc.green('>')} ${pc.bold('Check the map file and its secrets')} ${pc.dim('(no value is read)')}
94
+ ${pc.cyan('envilder validate')} ${pc.dim('# see: envilder validate --help')}
91
95
  `;
92
96
  program
93
97
  .name('envilder')
@@ -311,11 +315,13 @@ function registerValidateCommand(program) {
311
315
  .summary('Check the map file before pulling, pushing or running a command')
312
316
  .description('Check that the map file is valid JSON, matches the map file schema, ' +
313
317
  'and resolves to a coherent provider configuration (flags take ' +
314
- 'precedence over $config). Every problem is reported with the key ' +
315
- 'that causes it. Secret values are never printed.\n\n' +
318
+ 'precedence over $config), then check that every secret it declares ' +
319
+ 'exists in the provider with the current credentials. Every problem ' +
320
+ 'is reported with the key that causes it. Secret values are never ' +
321
+ 'read or printed.\n\n' +
316
322
  'With --offline nothing but the map file is read: no provider is ' +
317
323
  'called and no credentials are needed.')
318
- .option('--offline', 'Validate the map file locally without calling the provider (required for now)')
324
+ .option('--offline', 'Validate the map file locally without calling the provider')
319
325
  .option('--map <path>', `Path to the JSON file with environment variable mapping (default: ${DEFAULT_MAP_FILE})`)
320
326
  .option('--profile <name>', 'AWS CLI profile to use (optional)')
321
327
  .option('--provider <name>', 'Cloud provider to use: aws or azure (default: aws)')
@@ -325,14 +331,11 @@ function registerValidateCommand(program) {
325
331
  var _a;
326
332
  var _b;
327
333
  rejectRootOptionsBeforeValidate(((_b = (_a = validateCommand.parent) === null || _a === void 0 ? void 0 : _a.opts()) !== null && _b !== void 0 ? _b : {}));
328
- if (!options.offline) {
329
- console.error(pc.red('error: envilder validate only supports --offline for now: ' +
330
- 'checking that each secret exists in the provider is not ' +
331
- 'available yet. Run "envilder validate --offline" to check the ' +
332
- 'map file without calling the provider.'));
333
- throw new SilentExitError(1);
334
+ if (options.offline) {
335
+ yield runOfflineValidation(options);
336
+ return;
334
337
  }
335
- yield runOfflineValidation(options);
338
+ yield runRemoteValidation(options);
336
339
  }));
337
340
  validate.configureOutput({
338
341
  outputError: (message, write) => write(redactParseError(message, knownOptionsOf(validate))),
@@ -341,13 +344,15 @@ function registerValidateCommand(program) {
341
344
  }
342
345
  const VALIDATE_HELP = `
343
346
  Examples:
347
+ envilder validate
348
+ envilder validate --map=config/envilder.json --profile=dev
349
+ envilder validate --provider=azure --vault-url=https://my-vault.vault.azure.net
344
350
  envilder validate --offline
345
- envilder validate --offline --map=config/envilder.json
346
- envilder validate --offline --provider=azure --vault-url=https://my-vault.vault.azure.net
347
351
 
348
352
  Exit codes:
349
- 0 the map file is valid
350
- 1 the map file or the options are not valid
353
+ 0 the map file is valid and every declared secret exists
354
+ 1 the map file or the options are not valid, a secret is missing or
355
+ cannot be checked, or the credentials are missing or expired
351
356
 
352
357
  See docs/validate-command.md.`;
353
358
  /**
@@ -368,6 +373,18 @@ function rejectRootOptionsBeforeValidate(rootOptions) {
368
373
  throw new SilentExitError(1);
369
374
  }
370
375
  function runOfflineValidation(options) {
376
+ return __awaiter(this, void 0, void 0, function* () {
377
+ yield validateMapFileOffline(options);
378
+ console.log(pc.dim(' Remote validation skipped (--offline): no provider was called, so ' +
379
+ 'the secrets were not checked.'));
380
+ });
381
+ }
382
+ /**
383
+ * Checks the map file without calling any provider. Prints the result and
384
+ * returns the map file path when it is valid; reports every violation and
385
+ * exits with 1 otherwise.
386
+ */
387
+ function validateMapFileOffline(options) {
371
388
  return __awaiter(this, void 0, void 0, function* () {
372
389
  const mapPath = resolveMapFile(options.map);
373
390
  const container = Startup.build().configureOfflineValidation().create();
@@ -386,10 +403,54 @@ function runOfflineValidation(options) {
386
403
  throw new SilentExitError(1);
387
404
  }
388
405
  console.log(pc.green(`✓ Map file valid: ${mapPath}`));
389
- console.log(pc.dim(' Remote validation skipped (--offline): no provider was called, so ' +
390
- 'the secrets were not checked.'));
406
+ return mapPath;
407
+ });
408
+ }
409
+ /**
410
+ * Validates the map file offline first, so an invalid file never reaches the
411
+ * provider, then checks that every declared secret exists. Lists each
412
+ * variable with its path and status; values are never read.
413
+ */
414
+ function runRemoteValidation(options) {
415
+ return __awaiter(this, void 0, void 0, function* () {
416
+ const mapPath = yield validateMapFileOffline(options);
417
+ const fileConfig = yield readMapFileConfig(mapPath);
418
+ const config = Object.assign(Object.assign(Object.assign(Object.assign({}, fileConfig), (options.provider && { provider: options.provider })), (options.vaultUrl && { vaultUrl: options.vaultUrl })), (options.profile && { profile: options.profile }));
419
+ const container = Startup.build()
420
+ .configureRemoteValidation()
421
+ .configureInfrastructure(config)
422
+ .create();
423
+ const handler = container.get(TYPES.ValidateRemoteKeysCommandHandler);
424
+ let checks = [];
425
+ yield executeWithSsoRecovery(() => __awaiter(this, void 0, void 0, function* () {
426
+ checks = yield handler.handle(ValidateRemoteKeysCommand.create(mapPath));
427
+ }));
428
+ printRemoteKeyChecks(checks, describeSecretSource(config));
429
+ const failures = summarizeFailures(checks);
430
+ if (failures !== '') {
431
+ console.error(pc.red(`✗ Validation failed: ${failures}`));
432
+ throw new SilentExitError(1);
433
+ }
391
434
  });
392
435
  }
436
+ function printRemoteKeyChecks(checks, source) {
437
+ const count = checks.length === 1 ? '1 secret' : `${checks.length} secrets`;
438
+ console.log(pc.bold(`Checking ${count} in ${source}`));
439
+ const variableWidth = Math.max(0, ...checks.map((c) => c.variable.length));
440
+ const pathWidth = Math.max(0, ...checks.map((c) => c.path.length));
441
+ for (const check of checks) {
442
+ const exists = check.status === 'exists';
443
+ const status = describeSecretExistenceStatus(check.status);
444
+ const reason = check.reason === undefined ? '' : pc.dim(` (${check.reason})`);
445
+ console.log(` ${exists ? pc.green('✓') : pc.red('✗')} ` +
446
+ `${pc.bold(check.variable.padEnd(variableWidth))} ` +
447
+ `${pc.dim(check.path.padEnd(pathWidth))} ` +
448
+ `${exists ? pc.green(status) : pc.red(status)}${reason}`);
449
+ }
450
+ if (summarizeFailures(checks) === '') {
451
+ console.log(pc.green(checks.length === 1 ? '✓ 1 secret exists' : `✓ All ${count} exist`));
452
+ }
453
+ }
393
454
  const EXEC_HELP = `
394
455
  Examples:
395
456
  envilder exec -- npm run dev
@@ -500,7 +561,7 @@ function resolveSecretsAndRun(commandName, childArgs, options) {
500
561
  const fileConfig = yield readMapFileConfig(mapPath);
501
562
  const config = Object.assign(Object.assign(Object.assign(Object.assign({}, fileConfig), (options.provider && { provider: options.provider })), (options.vaultUrl && { vaultUrl: options.vaultUrl })), (options.profile && { profile: options.profile }));
502
563
  const container = Startup.build()
503
- .configureExec(createExecSecretMasker())
564
+ .configureExec(createExecSecretMasker(), createExecLogger())
504
565
  .configureServices()
505
566
  .configureInfrastructure(config)
506
567
  .create();
@@ -542,20 +603,31 @@ function dispatchExec(dispatcher, command) {
542
603
  return exitCode;
543
604
  });
544
605
  }
606
+ /**
607
+ * Writes through the exec logger, which may fail before the container
608
+ * exists (reading the map file), so input-derived text in the message is
609
+ * escaped like any other exec output under GitHub Actions.
610
+ */
545
611
  function reportExecFailure(error) {
546
612
  if (error instanceof SilentExitError) {
547
613
  // SSO recovery was declined or failed and already explained why.
548
614
  return EXEC_ENVILDER_FAILURE;
549
615
  }
616
+ const logger = createExecLogger();
617
+ const logLines = (text) => {
618
+ for (const line of text.split('\n')) {
619
+ logger.error(line);
620
+ }
621
+ };
550
622
  if (error instanceof CommandNotFoundError) {
551
- console.error(pc.red(error.message));
623
+ logLines(pc.red(error.message));
552
624
  return EXEC_COMMAND_NOT_FOUND;
553
625
  }
554
626
  if (error instanceof CommandNotExecutableError) {
555
- console.error(pc.red(error.message));
627
+ logLines(pc.red(error.message));
556
628
  return EXEC_COMMAND_NOT_EXECUTABLE;
557
629
  }
558
- console.error(presentError(error));
630
+ logLines(presentError(error));
559
631
  return EXEC_ENVILDER_FAILURE;
560
632
  }
561
633
  function describeSecretSource(config) {
@@ -583,6 +655,16 @@ function createExecSecretMasker() {
583
655
  ? new GitHubActionsSecretMasker({ stream: process.stderr })
584
656
  : new NoOpSecretMasker();
585
657
  }
658
+ /**
659
+ * Exec logs to stderr, keeping stdout for the child. Under GitHub Actions
660
+ * each message stays one inert line, so input-derived text cannot issue
661
+ * workflow commands ahead of the mask registrations.
662
+ */
663
+ function createExecLogger() {
664
+ return process.env.GITHUB_ACTIONS === 'true'
665
+ ? new GitHubActionsLogger(new StderrConsoleLogger())
666
+ : new StderrConsoleLogger();
667
+ }
586
668
  /**
587
669
  * The vault origin to log, never the full URL, which can carry credentials.
588
670
  * `undefined` when the URL does not parse: the Azure client reports that.