mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-16 23:37:44 +02:00
50 lines
1.6 KiB
TypeScript
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");
|
|
}),
|
|
);
|
|
},
|
|
);
|