-
Notifications
You must be signed in to change notification settings - Fork 376
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
Preperations for version 2.x #49
Conversation
JWT, JWS, JWA logic should be represented in seperate modules. Added new pending tests for each module. Update travis configuration. Dropped support for jruby and rbx for now. Added some more configuration options for travis. Renamed spec/helper to spec/spec_helper. All tests now load the modules by relative path. Added empty JWA and JWS modules.
Dropping ruby mri 1.8 support due to the missing require_relative support. Adding codeclimate test reporter gem. Update spec/spec_helper configuration.
Add first HMAC functionality to JWA.
Make rspec tests more readable. Add missing bit to description for HMAC rspec test cases.
Add basic support for RSA-SHA functionality. Add bin/prepare-test.sh file. Generates certificates required for running the tests. Update .gitignore file. Update .travis.yml file.
ECDSA cannot be implemented without fixing following bug in the ruby openssl libs: https://bugs.ruby-lang.org/issues/5600
Add simple plain verification and signing functions. Uncomment and disable ecdsa features.
Drop old code. Reformat code. Drop current code. Add first specs to cover simple HS256 decoding and encoding.
See: JSON Web Algorithms (only for digital signatures) https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-38#section-3
Extend JWA HMAC logic, add sign/verify basic logic and tests. Break tests by removing padding from base64 encoded strings. TODO: Implement padding handling for base64 strings in order to be compatible with the JOSE JWT/JWS/JWA specs.
Add JWA::NONE for plain JWT Update JWT to integrate JWA
# But with some leeway, it will still validate | ||
JWT.decode(jwt_payload, 'secret', true, leeway=10) | ||
```ruby | ||
jwt_payload = JWT.encode({'exp': Time.now.to_i + 30}, 'secret') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm just nitpicking here but in the code blocks throughout the README you're using different hash syntaxes, double and single quotes etc.
Since Ruby 1.8 is removed in that PR how about replacing all of these with the short notation?
(e.g. { exp: Time.now.to_i }
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. I will change this and update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. :)
Change examples to use to current hash syntax since ruby 1.8 dropped in version 2.x.
I think it is time to clean up the single module behavior of the jwt gem to keep up with the specs of JWT and the underlying specs (JWS, JWE, JWA, JWK). As a result the gem should match at least the JWT specifications for the signing of JSON Web Tokens. Encryption may be another goal to but I think it shouldn't be the main approach.
The code is not complete yet. I'd like to get feedback or a code review for the current code base and maybe we can add a milestone and figure out what should be implemented in the version 2.x branch.
What I've done so far:
Goals: