copilot-extensions / preview-sdk.js

An SDK that streamlines extension development by automating request verification, response formatting, and API interactions
MIT License
5 stars 7 forks source link

Implement payload verification using WebCrypto API #12

Open gr2m opened 3 weeks ago

gr2m commented 3 weeks ago

The payload verification is currently implemented using node's built-in crypto module: https://github.com/copilot-extensions/preview-sdk.js/blob/06310d78c9b994ddbdec9f88f404d882b599d820/index.js#L17-L19

But all modern JS run time environments now have the global crypto API which is WebCrypto - including Node.js.

For compatibility with @octokit which aims to be as universal as possible, we should implement that method using WebCrypto.

francisfuzz commented 2 days ago

the global crypto API which is WebCrypto - including Node.js.

For reference: Node.js v22.9.0 Docs: Web Crypto API