| 1 | import type * as acmpca from "@distilled.cloud/aws/acm-pca"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 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< |
| 45 | acmpca.RevokeCertificateResponse, |
| 46 | acmpca.RevokeCertificateError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | |
| 51 | export const RevokeCertificate = Binding.Service<RevokeCertificate>( |
| 52 | "AWS.ACMPCA.RevokeCertificate", |
| 53 | ); |