@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 44 lines 1.61 KB
Raw
1 import * as AWS from "@alchemy.run/aws";
2 import { SAMLProvider } from "@alchemy.run/aws/IAM";
3 import { describe, expect } from "@alchemy.run/test";
4 import * as Test from "@alchemy.run/test/Alchemy";
5 import * as IAM from "@distilled.cloud/aws/iam";
6 import * as Provider from "alchemy/Provider";
7 import * as Effect from "effect/Effect";
8 import * as Redacted from "effect/Redacted";
9 import { testPrivateKey, testSamlMetadataDocument } from "./fixtures.ts";
10
11 const { test } = Test.make({ providers: AWS.providers() });
12
13 describe("AWS.IAM.SAMLProvider", { tags: ["provider:aws", "provider:aws:iam", "live"] }, () => {
14 test.provider("list enumerates the deployed SAML provider", (stack) =>
15 Effect.gen(function* () {
16 yield* stack.destroy();
17
18 const deployed = yield* stack.deploy(
19 Effect.gen(function* () {
20 return yield* SAMLProvider("ListResource", {
21 samlMetadataDocument: testSamlMetadataDocument,
22 // Redacted prop — unwrapped to the wire private key at create.
23 assertionEncryptionMode: "Allowed",
24 addPrivateKey: Redacted.make(testPrivateKey),
25 });
26 }),
27 );
28
29 expect(deployed.assertionEncryptionMode).toBe("Allowed");
30
31 const provider = yield* Provider.findProvider(SAMLProvider);
32 const all = yield* provider.list();
33
34 expect(all.some((x) => x.samlProviderArn === deployed.samlProviderArn)).toBe(true);
35
36 yield* stack.destroy();
37
38 const deleted = yield* IAM.getSAMLProvider({
39 SAMLProviderArn: deployed.samlProviderArn,
40 }).pipe(Effect.option);
41 expect(deleted._tag).toBe("None");
42 }),
43 );
44 });