Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[preset/client] Custom hash function for persisted operations #9994

Open
nahn20 opened this issue Jun 9, 2024 · 1 comment
Open

[preset/client] Custom hash function for persisted operations #9994

nahn20 opened this issue Jun 9, 2024 · 1 comment

Comments

@nahn20
Copy link
Contributor

nahn20 commented Jun 9, 2024

Is your feature request related to a problem? Please describe.

I'd like to add more flexibility for persisted operations to allow developers to insert a custom hashing function instead of being limited to sha1 and sha256. This helps to avoid any issues requesting additional algorithms in the future, as well as supports additional use-cases. For example, I have a use-case in which we sign operations with a specific secret, and I'd like to re-use that for the persisted operation hash.

Describe the solution you'd like

An additional configuration option allowing developers to pass in a hashFunction. I've put together a proof of concept here. (Also, I'm happy to create a pull request for this).

Describe alternatives you've considered

Currently, I'm using this plugin which supports the use-case of generating an additional file with the operations and the hashes. For convenience, simplicity, and bundle size, I'd like to attach the hash to the operation document itself.

Is your feature request related to a problem? Please describe.

No response

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jun 9, 2024

Instead of adding a nee config option we can make allow the existing hash algorithm property to be a function. Please feel free to send a PR with tests and documentation updates!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants