vuestorefront / storefront-api

Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
https://storefrontapi.com
MIT License
8 stars 1 forks source link

Fix util missing cipher iv #110

Open oleksii-lisovyi opened 3 years ago

oleksii-lisovyi commented 3 years ago

Related issues

-

Short description and why it's useful

This pull request fixes issue with getting error while encrypting/decrypting any text via @storefront-api/lib/util enryptToken() or decryptToken() functions:

Error: Missing IV for cipher aes-256-ctr

In quick way the issue could be reproduced with the following sample code:


const util = require('@storefront-api/lib/util');

util.encryptToken('text', 'my_secret');

Also it's occurred when you're calling endpoints /user/login, /user/refresh.

Note: There is another implementation of the issue that was already proposed before - https://github.com/vuestorefront/storefront-api/pull/103, but due to implementation issues I found and because I only want to fix the issue itself, the current PR was created in favour.

Screenshots of visual changes before/after (if there are any)

IMPORTANT NOTICE - Remember to update CHANGELOG.md with a description of your change

Contribution and currently important rules acceptance

oleksii-lisovyi commented 3 years ago

Hi @pkarw! Thank you for code review. Could you please estimate the time this fixed version will be available as a NPM package (https://www.npmjs.com/package/@storefront-api/lib) ?

oleksii-lisovyi commented 3 years ago

Oh, actually the code review is not finished yet. Waiting for second code review.

oleksii-lisovyi commented 3 years ago

Any updates @pkarw? Is there anyone else who can do the code review as well?

oleksii-lisovyi commented 2 years ago

One more try. @pkarw any updates on this? Is there any chance of processing the PR?