@pipeline-builder/pipeline-manager 6.5.5 → 6.5.7
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/README.md +11 -3
- package/dist/agent/post-steps.d.ts +1 -1
- package/dist/agent/post-steps.d.ts.map +1 -1
- package/dist/agent/post-steps.js +27 -31
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +8 -9
- package/dist/commands/audit-stacks.d.ts +2 -1
- package/dist/commands/audit-stacks.d.ts.map +1 -1
- package/dist/commands/audit-stacks.js +12 -2
- package/dist/commands/provision-steps.d.ts +1 -1
- package/dist/commands/provision-steps.js +2 -2
- package/dist/commands/provision.js +2 -2
- package/dist/commands/redrive-events.d.ts +4 -3
- package/dist/commands/redrive-events.d.ts.map +1 -1
- package/dist/commands/redrive-events.js +51 -18
- package/dist/commands/runner-signing-key.js +2 -2
- package/dist/commands/{setup-runner.d.ts → setup-account.d.ts} +133 -71
- package/dist/commands/setup-account.d.ts.map +1 -0
- package/dist/commands/setup-account.js +1366 -0
- package/dist/commands/store-token.d.ts +6 -28
- package/dist/commands/store-token.d.ts.map +1 -1
- package/dist/commands/store-token.js +12 -139
- package/dist/config/cli.constants.d.ts +0 -8
- package/dist/config/cli.constants.d.ts.map +1 -1
- package/dist/config/cli.constants.js +1 -9
- package/dist/lambda/events-handler.js +1558 -0
- package/dist/lambda/runner-handler.d.ts +27 -1
- package/dist/lambda/runner-handler.d.ts.map +1 -1
- package/dist/lambda/runner-handler.js +428 -71
- package/dist/lambda/runner-inspect-connection.d.ts +45 -0
- package/dist/lambda/runner-inspect-connection.d.ts.map +1 -0
- package/dist/lambda/runner-inspect-connection.js +157 -0
- package/dist/lambda/runner-jws.d.ts.map +1 -1
- package/dist/lambda/runner-jws.js +64 -6
- package/dist/lambda/runner-sources.d.ts +12 -0
- package/dist/lambda/runner-sources.d.ts.map +1 -1
- package/dist/lambda/runner-sources.js +25 -16
- package/dist/lambda/token-renew-handler.d.ts +3 -2
- package/dist/lambda/token-renew-handler.d.ts.map +1 -1
- package/dist/lambda/token-renew-handler.js +17 -5
- package/dist/templates/account-stack.json +2060 -0
- package/dist/templates/forwarder-stack.json +133 -0
- package/dist/utils/{runner-template.d.ts → account-template.d.ts} +83 -18
- package/dist/utils/account-template.d.ts.map +1 -0
- package/dist/utils/account-template.js +340 -0
- package/dist/utils/inspect-buildspec.d.ts +9 -0
- package/dist/utils/inspect-buildspec.d.ts.map +1 -0
- package/dist/utils/inspect-buildspec.js +209 -0
- package/dist/utils/service-account.d.ts +10 -2
- package/dist/utils/service-account.d.ts.map +1 -1
- package/dist/utils/service-account.js +10 -4
- package/package.json +5 -4
- package/dist/commands/setup-events.d.ts +0 -15
- package/dist/commands/setup-events.d.ts.map +0 -1
- package/dist/commands/setup-events.js +0 -182
- package/dist/commands/setup-runner.d.ts.map +0 -1
- package/dist/commands/setup-runner.js +0 -1132
- package/dist/templates/events-stack.json +0 -192
- package/dist/templates/runner-stack.json +0 -960
- package/dist/templates/token-renew-stack.json +0 -115
- package/dist/utils/cron.d.ts +0 -28
- package/dist/utils/cron.d.ts.map +0 -1
- package/dist/utils/cron.js +0 -119
- package/dist/utils/runner-template.d.ts.map +0 -1
- package/dist/utils/runner-template.js +0 -238
|
@@ -116,10 +116,10 @@ function platformTlsVerify(env = process.env) {
|
|
|
116
116
|
var HTTP_TIMEOUT_MS = 1e4;
|
|
117
117
|
var KEY_TTL_DAYS_RANGE = { min: 1, max: 365, default: 30 };
|
|
118
118
|
function renewConfigFromEnv() {
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
119
|
+
const secretNames = (process.env.PLATFORM_SECRET_NAMES ?? "").split(",").map((v) => v.trim()).filter(Boolean);
|
|
120
|
+
if (secretNames.length === 0) throw new Error("PLATFORM_SECRET_NAMES environment variable is required");
|
|
121
121
|
const keyTtlDays = envIntStrict("KEY_TTL_DAYS", KEY_TTL_DAYS_RANGE.default, { min: KEY_TTL_DAYS_RANGE.min, max: KEY_TTL_DAYS_RANGE.max });
|
|
122
|
-
return {
|
|
122
|
+
return { secretNames, keyTtlDays, region: process.env.AWS_REGION || "us-east-1" };
|
|
123
123
|
}
|
|
124
124
|
function log(level, msg, data) {
|
|
125
125
|
const line = JSON.stringify({ level, msg, ...data });
|
|
@@ -153,9 +153,21 @@ function applyTlsPolicy() {
|
|
|
153
153
|
}
|
|
154
154
|
var handler = async (_event, context) => {
|
|
155
155
|
const requestId = context?.awsRequestId;
|
|
156
|
-
const {
|
|
156
|
+
const { secretNames, keyTtlDays: days, region } = renewConfigFromEnv();
|
|
157
157
|
applyTlsPolicy();
|
|
158
158
|
const sm = new SecretsManagerClient2({ region });
|
|
159
|
+
const failed = [];
|
|
160
|
+
for (const secretName of secretNames) {
|
|
161
|
+
try {
|
|
162
|
+
await rotateOne(sm, secretName, days, requestId);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
failed.push(`${secretName} (${err instanceof Error ? err.message : String(err)})`);
|
|
165
|
+
log("ERROR", "Rotation failed \u2014 this secret keeps its current key", { secretName, error: err instanceof Error ? err.message : String(err) });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (failed.length > 0) throw new Error(`Rotation failed for ${failed.length} of ${secretNames.length} credential(s): ${failed.join("; ")}`);
|
|
169
|
+
};
|
|
170
|
+
async function rotateOne(sm, secretName, days, requestId) {
|
|
159
171
|
const stored = await readCredentialSecret(secretName, sm);
|
|
160
172
|
const oldKey = stored.password;
|
|
161
173
|
if (!oldKey) throw new Error(`Secret "${secretName}" missing password (service-account key)`);
|
|
@@ -207,7 +219,7 @@ var handler = async (_event, context) => {
|
|
|
207
219
|
return;
|
|
208
220
|
}
|
|
209
221
|
log("INFO", "Rotation complete", { secretName, keyId: newKeyId, revokedKeyId: oldKeyId });
|
|
210
|
-
}
|
|
222
|
+
}
|
|
211
223
|
export {
|
|
212
224
|
handler,
|
|
213
225
|
renewConfigFromEnv
|