| 1 | import type * as signer from "@distilled.cloud/aws/signer"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { SigningProfile } from "./SigningProfile.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `signer:RevokeSigningProfile`. |
| 8 | * |
| 9 | * Revokes a version of the bound {@link SigningProfile}, permanently |
| 10 | * invalidating every signature that version produced on or after |
| 11 | * `effectiveTime` — the incident-response lever when signing material is |
| 12 | * compromised. Revocation is irreversible. The profile name is injected from |
| 13 | * the binding; pass the `profileVersion` to revoke. Provide the |
| 14 | * implementation with `Effect.provide(AWS.Signer.RevokeSigningProfileHttp)`. |
| 15 | * ### Revoking Signatures |
| 16 | * **Example:** Revoke a Compromised Profile Version |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the profile |
| 19 | * const revokeSigningProfile = yield* AWS.Signer.RevokeSigningProfile(profile); |
| 20 | * |
| 21 | * // runtime — invalidate everything the version signed from now on |
| 22 | * yield* revokeSigningProfile({ |
| 23 | * profileVersion, |
| 24 | * reason: "signing key compromised", |
| 25 | * effectiveTime: new Date(), |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface RevokeSigningProfile extends Binding.Service< |
| 32 | RevokeSigningProfile, |
| 33 | "AWS.Signer.RevokeSigningProfile", |
| 34 | ( |
| 35 | profile: SigningProfile, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: Omit<signer.RevokeSigningProfileRequest, "profileName">, |
| 39 | ) => Effect.Effect< |
| 40 | signer.RevokeSigningProfileResponse, |
| 41 | signer.RevokeSigningProfileError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | export const RevokeSigningProfile = Binding.Service<RevokeSigningProfile>( |
| 46 | "AWS.Signer.RevokeSigningProfile", |
| 47 | ); |