| 1 | import * as paymentcryptographydata from "@distilled.cloud/aws/payment-cryptography-data"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makePaymentCryptographyKeyPairHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { GeneratePinData } from "./GeneratePinData.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link GeneratePinData} — grants the host Function |
| 8 | * `payment-cryptography:GeneratePinData` on both the generation key (PVK) |
| 9 | * and the encryption key (PEK) and calls the Payment Cryptography Data API |
| 10 | * at runtime. |
| 11 | */ |
| 12 | export const GeneratePinDataHttp = Layer.effect( |
| 13 | GeneratePinData, |
| 14 | makePaymentCryptographyKeyPairHttpBinding({ |
| 15 | tag: "AWS.PaymentCryptography.GeneratePinData", |
| 16 | operation: paymentcryptographydata.generatePinData, |
| 17 | actions: ["payment-cryptography:GeneratePinData"], |
| 18 | keyFields: ["GenerationKeyIdentifier", "EncryptionKeyIdentifier"], |
| 19 | }), |
| 20 | ); |