dapr / dapr/js-sdk

Remove unnecessary HTTP restriction on using Crypto API

Open
#716 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
217
Forks
104
PR merge metrics
No merged PRs in 30d

Description

When trying to use the JS SDK (when in HTTP mode) the `encrypt` and `decrypt` methods are blocked, by throwing the following exception :

` 'crypto.decrypt' is not available using the HTTP APIs`

Please remove these checks so that it does not unexpectedly block these methods.

https://github.com/dapr/js-sdk/blame/26e8be8931aed2404e0e382b6c61264d1b64f0de/src/implementation/Client/HTTPClient/crypto.ts#L33

https://github.com/dapr/js-sdk/blame/26e8be8931aed2404e0e382b6c61264d1b64f0de/src/implementation/Client/HTTPClient/crypto.ts#L42

The docs say

> While both HTTP and gRPC are supported in the alpha release, using the gRPC APIs with the supported Dapr SDKs is the recommended approach for cryptography.

This recommendation is **only** important for payloads of significant size (buffering vs streaming), therefor this hard constraint in the SDK is not accurate and overly-restrictive, and presents another unexpected hurdle to developers who just want to make progress.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.