@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, 04:45 UTC

main
ts 44 lines 1.47 KB
Raw
1 import type * as iam from "@distilled.cloud/aws/iam";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `iam:GetContextKeysForPrincipalPolicy` — list the
7 * condition context keys referenced by all policies attached to an existing
8 * IAM user, group, or role, so a principal simulation can be primed with the
9 * right `ContextEntries`.
10 *
11 * The principal (`PolicySourceArn`) is chosen per request, so the binding
12 * takes no arguments and grants `iam:GetContextKeysForPrincipalPolicy` on
13 * `*`. Provide the implementation with
14 * `Effect.provide(AWS.IAM.GetContextKeysForPrincipalPolicyHttp)`.
15 *
16 * ### Simulating Policies
17 * **Example:** Discover a Role's Context Keys
18 * ```typescript
19 * // init
20 * const getContextKeys = yield* IAM.GetContextKeysForPrincipalPolicy();
21 *
22 * // runtime
23 * const { ContextKeyNames } = yield* getContextKeys({
24 * PolicySourceArn: roleArn,
25 * });
26 * ```
27 *
28 * @binding
29 */
30 export interface GetContextKeysForPrincipalPolicy extends Binding.Service<
31 GetContextKeysForPrincipalPolicy,
32 "AWS.IAM.GetContextKeysForPrincipalPolicy",
33 () => Effect.Effect<
34 (
35 request: iam.GetContextKeysForPrincipalPolicyRequest,
36 ) => Effect.Effect<
37 iam.GetContextKeysForPolicyResponse,
38 iam.GetContextKeysForPrincipalPolicyError
39 >
40 >
41 > {}
42 export const GetContextKeysForPrincipalPolicy = Binding.Service<GetContextKeysForPrincipalPolicy>(
43 "AWS.IAM.GetContextKeysForPrincipalPolicy",
44 );