envilder 0.17.1 → 0.18.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 (52) hide show
  1. package/README.md +2 -0
  2. package/ROADMAP.md +1 -1
  3. package/docs/changelogs/cli.md +34 -0
  4. package/docs/changelogs/gha.md +24 -0
  5. package/docs/changelogs/sdk-python.md +8 -8
  6. package/docs/validate-command.md +111 -0
  7. package/lib/envilder/apps/cli/Startup.d.ts +6 -0
  8. package/lib/envilder/apps/cli/Startup.d.ts.map +1 -1
  9. package/lib/envilder/apps/cli/Startup.js +23 -0
  10. package/lib/envilder/apps/cli/Startup.js.map +1 -1
  11. package/lib/envilder/apps/cli/entry/Cli.d.ts.map +1 -1
  12. package/lib/envilder/apps/cli/entry/Cli.js +93 -1
  13. package/lib/envilder/apps/cli/entry/Cli.js.map +1 -1
  14. package/lib/envilder/apps/shared/ContainerConfiguration.d.ts +2 -0
  15. package/lib/envilder/apps/shared/ContainerConfiguration.d.ts.map +1 -1
  16. package/lib/envilder/apps/shared/ContainerConfiguration.js +5 -4
  17. package/lib/envilder/apps/shared/ContainerConfiguration.js.map +1 -1
  18. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommand.d.ts +15 -0
  19. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommand.d.ts.map +1 -0
  20. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommand.js +17 -0
  21. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommand.js.map +1 -0
  22. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommandHandler.d.ts +16 -0
  23. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommandHandler.d.ts.map +1 -0
  24. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommandHandler.js +86 -0
  25. package/lib/envilder/core/application/validateMapFile/ValidateMapFileCommandHandler.js.map +1 -0
  26. package/lib/envilder/core/domain/EnvironmentVariableName.d.ts +5 -0
  27. package/lib/envilder/core/domain/EnvironmentVariableName.d.ts.map +1 -1
  28. package/lib/envilder/core/domain/EnvironmentVariableName.js +5 -1
  29. package/lib/envilder/core/domain/EnvironmentVariableName.js.map +1 -1
  30. package/lib/envilder/core/domain/MapFileValidator.d.ts +28 -0
  31. package/lib/envilder/core/domain/MapFileValidator.d.ts.map +1 -0
  32. package/lib/envilder/core/domain/MapFileValidator.js +195 -0
  33. package/lib/envilder/core/domain/MapFileValidator.js.map +1 -0
  34. package/lib/envilder/core/domain/ProviderConfiguration.d.ts +22 -0
  35. package/lib/envilder/core/domain/ProviderConfiguration.d.ts.map +1 -0
  36. package/lib/envilder/core/domain/ProviderConfiguration.js +65 -0
  37. package/lib/envilder/core/domain/ProviderConfiguration.js.map +1 -0
  38. package/lib/envilder/core/infrastructure/azure/AzureSecretProviderFactory.d.ts.map +1 -1
  39. package/lib/envilder/core/infrastructure/azure/AzureSecretProviderFactory.js +2 -3
  40. package/lib/envilder/core/infrastructure/azure/AzureSecretProviderFactory.js.map +1 -1
  41. package/lib/envilder/core/infrastructure/variableStore/EnvFileParser.d.ts.map +1 -1
  42. package/lib/envilder/core/infrastructure/variableStore/EnvFileParser.js +9 -3
  43. package/lib/envilder/core/infrastructure/variableStore/EnvFileParser.js.map +1 -1
  44. package/lib/envilder/core/infrastructure/variableStore/FileVariableStore.d.ts +4 -5
  45. package/lib/envilder/core/infrastructure/variableStore/FileVariableStore.d.ts.map +1 -1
  46. package/lib/envilder/core/infrastructure/variableStore/FileVariableStore.js +17 -13
  47. package/lib/envilder/core/infrastructure/variableStore/FileVariableStore.js.map +1 -1
  48. package/lib/envilder/core/types.d.ts +2 -0
  49. package/lib/envilder/core/types.d.ts.map +1 -1
  50. package/lib/envilder/core/types.js +1 -0
  51. package/lib/envilder/core/types.js.map +1 -1
  52. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidateMapFileCommand.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/application/validateMapFile/ValidateMapFileCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,qBAAa,sBAAsB;aAEf,OAAO,EAAE,MAAM;IAC/B,4EAA4E;aAC5D,SAAS,EAAE,aAAa;IACxC,yDAAyD;aACzC,kBAAkB,EAAE,SAAS,MAAM,EAAE;IALvD,YACkB,OAAO,EAAE,MAAM;IAC/B,4EAA4E;IAC5D,SAAS,EAAE,aAAa;IACxC,yDAAyD;IACzC,kBAAkB,EAAE,SAAS,MAAM,EAAE,EACnD;IAEJ,MAAM,CAAC,MAAM,CACX,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,SAAS,MAAM,EAAE,GACpC,sBAAsB,CAIxB;CACF"}
@@ -0,0 +1,17 @@
1
+ export class ValidateMapFileCommand {
2
+ constructor(mapPath,
3
+ /** Provider options given as flags; they take precedence over `$config`. */
4
+ overrides,
5
+ /** The providers the caller can resolve secrets from. */
6
+ supportedProviders) {
7
+ this.mapPath = mapPath;
8
+ this.overrides = overrides;
9
+ this.supportedProviders = supportedProviders;
10
+ }
11
+ static create(mapPath, overrides, supportedProviders) {
12
+ return new ValidateMapFileCommand(mapPath, Object.assign({}, overrides), [
13
+ ...supportedProviders,
14
+ ]);
15
+ }
16
+ }
17
+ //# sourceMappingURL=ValidateMapFileCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidateMapFileCommand.js","sourceRoot":"","sources":["../../../../../src/envilder/core/application/validateMapFile/ValidateMapFileCommand.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,sBAAsB;IACjC,YACkB,OAAe;IAC/B,4EAA4E;IAC5D,SAAwB;IACxC,yDAAyD;IACzC,kBAAqC;uBAJrC,OAAO;yBAEP,SAAS;kCAET,kBAAkB;IACjC,CAAC;IAEJ,MAAM,CAAC,MAAM,CACX,OAAe,EACf,SAAwB,EACxB,kBAAqC;QAErC,OAAO,IAAI,sBAAsB,CAAC,OAAO,oBAAO,SAAS,GAAI;YAC3D,GAAG,kBAAkB;SACtB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import { type MapFileViolation } from '../../domain/MapFileValidator.js';
2
+ import type { IVariableStore } from '../../domain/ports/IVariableStore.js';
3
+ import type { ValidateMapFileCommand } from './ValidateMapFileCommand.js';
4
+ /**
5
+ * Checks a map file without calling any provider: the JSON parses, the
6
+ * document matches `spec/map-file.v1.json`, and the provider configuration
7
+ * it resolves to (flags over `$config`) is coherent. Returns every violation
8
+ * found, an empty list when the file is usable. Only the file is read, and no
9
+ * mapped value ever reaches a violation.
10
+ */
11
+ export declare class ValidateMapFileCommandHandler {
12
+ private readonly variableStore;
13
+ constructor(variableStore: IVariableStore);
14
+ handle(command: ValidateMapFileCommand): Promise<MapFileViolation[]>;
15
+ }
16
+ //# sourceMappingURL=ValidateMapFileCommandHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidateMapFileCommandHandler.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/application/validateMapFile/ValidateMapFileCommandHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;;GAMG;AACH,qBACa,6BAA6B;IAGtC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAFhC,YAEmB,aAAa,EAAE,cAAc,EAC5C;IAEE,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA4BzE;CACF"}
@@ -0,0 +1,86 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ import { inject, injectable } from 'inversify';
23
+ import { EnvironmentFileError } from '../../domain/errors/DomainErrors.js';
24
+ import { validateMapFile, } from '../../domain/MapFileValidator.js';
25
+ import { TYPES } from '../../types.js';
26
+ /**
27
+ * Checks a map file without calling any provider: the JSON parses, the
28
+ * document matches `spec/map-file.v1.json`, and the provider configuration
29
+ * it resolves to (flags over `$config`) is coherent. Returns every violation
30
+ * found, an empty list when the file is usable. Only the file is read, and no
31
+ * mapped value ever reaches a violation.
32
+ */
33
+ let ValidateMapFileCommandHandler = class ValidateMapFileCommandHandler {
34
+ constructor(variableStore) {
35
+ this.variableStore = variableStore;
36
+ }
37
+ handle(command) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const content = yield this.variableStore.readMapFileContent(command.mapPath);
40
+ if (content === null) {
41
+ throw new EnvironmentFileError(`Failed to read map file: ${command.mapPath}`);
42
+ }
43
+ let document;
44
+ try {
45
+ document = JSON.parse(content);
46
+ }
47
+ catch (error) {
48
+ return [
49
+ {
50
+ key: '(root)',
51
+ message: `Invalid JSON in parameter map file: ${command.mapPath}` +
52
+ describeParseLocation(error),
53
+ },
54
+ ];
55
+ }
56
+ return validateMapFile(document, {
57
+ overrides: command.overrides,
58
+ supportedProviders: command.supportedProviders,
59
+ });
60
+ });
61
+ }
62
+ };
63
+ ValidateMapFileCommandHandler = __decorate([
64
+ injectable(),
65
+ __param(0, inject(TYPES.IVariableStore)),
66
+ __metadata("design:paramtypes", [Object])
67
+ ], ValidateMapFileCommandHandler);
68
+ export { ValidateMapFileCommandHandler };
69
+ /**
70
+ * Where parsing stopped, never what it found there: the parser's own message
71
+ * quotes the surrounding text, which can be a mapped value or a secret pasted
72
+ * into the file.
73
+ */
74
+ function describeParseLocation(error) {
75
+ const message = error instanceof Error ? error.message : '';
76
+ const lineAndColumn = /line (\d+) column (\d+)/.exec(message);
77
+ if (lineAndColumn !== null) {
78
+ return ` (line ${lineAndColumn[1]}, column ${lineAndColumn[2]})`;
79
+ }
80
+ const position = /at position (\d+)/.exec(message);
81
+ if (position !== null) {
82
+ return ` (at position ${position[1]})`;
83
+ }
84
+ return '';
85
+ }
86
+ //# sourceMappingURL=ValidateMapFileCommandHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidateMapFileCommandHandler.js","sourceRoot":"","sources":["../../../../../src/envilder/core/application/validateMapFile/ValidateMapFileCommandHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEL,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC;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,aAAa,CAAC,CAAC,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;IACnE,CAAC;IACD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,iBAAiB,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -13,4 +13,9 @@ export declare function invalidEnvironmentVariableNameMessage(name: string): str
13
13
  * loads. Names only, quoted for the same reason as the rejection message.
14
14
  */
15
15
  export declare function nonPortableEnvFileNamesMessage(names: string[]): string;
16
+ /**
17
+ * Quotes an untrusted name for a message, so a name carrying a line
18
+ * terminator cannot break the message across lines.
19
+ */
20
+ export declare function quoteName(name: string): string;
16
21
  //# sourceMappingURL=EnvironmentVariableName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariableName.d.ts","sourceRoot":"","sources":["../../../../src/envilder/core/domain/EnvironmentVariableName.ts"],"names":[],"mappings":"AAmDA,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpE;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB1E;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAQtE"}
1
+ {"version":3,"file":"EnvironmentVariableName.d.ts","sourceRoot":"","sources":["../../../../src/envilder/core/domain/EnvironmentVariableName.ts"],"names":[],"mappings":"AAmDA,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMpE;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB1E;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAQtE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM9C"}
@@ -85,7 +85,11 @@ export function nonPortableEnvFileNamesMessage(names) {
85
85
  'If your app reads the .env file with one of those, use "envilder exec" ' +
86
86
  'or rename them with "__" (Database__Password)');
87
87
  }
88
- function quoteName(name) {
88
+ /**
89
+ * Quotes an untrusted name for a message, so a name carrying a line
90
+ * terminator cannot break the message across lines.
91
+ */
92
+ export function quoteName(name) {
89
93
  // JSON.stringify escapes CR, LF and the other control characters, but leaves
90
94
  // U+2028/U+2029 literal even though they terminate a line in JavaScript.
91
95
  return JSON.stringify(name)
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariableName.js","sourceRoot":"","sources":["../../../../src/envilder/core/domain/EnvironmentVariableName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAEjD,MAAM,UAAU,8BAA8B,CAAC,IAAY;IACzD,OAAO,CACL,OAAO,IAAI,KAAK,QAAQ;QACxB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QACxB,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAC7B,CAAC;AACJ,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qCAAqC,CAAC,IAAY;IAChE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACnD,OAAO,2CAA2C,CAAC;IACrD,CAAC;IAED,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,OAAO,CACL,yCAAyC,SAAS,CAAC,IAAI,CAAC,IAAI;YAC5D,mEAAmE;YACnE,oBAAoB,CACrB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,qCAAqC,SAAS,CAAC,IAAI,CAAC,mBAAmB;QACvE,sEAAsE;QACtE,wCAAwC,CACzC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,KAAe;IAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CACL,GAAG,MAAM,gEAAgE;QACzE,sEAAsE;QACtE,yEAAyE;QACzE,+CAA+C,CAChD,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,6EAA6E;IAC7E,yEAAyE;IACzE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SACxB,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC;SAChC,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"EnvironmentVariableName.js","sourceRoot":"","sources":["../../../../src/envilder/core/domain/EnvironmentVariableName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAA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ACxB,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC;SAChC,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { MapFileConfig } from './MapFileConfig.js';
2
+ /**
3
+ * One reason a map file cannot be used. `key` names the offending entry
4
+ * (`DB_URL`, `$config.profile`, `--provider`, or `(root)` for the document
5
+ * itself), and `message` describes it on its own. Neither ever carries a
6
+ * mapped value.
7
+ */
8
+ export type MapFileViolation = {
9
+ readonly key: string;
10
+ readonly message: string;
11
+ };
12
+ /**
13
+ * What the map file is checked against besides the schema: the provider
14
+ * options given outside the file, which take precedence over `$config` as they
15
+ * do on a run, and the providers the caller can actually use.
16
+ */
17
+ export type MapFileValidationContext = {
18
+ readonly overrides: MapFileConfig;
19
+ readonly supportedProviders: readonly string[];
20
+ };
21
+ /**
22
+ * Checks a parsed map file against `spec/map-file.v1.json` and against the
23
+ * provider configuration it resolves to, and returns every violation found
24
+ * (an empty list when the file is usable). The cross-provider rules run on the
25
+ * configuration a run would use, so a flag can both fix and break it.
26
+ */
27
+ export declare function validateMapFile(document: unknown, context: MapFileValidationContext): MapFileViolation[];
28
+ //# sourceMappingURL=MapFileValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapFileValidator.d.ts","sourceRoot":"","sources":["../../../../src/envilder/core/domain/MapFileValidator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUxD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CAChD,CAAC;AAuBF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,wBAAwB,GAChC,gBAAgB,EAAE,CAgCpB"}
@@ -0,0 +1,195 @@
1
+ import { invalidEnvironmentVariableNameMessage, isValidEnvironmentVariableName, quoteName, } from './EnvironmentVariableName.js';
2
+ import { DEFAULT_PROVIDER, fieldOutsideProviderMessage, PROVIDER_SPECIFIC_FIELDS, REQUIRED_PROVIDER_FIELDS, requiredFieldMessage, unsupportedProviderMessage, } from './ProviderConfiguration.js';
3
+ const CONFIG_FIELDS = [
4
+ 'provider',
5
+ 'profile',
6
+ 'vaultUrl',
7
+ 'projectId',
8
+ 'namespace',
9
+ 'path',
10
+ 'name',
11
+ 'description',
12
+ 'owner',
13
+ 'environment',
14
+ ];
15
+ const URI_FIELDS = new Set(['vaultUrl']);
16
+ const OVERRIDE_FLAGS = {
17
+ provider: '--provider',
18
+ profile: '--profile',
19
+ vaultUrl: '--vault-url',
20
+ };
21
+ /**
22
+ * Checks a parsed map file against `spec/map-file.v1.json` and against the
23
+ * provider configuration it resolves to, and returns every violation found
24
+ * (an empty list when the file is usable). The cross-provider rules run on the
25
+ * configuration a run would use, so a flag can both fix and break it.
26
+ */
27
+ export function validateMapFile(document, context) {
28
+ if (!isJsonObject(document)) {
29
+ return [{ key: '(root)', message: 'The map file must be a JSON object.' }];
30
+ }
31
+ const violations = [];
32
+ let fileConfig = {};
33
+ for (const [key, value] of Object.entries(document)) {
34
+ if (key === '$schema') {
35
+ violations.push(...validateUri('$schema', value));
36
+ }
37
+ else if (key === '$config') {
38
+ if (isJsonObject(value)) {
39
+ fileConfig = value;
40
+ violations.push(...validateConfigFields(value));
41
+ }
42
+ else {
43
+ violations.push({
44
+ key: '$config',
45
+ message: '$config must be an object.',
46
+ });
47
+ }
48
+ }
49
+ else if (key.startsWith('$')) {
50
+ violations.push({
51
+ key,
52
+ message: `${formatKey(key)} is reserved: only $schema and $config may start with "$".`,
53
+ });
54
+ }
55
+ else {
56
+ violations.push(...validateMapping(key, value));
57
+ }
58
+ }
59
+ violations.push(...validateProviderConfiguration(fileConfig, context));
60
+ return violations;
61
+ }
62
+ function validateMapping(key, value) {
63
+ const violations = [];
64
+ if (!isValidEnvironmentVariableName(key)) {
65
+ violations.push({
66
+ key,
67
+ message: `${invalidEnvironmentVariableNameMessage(key)}.`,
68
+ });
69
+ }
70
+ if (typeof value !== 'string') {
71
+ // The type only: the value itself may be a secret pasted by mistake.
72
+ violations.push({
73
+ key,
74
+ message: `${formatKey(key)} must map to a string secret path, not ${describeType(value)}.`,
75
+ });
76
+ }
77
+ return violations;
78
+ }
79
+ function validateConfigFields(config) {
80
+ const violations = [];
81
+ for (const [field, value] of Object.entries(config)) {
82
+ const key = `$config.${field}`;
83
+ if (!CONFIG_FIELDS.includes(field)) {
84
+ violations.push({
85
+ key,
86
+ message: `${formatKey(key)} is not a known field. Allowed fields: ${CONFIG_FIELDS.join(', ')}.`,
87
+ });
88
+ }
89
+ else if (typeof value !== 'string') {
90
+ violations.push({
91
+ key,
92
+ message: `${key} must be a string, not ${describeType(value)}.`,
93
+ });
94
+ }
95
+ else if (URI_FIELDS.has(field)) {
96
+ violations.push(...validateUri(key, value));
97
+ }
98
+ }
99
+ return violations;
100
+ }
101
+ function validateUri(key, value) {
102
+ if (typeof value !== 'string') {
103
+ return [
104
+ { key, message: `${key} must be a string, not ${describeType(value)}.` },
105
+ ];
106
+ }
107
+ if (!isUri(value)) {
108
+ return [{ key, message: `${key} must be an absolute URI.` }];
109
+ }
110
+ return [];
111
+ }
112
+ /**
113
+ * Resolves the configuration a run would use (flags over `$config`, `aws`
114
+ * when no provider is named) and applies the cross-provider rules to it.
115
+ * Fields with the wrong type are left to the schema checks above.
116
+ */
117
+ function validateProviderConfiguration(fileConfig, context) {
118
+ var _a;
119
+ const effective = resolveEffectiveConfig(fileConfig, context.overrides);
120
+ const provider = (_a = effective.provider) !== null && _a !== void 0 ? _a : {
121
+ value: DEFAULT_PROVIDER,
122
+ source: '$config.provider',
123
+ };
124
+ if (!context.supportedProviders.includes(provider.value)) {
125
+ return [
126
+ {
127
+ key: provider.source,
128
+ message: `${unsupportedProviderMessage(formatKey(provider.value), context.supportedProviders)}.`,
129
+ },
130
+ ];
131
+ }
132
+ const violations = [];
133
+ for (const [field, validProviders] of Object.entries(PROVIDER_SPECIFIC_FIELDS)) {
134
+ const setting = effective[field];
135
+ if (setting === undefined || validProviders.includes(provider.value)) {
136
+ continue;
137
+ }
138
+ const usable = validProviders.filter((name) => context.supportedProviders.includes(name));
139
+ violations.push({
140
+ key: setting.source,
141
+ message: fieldOutsideProviderMessage(setting.source, usable.length > 0 ? usable : validProviders, provider.value),
142
+ });
143
+ }
144
+ const required = REQUIRED_PROVIDER_FIELDS[provider.value];
145
+ if (required !== undefined && effective[required] === undefined) {
146
+ violations.push({
147
+ key: `$config.${required}`,
148
+ message: requiredFieldMessage(required, provider.value),
149
+ });
150
+ }
151
+ return violations;
152
+ }
153
+ function resolveEffectiveConfig(fileConfig, overrides) {
154
+ const effective = {};
155
+ for (const field of CONFIG_FIELDS) {
156
+ const value = fileConfig[field];
157
+ if (typeof value === 'string') {
158
+ effective[field] = { value, source: `$config.${field}` };
159
+ }
160
+ }
161
+ // Empty flags are ignored, as they are on a run.
162
+ for (const [field, flag] of Object.entries(OVERRIDE_FLAGS)) {
163
+ const value = overrides[field];
164
+ if (value) {
165
+ effective[field] = {
166
+ value: field === 'provider' ? value.toLowerCase() : value,
167
+ source: flag,
168
+ };
169
+ }
170
+ }
171
+ return effective;
172
+ }
173
+ function isJsonObject(value) {
174
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
175
+ }
176
+ function isUri(value) {
177
+ return /^[A-Za-z][A-Za-z0-9+.-]*:\S*$/.test(value) && URL.canParse(value);
178
+ }
179
+ function describeType(value) {
180
+ if (value === null) {
181
+ return 'null';
182
+ }
183
+ if (Array.isArray(value)) {
184
+ return 'an array';
185
+ }
186
+ return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
187
+ }
188
+ /**
189
+ * Keys are untrusted input: anything outside a plain identifier is quoted, so
190
+ * a key carrying a line break cannot split the report.
191
+ */
192
+ function formatKey(key) {
193
+ return /^[A-Za-z0-9_$./-]+$/.test(key) ? key : quoteName(key);
194
+ }
195
+ //# sourceMappingURL=MapFileValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapFileValidator.js","sourceRoot":"","sources":["../../../../src/envilder/core/domain/MapFileValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,8BAA8B,EAC9B,SAAS,GACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AAuBpC,MAAM,aAAa,GAAG;IACpB,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;IACX,WAAW;IACX,MAAM;IACN,MAAM;IACN,aAAa;IACb,OAAO;IACP,aAAa;CACd,CAAC;AAEF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAEzC,MAAM,cAAc,GAAqC;IACvD,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAiB,EACjB,OAAiC;IAEjC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,qCAAqC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,UAAU,GAAuB,EAAE,CAAC;IAC1C,IAAI,UAAU,GAA4B,EAAE,CAAC;IAC7C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IA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E,CAAC;YACV,SAAS,CAAC,KAAK,CAAC,GAAG;gBACjB,KAAK,EAAE,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK;gBACzD,MAAM,EAAE,IAAI;aACb,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,EAAE,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Which `$config` fields each provider accepts, and the messages that report a
3
+ * provider configuration that cannot work. Shared by the provider wiring (pull,
4
+ * push, exec) and the map file validator, so a check and a run describe the
5
+ * same problem with the same words.
6
+ */
7
+ /** Every provider the map file schema (`spec/map-file.v1.json`) declares. */
8
+ export declare const MAP_FILE_PROVIDERS: readonly string[];
9
+ export declare const DEFAULT_PROVIDER = "aws";
10
+ /** Provider-specific `$config` fields and the providers that accept each. */
11
+ export declare const PROVIDER_SPECIFIC_FIELDS: Readonly<Record<string, readonly string[]>>;
12
+ /** The `$config` field each provider cannot work without. */
13
+ export declare const REQUIRED_PROVIDER_FIELDS: Readonly<Record<string, string>>;
14
+ export declare function unsupportedProviderMessage(provider: string, supportedProviders: readonly string[]): string;
15
+ /**
16
+ * Reports a provider-specific field set for a provider that does not use it.
17
+ * `subject` names where the field came from, such as `--profile` or
18
+ * `$config.profile`.
19
+ */
20
+ export declare function fieldOutsideProviderMessage(subject: string, validProviders: readonly string[], provider: string): string;
21
+ export declare function requiredFieldMessage(field: string, provider: string): string;
22
+ //# sourceMappingURL=ProviderConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/envilder/core/domain/ProviderConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAM/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAEtC,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAC7C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAOlC,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKrE,CAAC;AAeF,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,SAAS,MAAM,EAAE,GACpC,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,QAAQ,EAAE,MAAM,GACf,MAAM,CAMR;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ5E"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Which `$config` fields each provider accepts, and the messages that report a
3
+ * provider configuration that cannot work. Shared by the provider wiring (pull,
4
+ * push, exec) and the map file validator, so a check and a run describe the
5
+ * same problem with the same words.
6
+ */
7
+ /** Every provider the map file schema (`spec/map-file.v1.json`) declares. */
8
+ export const MAP_FILE_PROVIDERS = [
9
+ 'aws',
10
+ 'azure',
11
+ 'gcp',
12
+ 'hashicorp',
13
+ 'file',
14
+ ];
15
+ export const DEFAULT_PROVIDER = 'aws';
16
+ /** Provider-specific `$config` fields and the providers that accept each. */
17
+ export const PROVIDER_SPECIFIC_FIELDS = {
18
+ profile: ['aws'],
19
+ vaultUrl: ['azure', 'hashicorp'],
20
+ projectId: ['gcp'],
21
+ namespace: ['hashicorp'],
22
+ path: ['file'],
23
+ };
24
+ /** The `$config` field each provider cannot work without. */
25
+ export const REQUIRED_PROVIDER_FIELDS = {
26
+ azure: 'vaultUrl',
27
+ gcp: 'projectId',
28
+ hashicorp: 'vaultUrl',
29
+ file: 'path',
30
+ };
31
+ const PROVIDER_LABELS = {
32
+ aws: 'AWS',
33
+ azure: 'Azure',
34
+ gcp: 'GCP',
35
+ hashicorp: 'HashiCorp',
36
+ file: 'file',
37
+ };
38
+ const FIELD_FLAGS = {
39
+ profile: '--profile',
40
+ vaultUrl: '--vault-url',
41
+ };
42
+ export function unsupportedProviderMessage(provider, supportedProviders) {
43
+ return (`Unsupported provider: ${provider}.` +
44
+ ` Supported providers:` +
45
+ ` ${supportedProviders.join(', ')}`);
46
+ }
47
+ /**
48
+ * Reports a provider-specific field set for a provider that does not use it.
49
+ * `subject` names where the field came from, such as `--profile` or
50
+ * `$config.profile`.
51
+ */
52
+ export function fieldOutsideProviderMessage(subject, validProviders, provider) {
53
+ return (`${subject} is only supported with the` +
54
+ ` ${validProviders.join(' or ')} provider` +
55
+ ` (current provider: ${provider}).`);
56
+ }
57
+ export function requiredFieldMessage(field, provider) {
58
+ var _a;
59
+ const flag = FIELD_FLAGS[field];
60
+ return (`${field} is required when using` +
61
+ ` ${(_a = PROVIDER_LABELS[provider]) !== null && _a !== void 0 ? _a : provider} provider.` +
62
+ ` Set it in $config.${field} in your map file` +
63
+ (flag === undefined ? '.' : ` or via ${flag} flag.`));
64
+ }
65
+ //# sourceMappingURL=ProviderConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProviderConfiguration.js","sourceRoot":"","sources":["../../../../src/envilder/core/domain/ProviderConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,KAAK;IACL,OAAO;IACP,KAAK;IACL,WAAW;IACX,MAAM;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAEtC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,wBAAwB,GAEjC;IACF,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;IAChC,SAAS,EAAE,CAAC,KAAK,CAAC;IAClB,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,WAAW;IAChB,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,eAAe,GAAqC;IACxD,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,WAAW,GAAqC;IACpD,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEF,MAAM,UAAU,0BAA0B,CACxC,QAAgB,EAChB,kBAAqC;IAErC,OAAO,CACL,yBAAyB,QAAQ,GAAG;QACpC,uBAAuB;QACvB,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACpC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAe,EACf,cAAiC,EACjC,QAAgB;IAEhB,OAAO,CACL,GAAG,OAAO,6BAA6B;QACvC,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW;QAC1C,uBAAuB,QAAQ,IAAI,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,QAAgB;;IAClE,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,CACL,GAAG,KAAK,yBAAyB;QACjC,IAAI,MAAA,eAAe,CAAC,QAAQ,CAAC,mCAAI,QAAQ,YAAY;QACrD,sBAAsB,KAAK,mBAAmB;QAC9C,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,CACrD,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureSecretProviderFactory.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/azure/AzureSecretProviderFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAO7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG;IACjC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,oCAAoC,CAAC,EAAE,OAAO,CAAC;CAChD,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,eAAe,CAkBjB"}
1
+ {"version":3,"file":"AzureSecretProviderFactory.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/azure/AzureSecretProviderFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAO7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG;IACjC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,oCAAoC,CAAC,EAAE,OAAO,CAAC;CAChD,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,eAAe,CAcjB"}
@@ -1,6 +1,7 @@
1
1
  import { DefaultAzureCredential } from '@azure/identity';
2
2
  import { SecretClient } from '@azure/keyvault-secrets';
3
3
  import { DependencyMissingError } from '../../domain/errors/DomainErrors.js';
4
+ import { requiredFieldMessage } from '../../domain/ProviderConfiguration.js';
4
5
  import { AzureKeyVaultSecretProvider } from './AzureKeyVaultSecretProvider.js';
5
6
  import { DEFAULT_VAULT_HOSTS, validateAzureVaultUrl, } from './AzureVaultUrlValidator.js';
6
7
  export { DEFAULT_VAULT_HOSTS } from './AzureVaultUrlValidator.js';
@@ -8,9 +9,7 @@ export function createAzureSecretProvider(config, options) {
8
9
  var _a, _b;
9
10
  const { vaultUrl } = config;
10
11
  if (!vaultUrl) {
11
- throw new DependencyMissingError('vaultUrl is required when using Azure provider.' +
12
- ' Set it in $config.vaultUrl in your map file' +
13
- ' or via --vault-url flag.');
12
+ throw new DependencyMissingError(requiredFieldMessage('vaultUrl', 'azure'));
14
13
  }
15
14
  const allowedVaultHosts = (_a = options === null || options === void 0 ? void 0 : options.allowedVaultHosts) !== null && _a !== void 0 ? _a : DEFAULT_VAULT_HOSTS;
16
15
  const disableChallengeResourceVerification = (_b = options === null || options === void 0 ? void 0 : options.disableChallengeResourceVerification) !== null && _b !== void 0 ? _b : false;
@@ -1 +1 @@
1
- {"version":3,"file":"AzureSecretProviderFactory.js","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/azure/AzureSecretProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAG7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAOlE,MAAM,UAAU,yBAAyB,CACvC,MAAqB,EACrB,OAA8B;;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,sBAAsB,CAC9B,iDAAiD;YAC/C,8CAA8C;YAC9C,2BAA2B,CAC9B,CAAC;IACJ,CAAC;IACD,MAAM,iBAAiB,SAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,mBAAmB,CAAC;IAC5E,MAAM,oCAAoC,SACxC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oCAAoC,mCAAI,KAAK,CAAC;IACzD,qBAAqB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE;QACpD,oCAAoC;KACrC,CAAC,CAAC;IACH,OAAO,IAAI,2BAA2B,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC"}
1
+ {"version":3,"file":"AzureSecretProviderFactory.js","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/azure/AzureSecretProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAOlE,MAAM,UAAU,yBAAyB,CACvC,MAAqB,EACrB,OAA8B;;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,sBAAsB,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,iBAAiB,SAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,mBAAmB,CAAC;IAC5E,MAAM,oCAAoC,SACxC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oCAAoC,mCAAI,KAAK,CAAC;IACzD,qBAAqB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE;QACpD,oCAAoC;KACrC,CAAC,CAAC;IACH,OAAO,IAAI,2BAA2B,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvFileParser.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/variableStore/EnvFileParser.ts"],"names":[],"mappings":"AAaA,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBhE"}
1
+ {"version":3,"file":"EnvFileParser.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/variableStore/EnvFileParser.ts"],"names":[],"mappings":"AAmBA,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBhE"}
@@ -1,14 +1,20 @@
1
1
  /**
2
- * dotenv's `LINE` grammar and `parse`, copied from dotenv 17 with one change:
3
- * the key class also admits `/`, the hierarchy separator map files use
2
+ * dotenv's `LINE` grammar and `parse`, copied from dotenv 17 with two changes.
3
+ * The key class also admits `/`, the hierarchy separator map files use
4
4
  * (`Database/Password`). dotenv skips such a line, so reading the files we
5
5
  * write through it would lose those keys, both when merging into an existing
6
6
  * file and when checking the result before it reaches disk.
7
7
  *
8
+ * And the blanks before a key stop at a line break. dotenv's `\s*` there lets
9
+ * every blank line start an attempt that scans the whole run after it, so a
10
+ * file of blank lines takes quadratic time: about 100 s for 200 KB. The match
11
+ * that begins on the key's own line captures the same key and value, so the
12
+ * result does not change. dotenv 18 keeps the same grammar.
13
+ *
8
14
  * Everything else is dotenv's, value rules included, so a file without `/` in
9
15
  * its keys parses exactly as dotenv parses it. The conformance tests pin that.
10
16
  */
11
- const LINE = /(?:^|^)\s*(?:export\s+)?([\w./-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
17
+ const LINE = /(?:^|^)[^\S\n\r\u2028\u2029]*(?:export\s+)?([\w./-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
12
18
  export function parseEnvFile(src) {
13
19
  // A plain object on purpose, as in dotenv: `__proto__` must vanish here too,
14
20
  // which is why the name rule rejects it.
@@ -1 +1 @@
1
- {"version":3,"file":"EnvFileParser.js","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/variableStore/EnvFileParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,IAAI,GACR,+IAA+I,CAAC;AAElJ,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,6EAA6E;IAC7E,yCAAyC;IACzC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAE3C,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5B,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;YACvB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"EnvFileParser.js","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/variableStore/EnvFileParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,IAAI,GACR,kKAAkK,CAAC;AAErK,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,6EAA6E;IAC7E,yCAAyC;IACzC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAE3C,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5B,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;YACvB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -20,11 +20,10 @@ export declare class FileVariableStore implements IVariableStore {
20
20
  * The break that separates two assignments, which is the only kind that is
21
21
  * structural. Blanking the claimed spans leaves exactly those: a break
22
22
  * carried inside a value is part of a span and disappears with it, while a
23
- * break that precedes a span is kept, because the prefix reaches back over
24
- * blank lines and over the break that ended the line before. The terminator
25
- * that closes the file is structural by the same argument and wins when the
26
- * file has one; scanning the raw text for any CRLF is the last resort, and
27
- * only a guess.
23
+ * break that precedes a span is kept, because a span starts on its key's own
24
+ * line and never holds the break before it. The terminator that closes the
25
+ * file is structural by the same argument and wins when the file has one;
26
+ * scanning the raw text for any CRLF is the last resort, and only a guess.
28
27
  */
29
28
  private detectStructuralNewline;
30
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FileVariableStore.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/variableStore/FileVariableStore.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAkD3E,qBACa,iBAAkB,YAAW,cAAc;IACtD,OAAO,CAAC,MAAM,CAAU;IAExB,YAAmC,MAAM,EAAE,OAAO,EAKjD;IAEK,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAGhE;IAEK,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA4B7D;IAED,OAAO,CAAC,uBAAuB;YAQjB,YAAY;IAmBpB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS/D;IAEK,mBAAmB,CACvB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAcf;IAEK,cAAc,CAClB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,IAAI,CAAC,CAYf;IAEK,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAepE;IAEK,eAAe,CACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,OAAO,CAAC,IAAI,CAAC,CAwBf;IAED,OAAO,CAAC,yBAAyB;YAOnB,sBAAsB;IAoBpC,OAAO,CAAC,eAAe;IA2EvB;;;;;;;;;OASG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,iCAAiC;IAqBzC,OAAO,CAAC,iBAAiB;IAMzB;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IAgBhC,OAAO,CAAC,oBAAoB;IAuB5B,OAAO,CAAC,qBAAqB;IAc7B;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,YAAY;IAcpB,8EAA8E;IAC9E,OAAO,CAAC,sBAAsB;IAO9B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IASxB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAgB9B;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;CAoBjC;AAQD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAkBxB"}
1
+ {"version":3,"file":"FileVariableStore.d.ts","sourceRoot":"","sources":["../../../../../src/envilder/core/infrastructure/variableStore/FileVariableStore.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AA2D3E,qBACa,iBAAkB,YAAW,cAAc;IACtD,OAAO,CAAC,MAAM,CAAU;IAExB,YAAmC,MAAM,EAAE,OAAO,EAKjD;IAEK,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CA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