csquared / fernet.js

Javascript implementation of Fernet symmetric encryption https://github.com/kr/fernet-spec
MIT License
73 stars 29 forks source link

moved the invalid token ttl and far-future timestamp errors to only o… #20

Closed robertjkeck2 closed 4 years ago

robertjkeck2 commented 4 years ago

Similar to this discussion in this Python Crypto issue, the far-future timestamp should only be checked if the TTL value is not null (a.k.a > 0 in this implementation). This PR moves the Invalid Token: TTL and Error: far-future timestamp errors into a conditional to test if TTL is > 0.

The tests have also been updated and additional linting was done as well.

robertjkeck2 commented 4 years ago

@csquared let me know if you have any questions or if I'd be better of just doing an npm fork if you aren't still maintaining this project!

csquared commented 4 years ago

Hey @robertjkeck2 - this change looks good but do you mind restricting it to just the desired functionality (and without all the whitespace changes). Conversely, if that's a common linter pattern now happy to merge and cut a new release.

aditya-toppr commented 2 years ago

@csquared These changes are not reflecting in the latest npm lib version(0.3.1). When is this expected to be released in the new version?
Would really appreciate if this can be released as early as possible.

csquared commented 2 years ago

I'll go ahead and get this released

csquared commented 2 years ago

Just released 0.4.0

aditya-toppr commented 2 years ago

Thanks @csquared . Really appreciate you releasing it this early.