| 1 | import * as kms from "@distilled.cloud/gcp/cloudkms_v1"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeCryptoKeyHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { Decrypt } from "./Decrypt.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link Decrypt}. |
| 8 | * |
| 9 | * @layer |
| 10 | * @provides GCP.KMS.Decrypt |
| 11 | */ |
| 12 | export const DecryptHttp = Layer.effect( |
| 13 | Decrypt, |
| 14 | makeCryptoKeyHttpBinding({ |
| 15 | tag: "GCP.KMS.Decrypt", |
| 16 | iam: { role: "roles/cloudkms.cryptoKeyDecrypter", on: "kms.cryptoKey" }, |
| 17 | operation: kms.decryptProjectsLocationsKeyRingsCryptoKeys, |
| 18 | }), |
| 19 | ); |