You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using Cloudflare Workers with the Apple App Store Server API. This api uses JWS with X509 verification. In order to parse and verify responses from the server we need to be able to use the nodejs X509Certificate class.
sorry, we're still using this error on latest runtime node-compact
Is import ... from 'crypto' support or it must be prefixed with node:?
import{NextRequest,NextResponse}from'next/server';import{decodeNotificationPayload,isDecodedNotificationDataPayload,isDecodedNotificationSummaryPayload}from'app-store-server-api';import{appStoreNotifications}from'@/db/schema';import{drizzleOnWorkers}from'@/db/drizzle_from_env';importcryptofrom'node:crypto';constAPP_BUNDLE_ID=process.env.APP_BUNDLE_ID!;exportconstruntime='edge';exportasyncfunctionPOST(request: NextRequest){try{const{ signedPayload }=awaitrequest.json()as{signedPayload: string};console.log("π ~ POST ~ signedPayload:",signedPayload,'crypto:',crypto,crypto.X509Certificate)// the last element is undefined.// Decode and verify the notification payloadconstpayload=awaitdecodeNotificationPayload(signedPayload);// error hereconsole.log("π ~ POST ~ payload:",payload)
I'm currently using Cloudflare Workers with the Apple App Store Server API. This api uses JWS with X509 verification. In order to parse and verify responses from the server we need to be able to use the nodejs X509Certificate class.
Here's an example of it in use in the app-store-server-api nodejs library: https://github.com/agisboye/app-store-server-api/blob/main/src/Decoding.ts#L79
The text was updated successfully, but these errors were encountered: