Skip to content

Remove unnecessary HTTP restriction on using Crypto API #716

@olitomlinson

Description

@olitomlinson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions