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
| 1 | import type * as kms from "@distilled.cloud/aws/kms"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { AliasName } from "./Alias.ts"; |
| 5 | import type { Key } from "./Key.ts"; |
| 6 | |
| 7 | export interface GetPublicKeyRequest extends Omit<kms.GetPublicKeyRequest, "KeyId"> {} |
| 8 | |
| 9 | /** |
| 10 | * Runtime binding for `kms:GetPublicKey`. |
| 11 | * |
| 12 | * Bind this operation to an asymmetric KMS {@link Key} (or the `alias/...` |
| 13 | * name of a pre-existing key) to get a callable that automatically injects |
| 14 | * the `KeyId`. Returns the DER-encoded public key so callers can verify |
| 15 | * signatures or encrypt locally without a KMS round-trip per operation. |
| 16 | * |
| 17 | * ### Signing |
| 18 | * **Example:** Download the Public Key |
| 19 | * ```typescript |
| 20 | * const getPublicKey = yield* AWS.KMS.GetPublicKey(signingKey); |
| 21 | * |
| 22 | * const { PublicKey, SigningAlgorithms } = yield* getPublicKey({}); |
| 23 | * // PublicKey is the DER-encoded SubjectPublicKeyInfo |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetPublicKey extends Binding.Service< |
| 29 | GetPublicKey, |
| 30 | "AWS.KMS.GetPublicKey", |
| 31 | ( |
| 32 | key: Key | AliasName, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetPublicKeyRequest, |
| 36 | ) => Effect.Effect<kms.GetPublicKeyResponse, kms.GetPublicKeyError> |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const GetPublicKey = Binding.Service<GetPublicKey>("AWS.KMS.GetPublicKey"); |