t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/AWS/IAM/SAMLProvider.test.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

50 lines
1.6 KiB
TypeScript

import * as AWS from "@/AWS";
import { SAMLProvider } from "@/AWS/IAM";
import * as Provider from "@/Provider";
import * as Test from "@/Test/Alchemy";
import * as IAM from "@distilled.cloud/aws/iam";
import { describe, expect } from "alchemy-test";
import * as Effect from "effect/Effect";
import * as Redacted from "effect/Redacted";
import { testPrivateKey, testSamlMetadataDocument } from "./fixtures.ts";
const { test } = Test.make({ providers: AWS.providers() });
describe(
"AWS.IAM.SAMLProvider",
{ tags: ["provider:aws", "provider:aws:iam", "live"] },
() => {
test.provider("list enumerates the deployed SAML provider", (stack) =>
Effect.gen(function* () {
yield* stack.destroy();
const deployed = yield* stack.deploy(
Effect.gen(function* () {
return yield* SAMLProvider("ListResource", {
samlMetadataDocument: testSamlMetadataDocument,
// Redacted prop — unwrapped to the wire private key at create.
assertionEncryptionMode: "Allowed",
addPrivateKey: Redacted.make(testPrivateKey),
});
}),
);
expect(deployed.assertionEncryptionMode).toBe("Allowed");
const provider = yield* Provider.findProvider(SAMLProvider);
const all = yield* provider.list();
expect(
all.some((x) => x.samlProviderArn === deployed.samlProviderArn),
).toBe(true);
yield* stack.destroy();
const deleted = yield* IAM.getSAMLProvider({
SAMLProviderArn: deployed.samlProviderArn,
}).pipe(Effect.option);
expect(deleted._tag).toBe("None");
}),
);
},
);