fastly / js-compute-runtime

JavaScript SDK and runtime for building Fastly Compute applications
https://developer.fastly.com/learning/compute/javascript/
Apache License 2.0
193 stars 26 forks source link

feat: dynamic backends clientCertificate with SecretStore fromBytes, rawbytes #796

Closed guybedford closed 1 month ago

guybedford commented 1 month ago

Implements https://github.com/fastly/js-compute-runtime/issues/794. API as per types/backend.d.ts.

SecretStore is extended to support SecretStore.fromBytes and SecretStoreEntry.prototype.rawbytes() to get the raw buffer for a secret instead of the UTF8 encoding.

The new client cert option is then implemented for dynamic backends taking an object with a certificate string and key SecretStoreEntry properties, with error handling.

This PR also updates to the latest wit-bindgen, regenerating the world, and reenables the secret store tests which got dropped in the refactoring PR in https://github.com/fastly/js-compute-runtime/pull/673.