Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
test(e2e): retire legacy AWS sync and rotation cases ported to the Go suite
varonix1d520ae5fc10
diff --git a/backend/e2e-test/fakes/audit-log-stream-outbox-constants.ts b/backend/e2e-test/fakes/audit-log-stream-outbox-constants.tsindex d0918d91a7..0cf570a3d7 100644--- a/backend/e2e-test/fakes/audit-log-stream-outbox-constants.ts+++ b/backend/e2e-test/fakes/audit-log-stream-outbox-constants.ts@@ -8,7 +8,7 @@ import * as RealConstants from "../../src/ee/services/audit-log-stream-outbox/au// behavior. The values are live bindings: the service reads them at call time, so a change made// through the handle below applies to the next flush.//-// The handle hangs off globalThis for the reason given in aws-parameter-store-sync-fns.ts.+// The handle hangs off globalThis for the reason given in aws-iam-user-secret-rotation-fns.ts./* eslint-disable import/no-mutable-exports -- a live binding is what lets the service see a change */export let FLUSH_DEBOUNCE_MS = RealConstants.FLUSH_DEBOUNCE_MS as number;export let MAX_ATTEMPTS = RealConstants.MAX_ATTEMPTS as number;diff --git a/backend/e2e-test/fakes/event-outbox-queue.ts b/backend/e2e-test/fakes/event-outbox-queue.tsindex 2e7365e0ad..0f6deba1dd 100644--- a/backend/e2e-test/fakes/event-outbox-queue.ts+++ b/backend/e2e-test/fakes/event-outbox-queue.ts@@ -10,7 +10,7 @@ import * as RealEventOutboxQueue from "../../src/services/event-outbox/event-out// The relay keeps running alongside. Claims are exclusive, so an event is delivered once whichever// side gets to it first, and a spec should still wait on the outcome rather than on the drain.//-// The handle hangs off globalThis for the reason given in aws-parameter-store-sync-fns.ts.+// The handle hangs off globalThis for the reason given in aws-iam-user-secret-rotation-fns.ts.const globalScope = globalThis as typeof globalThis & {infisicalEventOutboxService?: Pick<TEventOutboxServiceFactory, "drain">;};diff --git a/backend/e2e-test/fakes/reminder-queue.ts b/backend/e2e-test/fakes/reminder-queue.tsindex 901a6b6c21..a3dbd7c458 100644--- a/backend/e2e-test/fakes/reminder-queue.ts+++ b/backend/e2e-test/fakes/reminder-queue.ts@@ -10,7 +10,7 @@ import * as RealReminderQueue from "../../src/services/reminder/reminder-queue";// reminder service the handler does, wired with the server's own dependencies. Only the trigger// changes, and the spec can pass the day to run for instead of waiting for it.//-// The handle hangs off globalThis for the reason given in aws-parameter-store-sync-fns.ts: the+// The handle hangs off globalThis for the reason given in aws-iam-user-secret-rotation-fns.ts: the// server and a spec reach this module by different specifiers and get separate copies of it.const globalScope = globalThis as typeof globalThis & {infisicalReminderService?: TReminderServiceFactory;diff --git a/backend/e2e-test/routes/v2/secret-rotation.spec.ts b/backend/e2e-test/routes/v2/secret-rotation.spec.tsindex 1547f87ac2..56030633e3 100644--- a/backend/e2e-test/routes/v2/secret-rotation.spec.ts+++ b/backend/e2e-test/routes/v2/secret-rotation.spec.ts@@ -14,17 +14,17 @@ import { getSecretsV2 } from "e2e-test/testUtils/secrets";import { SecretRotationStatus } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";-// What is under test is which credential the provider is handed to retire, and what survives a+// What is under test is the credential a replace-in-place provider is handed, and what survives a// failure after the new credential is published. The rest of the rotation plumbing is covered on-// PostgreSQL by tests/suites/secretmanager/rotations. The provider is AWS IAM user secrets, faked for the whole run+// PostgreSQL by tests/suites/secretmanager/rotations, and the real AWS IAM provider, which runs two+// credentials, by tests/suites/secretmanager/rotations/aws_iam_test.go. Neither shape here exists+// on a provider the Go suite can reach, so the provider stays faked for the whole run// (e2e-test/fakes/aws-iam-user-secret-rotation-fns.ts and the alias block in-// vitest.e2e.config.mts), so none of this reaches IAM.+// vitest.e2e.config.mts), and none of this reaches IAM.//// Every assertion is on state a user or an operator could see: the secrets at the path, the keys// on the IAM user, the rotation's own status. Nothing asserts that the factory was called, or-// with what. The two rotation shapes are covered by running the same lifecycle against a fake in-// each mode, and because each mode retires a different one of the two credentials the service-// offers it, the surviving keys are what say the service offered the right ones.+// with what.const ENV = "dev";@@ -147,29 +147,6 @@ describe("Secret rotations", async () => {// Back to the first slot: two slots, alternating.expect(second.secretRotation!.activeIndex).toBe(0);});-- test("A provider that runs two credentials keeps the previous one live and retires the one before it", async () => {- fakeIamUserSecret.setMode(FakeIamRotationMode.IssueAndDisplace);-- const { secretRotation } = await newRotation("issue-and-displace");- const rotationId = secretRotation!.id;-- // Nothing is displaced on the first rotation, because only one slot has ever been filled,- // so the credential creating the rotation issued stays live alongside the new one.- const first = await rotateSecretRotation({ rotationId, authToken });-- expect(await secretsAt("/services")).toEqual(secretsHolding(2));- expect(fakeIamUserSecret.keys()).toEqual(liveKeys(1, 2));- expect(first.secretRotation!.activeIndex).toBe(1);-- // The second rotation displaces the first credential, never the one the mapped secrets are- // publishing.- const second = await rotateSecretRotation({ rotationId, authToken });-- expect(await secretsAt("/services")).toEqual(secretsHolding(3));- expect(fakeIamUserSecret.keys()).toEqual(liveKeys(2, 3));- expect(second.secretRotation!.activeIndex).toBe(0);- });});describe("A rotation whose provider fails after publishing reports the failure", () => {diff --git a/backend/e2e-test/setup/reset-fakes.ts b/backend/e2e-test/setup/reset-fakes.tsindex fd7f32e7de..f242f3ff07 100644--- a/backend/e2e-test/setup/reset-fakes.ts+++ b/backend/e2e-test/setup/reset-fakes.ts@@ -1,7 +1,6 @@import { auditLogStreamOutboxTuning } from "e2e-test/fakes/audit-log-stream-outbox-constants";import { fakeAwsConnection } from "e2e-test/fakes/aws-connection-fns";import { fakeIamUserSecret } from "e2e-test/fakes/aws-iam-user-secret-rotation-fns";-import { fakeParameterStore } from "e2e-test/fakes/aws-parameter-store-sync-fns";import { fakeS3Bucket } from "e2e-test/fakes/s3";// The fakes are module singletons shared with the server booted in this same process, and the@@ -15,7 +14,6 @@ import { fakeS3Bucket } from "e2e-test/fakes/s3";//// A spec still resets between its own tests; that is its own beforeEach, not this hook.beforeAll(() => {- fakeParameterStore.reset();fakeAwsConnection.reset();fakeS3Bucket.reset();fakeIamUserSecret.reset();diff --git a/backend/vitest.e2e.config.mts b/backend/vitest.e2e.config.mtsindex b8cb8ffa3f..4fcaaac1bc 100644--- a/backend/vitest.e2e.config.mts+++ b/backend/vitest.e2e.config.mts@@ -49,14 +49,13 @@ export default defineConfig({},fileParallelism: false,- // AWS Parameter Store, the AWS IAM user secret rotation provider and the AWS app connection- // are replaced by fakes for the whole e2e run, so the secret sync and secret rotation specs- // can assert what Infisical hands a destination or a rotation provider without reaching AWS.- // Nothing under src/ knows the fakes exist (see e2e-test/fakes/).+ // The AWS IAM user secret rotation provider and the AWS app connection are replaced by fakes+ // for the whole e2e run, so the secret rotation spec can assert what Infisical hands a+ // rotation provider without reaching AWS. Nothing under src/ knows the fakes exist (see+ // e2e-test/fakes/).//// Entries match the *import specifier*, which is what keeps this surgical rather than- // sweeping: "./aws-parameter-store-sync-fns" is imported only by its own barrel,- // "./aws-iam-user-secret/aws-iam-user-secret-rotation-fns" only by+ // sweeping: "./aws-iam-user-secret/aws-iam-user-secret-rotation-fns" is imported only by// secret-rotation-v2-service.ts, and "./aws-connection-fns" only by aws/index.ts. The// full-path entry covers the twelve modules that import the connection functions directly,// of which secret-sync-maps.ts matters here: it calls getAwsAccountId on every sync@@ -69,10 +68,6 @@ export default defineConfig({find: "./license-fns",replacement: path.resolve(__dirname, "./src/ee/services/license/__mocks__/license-fns")},- {- find: "./aws-parameter-store-sync-fns",- replacement: path.resolve(__dirname, "./e2e-test/fakes/aws-parameter-store-sync-fns")- },{find: "./aws-iam-user-secret/aws-iam-user-secret-rotation-fns",replacement: path.resolve(__dirname, "./e2e-test/fakes/aws-iam-user-secret-rotation-fns")