envilder 0.7.6 → 0.7.8
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.
- package/lib/apps/cli/Index.js +0 -0
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.d.ts +14 -2
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.d.ts.map +1 -1
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.js +113 -18
- package/lib/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.js.map +1 -1
- package/package.json +24 -23
package/lib/apps/cli/Index.js
CHANGED
|
File without changes
|
|
@@ -16,7 +16,19 @@ export declare class PushEnvToSsmCommandHandler {
|
|
|
16
16
|
*/
|
|
17
17
|
handle(command: PushEnvToSsmCommand): Promise<void>;
|
|
18
18
|
private loadConfiguration;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Validates and groups environment variables by SSM path.
|
|
21
|
+
* Ensures that all variables pointing to the same SSM path have the same value.
|
|
22
|
+
* Returns a map of SSM path to value.
|
|
23
|
+
*/
|
|
24
|
+
private validateAndGroupByPath;
|
|
25
|
+
private pushParametersToSSM;
|
|
26
|
+
private pushParameter;
|
|
27
|
+
/**
|
|
28
|
+
* Retries an async operation with exponential backoff and jitter.
|
|
29
|
+
* Handles AWS SSM throttling errors (TooManyUpdates).
|
|
30
|
+
*/
|
|
31
|
+
private retryWithBackoff;
|
|
32
|
+
private getErrorMessage;
|
|
21
33
|
}
|
|
22
34
|
//# sourceMappingURL=PushEnvToSsmCommandHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushEnvToSsmCommandHandler.d.ts","sourceRoot":"","sources":["../../../../src/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KA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;OAGG;YACW,gBAAgB;IAoC9B,OAAO,CAAC,eAAe;CA0CxB"}
|
|
@@ -39,12 +39,13 @@ let PushEnvToSsmCommandHandler = class PushEnvToSsmCommandHandler {
|
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
try {
|
|
41
41
|
this.logger.info(`Starting push operation from '${command.envFilePath}' using map '${command.mapPath}'`);
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const config = yield this.loadConfiguration(command);
|
|
43
|
+
const validatedPaths = this.validateAndGroupByPath(config);
|
|
44
|
+
yield this.pushParametersToSSM(validatedPaths);
|
|
44
45
|
this.logger.info(`Successfully pushed environment variables from '${command.envFilePath}' to AWS SSM.`);
|
|
45
46
|
}
|
|
46
47
|
catch (error) {
|
|
47
|
-
const errorMessage =
|
|
48
|
+
const errorMessage = this.getErrorMessage(error);
|
|
48
49
|
this.logger.error(`Failed to push environment file: ${errorMessage}`);
|
|
49
50
|
throw error;
|
|
50
51
|
}
|
|
@@ -61,29 +62,123 @@ let PushEnvToSsmCommandHandler = class PushEnvToSsmCommandHandler {
|
|
|
61
62
|
return { paramMap, envVariables };
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Validates and groups environment variables by SSM path.
|
|
67
|
+
* Ensures that all variables pointing to the same SSM path have the same value.
|
|
68
|
+
* Returns a map of SSM path to value.
|
|
69
|
+
*/
|
|
70
|
+
validateAndGroupByPath(config) {
|
|
71
|
+
const { paramMap, envVariables } = config;
|
|
72
|
+
const pathToValueMap = new Map();
|
|
73
|
+
for (const [envKey, ssmPath] of Object.entries(paramMap)) {
|
|
74
|
+
const envValue = envVariables[envKey];
|
|
75
|
+
if (envValue === undefined) {
|
|
76
|
+
this.logger.warn(`Warning: Environment variable ${envKey} not found in environment file`);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const existing = pathToValueMap.get(ssmPath);
|
|
80
|
+
if (existing) {
|
|
81
|
+
if (existing.value !== envValue) {
|
|
82
|
+
const existingMasked = new EnvironmentVariable(existing.sourceKeys[0], existing.value, true).maskedValue;
|
|
83
|
+
const newMasked = new EnvironmentVariable(envKey, envValue, true)
|
|
84
|
+
.maskedValue;
|
|
85
|
+
throw new Error(`Conflicting values for SSM path '${ssmPath}': ` +
|
|
86
|
+
`'${existing.sourceKeys[0]}' has value '${existingMasked}' ` +
|
|
87
|
+
`but '${envKey}' has value '${newMasked}'`);
|
|
88
|
+
}
|
|
89
|
+
existing.sourceKeys.push(envKey);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
pathToValueMap.set(ssmPath, { value: envValue, sourceKeys: [envKey] });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const uniquePaths = pathToValueMap.size;
|
|
96
|
+
const totalVariables = Object.keys(paramMap).length;
|
|
97
|
+
this.logger.info(`Validated ${totalVariables} environment variables mapping to ${uniquePaths} unique SSM parameters`);
|
|
98
|
+
return pathToValueMap;
|
|
99
|
+
}
|
|
100
|
+
pushParametersToSSM(pathToValueMap) {
|
|
65
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
return this.
|
|
102
|
+
const pathsToProcess = Array.from(pathToValueMap.keys());
|
|
103
|
+
this.logger.info(`Processing ${pathsToProcess.length} unique SSM parameters`);
|
|
104
|
+
// Process parameters in parallel with retry logic for throttling errors
|
|
105
|
+
const parameterProcessingPromises = Array.from(pathToValueMap.entries()).map(([ssmPath, { value, sourceKeys }]) => {
|
|
106
|
+
return this.retryWithBackoff(() => this.pushParameter(ssmPath, value, sourceKeys));
|
|
71
107
|
});
|
|
72
|
-
yield Promise.all(
|
|
108
|
+
yield Promise.all(parameterProcessingPromises);
|
|
73
109
|
});
|
|
74
110
|
}
|
|
75
|
-
|
|
111
|
+
pushParameter(ssmPath, value, sourceKeys) {
|
|
76
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
113
|
+
const envVariable = new EnvironmentVariable(sourceKeys[0], value, true);
|
|
114
|
+
yield this.secretProvider.setSecret(ssmPath, value);
|
|
115
|
+
const keysDescription = sourceKeys.length > 1 ? `${sourceKeys.join(', ')}` : sourceKeys[0];
|
|
116
|
+
this.logger.info(`Pushed ${keysDescription}=${envVariable.maskedValue} to AWS SSM at path ${ssmPath}`);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Retries an async operation with exponential backoff and jitter.
|
|
121
|
+
* Handles AWS SSM throttling errors (TooManyUpdates).
|
|
122
|
+
*/
|
|
123
|
+
retryWithBackoff(operation_1) {
|
|
124
|
+
return __awaiter(this, arguments, void 0, function* (operation, maxRetries = 5, baseDelayMs = 100) {
|
|
125
|
+
let lastError;
|
|
126
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
127
|
+
try {
|
|
128
|
+
return yield operation();
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
lastError = error;
|
|
132
|
+
const isThrottlingError = typeof error === 'object' &&
|
|
133
|
+
error !== null &&
|
|
134
|
+
'name' in error &&
|
|
135
|
+
(error.name === 'TooManyUpdates' ||
|
|
136
|
+
error.name === 'ThrottlingException' ||
|
|
137
|
+
error.name === 'TooManyRequestsException');
|
|
138
|
+
if (!isThrottlingError || attempt === maxRetries) {
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
const exponentialDelay = baseDelayMs * 2 ** attempt;
|
|
142
|
+
const jitter = Math.random() * exponentialDelay * 0.5; // 0-50% jitter
|
|
143
|
+
const delayMs = exponentialDelay + jitter;
|
|
144
|
+
yield new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
145
|
+
}
|
|
84
146
|
}
|
|
147
|
+
throw lastError;
|
|
85
148
|
});
|
|
86
149
|
}
|
|
150
|
+
getErrorMessage(error) {
|
|
151
|
+
if (error instanceof Error) {
|
|
152
|
+
return error.message;
|
|
153
|
+
}
|
|
154
|
+
if (typeof error === 'string') {
|
|
155
|
+
return error;
|
|
156
|
+
}
|
|
157
|
+
if (error === null) {
|
|
158
|
+
return 'Unknown error (null)';
|
|
159
|
+
}
|
|
160
|
+
if (error === undefined) {
|
|
161
|
+
return 'Unknown error (undefined)';
|
|
162
|
+
}
|
|
163
|
+
if (typeof error === 'object') {
|
|
164
|
+
const awsError = error;
|
|
165
|
+
if (awsError.name) {
|
|
166
|
+
return awsError.message
|
|
167
|
+
? `${awsError.name}: ${awsError.message}`
|
|
168
|
+
: awsError.name;
|
|
169
|
+
}
|
|
170
|
+
const safeFields = [];
|
|
171
|
+
if (awsError.code)
|
|
172
|
+
safeFields.push(`code: ${awsError.code}`);
|
|
173
|
+
if (awsError.message)
|
|
174
|
+
safeFields.push(`message: ${awsError.message}`);
|
|
175
|
+
if (safeFields.length > 0) {
|
|
176
|
+
return `Object error (${safeFields.join(', ')})`;
|
|
177
|
+
}
|
|
178
|
+
return `Object error: ${Object.keys(error).join(', ')}`;
|
|
179
|
+
}
|
|
180
|
+
return `Unknown error: ${String(error)}`;
|
|
181
|
+
}
|
|
87
182
|
};
|
|
88
183
|
PushEnvToSsmCommandHandler = __decorate([
|
|
89
184
|
injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushEnvToSsmCommandHandler.js","sourceRoot":"","sources":["../../../../src/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI1E,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIhC,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YAEmB,cAA+B,EAE/B,aAA6B,EACN,MAAe;QAHtC,mBAAc,GAAd,cAAc,CAAiB;QAE/B,kBAAa,GAAb,aAAa,CAAgB;QACN,WAAM,GAAN,MAAM,CAAS;IACtD,CAAC;IAEJ;;;;;;OAMG;IACG,MAAM,CAAC,OAA4B;;YACvC,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,iCAAiC,OAAO,CAAC,WAAW,gBAAgB,OAAO,CAAC,OAAO,GAAG,CACvF,CAAC;gBACF,MAAM,
|
|
1
|
+
{"version":3,"file":"PushEnvToSsmCommandHandler.js","sourceRoot":"","sources":["../../../../src/envilder/application/pushEnvToSsm/PushEnvToSsmCommandHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI1E,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIhC,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YAEmB,cAA+B,EAE/B,aAA6B,EACN,MAAe;QAHtC,mBAAc,GAAd,cAAc,CAAiB;QAE/B,kBAAa,GAAb,aAAa,CAAgB;QACN,WAAM,GAAN,MAAM,CAAS;IACtD,CAAC;IAEJ;;;;;;OAMG;IACG,MAAM,CAAC,OAA4B;;YACvC,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,iCAAiC,OAAO,CAAC,WAAW,gBAAgB,OAAO,CAAC,OAAO,GAAG,CACvF,CAAC;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACrD,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;gBAC3D,MAAM,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;gBAE/C,IA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AC,OAAO,CAAC,CAAA;;GANb,0BAA0B,CAyOtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envilder",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "A CLI that securely centralizes your environment variables from AWS SSM as a single source of truth",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Marçal Albert Castellví",
|
|
@@ -16,6 +16,26 @@
|
|
|
16
16
|
"bin": {
|
|
17
17
|
"envilder": "lib/apps/cli/Index.js"
|
|
18
18
|
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "pnpm store prune && pnpm dlx rimraf lib && pnpm dlx rimraf coverage && pnpm dlx rimraf node_modules",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"build:gha": "ncc build src/apps/gha/Index.ts -o github-action/dist --minify",
|
|
23
|
+
"verify:gha": "pnpm build:gha && git diff --exit-code github-action/dist/index.js || (echo '❌ github-action/dist/index.js is not up to date. Run pnpm build:gha' && exit 1)",
|
|
24
|
+
"local:install": "pnpm build && node --loader ts-node/esm scripts/pack-and-install.ts",
|
|
25
|
+
"local:test-run": "pnpm build && node lib/apps/cli/Index.js --map=tests/sample/param-map.json --envfile=tests/sample/autogenerated.env",
|
|
26
|
+
"format": "biome format",
|
|
27
|
+
"format:write": "biome format --write",
|
|
28
|
+
"lint": "secretlint \"**/*\" && biome check --write && tsc --noEmit",
|
|
29
|
+
"lint:fix": "biome lint --fix",
|
|
30
|
+
"test": "vitest run --reporter=verbose --coverage",
|
|
31
|
+
"test:ci": "vitest run --reporter=verbose --reporter=junit --coverage --outputFile=coverage/junit/test-results.xml",
|
|
32
|
+
"publish": "npm pack --dry-run && npm publish --provenance",
|
|
33
|
+
"action-publish": "pnpm build:gha && pnpm verify:gha",
|
|
34
|
+
"release-patch": "pnpm version patch",
|
|
35
|
+
"release-minor": "pnpm version minor",
|
|
36
|
+
"release-major": "pnpm version major",
|
|
37
|
+
"release-prerelease": "pnpm version prerelease"
|
|
38
|
+
},
|
|
19
39
|
"keywords": [
|
|
20
40
|
"env",
|
|
21
41
|
"dotenv",
|
|
@@ -53,8 +73,8 @@
|
|
|
53
73
|
],
|
|
54
74
|
"type": "module",
|
|
55
75
|
"dependencies": {
|
|
56
|
-
"@aws-sdk/client-ssm": "^3.
|
|
57
|
-
"@aws-sdk/credential-providers": "^3.
|
|
76
|
+
"@aws-sdk/client-ssm": "^3.983.0",
|
|
77
|
+
"@aws-sdk/credential-providers": "^3.983.0",
|
|
58
78
|
"@types/node": "^25.0.3",
|
|
59
79
|
"commander": "^14.0.2",
|
|
60
80
|
"dotenv": "^17.2.3",
|
|
@@ -79,24 +99,5 @@
|
|
|
79
99
|
},
|
|
80
100
|
"engines": {
|
|
81
101
|
"node": ">=20.0.0"
|
|
82
|
-
},
|
|
83
|
-
"scripts": {
|
|
84
|
-
"clean": "pnpm store prune && pnpm dlx rimraf lib && pnpm dlx rimraf coverage && pnpm dlx rimraf node_modules",
|
|
85
|
-
"build": "tsc",
|
|
86
|
-
"build:gha": "ncc build src/apps/gha/Index.ts -o github-action/dist --minify",
|
|
87
|
-
"verify:gha": "pnpm build:gha && git diff --exit-code github-action/dist/index.js || (echo '❌ github-action/dist/index.js is not up to date. Run pnpm build:gha' && exit 1)",
|
|
88
|
-
"local:install": "pnpm build && node --loader ts-node/esm scripts/pack-and-install.ts",
|
|
89
|
-
"local:test-run": "pnpm build && node lib/apps/cli/Index.js --map=tests/sample/param-map.json --envfile=tests/sample/autogenerated.env",
|
|
90
|
-
"format": "biome format",
|
|
91
|
-
"format:write": "biome format --write",
|
|
92
|
-
"lint": "secretlint \"**/*\" && biome check --write && tsc --noEmit",
|
|
93
|
-
"lint:fix": "biome lint --fix",
|
|
94
|
-
"test": "vitest run --reporter=verbose --coverage",
|
|
95
|
-
"test:ci": "vitest run --reporter=verbose --reporter=junit --coverage --outputFile=coverage/junit/test-results.xml",
|
|
96
|
-
"action-publish": "pnpm build:gha && pnpm verify:gha",
|
|
97
|
-
"release-patch": "pnpm version patch",
|
|
98
|
-
"release-minor": "pnpm version minor",
|
|
99
|
-
"release-major": "pnpm version major",
|
|
100
|
-
"release-prerelease": "pnpm version prerelease"
|
|
101
102
|
}
|
|
102
|
-
}
|
|
103
|
+
}
|