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

main
ts 48 lines 1.53 KB
Raw
1 import type * as acmpca from "@distilled.cloud/aws/acm-pca";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { CertificateAuthority } from "./CertificateAuthority.ts";
5
6 export interface RevokeCertificateRequest extends Omit<
7 acmpca.RevokeCertificateRequest,
8 "CertificateAuthorityArn"
9 > {}
10
11 /**
12 * Runtime binding for `acm-pca:RevokeCertificate`.
13 *
14 * Bind a {@link CertificateAuthority} inside a function runtime to revoke
15 * certificates the CA issued (e.g. on credential compromise). Revoked
16 * certificates appear in the CA's CRL/OCSP responses when revocation is
17 * configured. The serial number is the hex serial from the issued
18 * certificate. Provide `ACMPCA.RevokeCertificateHttp` on the Function
19 * effect to implement the binding.
20 *
21 * ### Revoking Certificates
22 * **Example:** Revoke a Compromised Certificate
23 * ```typescript
24 * // init
25 * const revokeCertificate = yield* ACMPCA.RevokeCertificate(ca);
26 *
27 * // runtime
28 * yield* revokeCertificate({
29 * CertificateSerial: serialHex,
30 * RevocationReason: "KEY_COMPROMISE",
31 * });
32 * ```
33 *
34 * @binding
35 */
36 export interface RevokeCertificate extends Binding.Service<
37 RevokeCertificate,
38 "AWS.ACMPCA.RevokeCertificate",
39 (
40 certificateAuthority: CertificateAuthority,
41 ) => Effect.Effect<
42 (
43 request: RevokeCertificateRequest,
44 ) => Effect.Effect<acmpca.RevokeCertificateResponse, acmpca.RevokeCertificateError>
45 >
46 > {}
47
48 export const RevokeCertificate = Binding.Service<RevokeCertificate>("AWS.ACMPCA.RevokeCertificate");