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

Support additional JWT algorithms #85

Merged
merged 2 commits into from
Aug 8, 2018
Merged

Support additional JWT algorithms #85

merged 2 commits into from
Aug 8, 2018

Conversation

mmacai
Copy link
Collaborator

@mmacai mmacai commented Jul 23, 2018

  • added support to JWT verification to use RS256 algorithm
  • now support HS256, RS256, should be easily extendible in future for other algorithms
  • covered by tests
  • configurable by env var JWT_ALG - defaults to HS256
  • bumped up Joken version
  • if using RS256 expects PEM key as a JWT_SECRET_KEY

closes #84

@mmacai mmacai requested a review from kevinbader July 23, 2018 14:14
Copy link
Contributor

@kevinbader kevinbader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

With Elixir 1.7.2 I get

warning: variable "msg" does not exist and is being expanded to "msg()", please use parentheses to remove the ambiguity or change the variable name
  lib/rig_inbound_gateway_web/presence/channel.ex:170


== Compilation error in file lib/rig_inbound_gateway_web/presence/channel.ex ==
** (CompileError) lib/rig_inbound_gateway_web/presence/channel.ex:170: undefined function msg/0
    (stdlib) lists.erl:1338: :lists.foreach/2
    (stdlib) erl_eval.erl:677: :erl_eval.do_apply/6

This is because of the side effect (assignment) happening within a log statement that gets stripped by the compiler according to the log level in use. Anyway, this is solved in #80 (https://github.com/Accenture/reactive-interaction-gateway/pull/80/files#diff-44e879ef2af4eddd079e66e7059d35d2R169), so let's simply merge this one afterwards.

@mmacai mmacai merged commit d672c72 into master Aug 8, 2018
@kevinbader kevinbader deleted the jwt-algorithms branch August 8, 2018 10:20
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

Successfully merging this pull request may close these issues.

Support additional JWT algorithms
2 participants