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

fix type specs and doc #266

Merged
merged 3 commits into from
Feb 4, 2020
Merged

fix type specs and doc #266

merged 3 commits into from
Feb 4, 2020

Conversation

woylie
Copy link
Contributor

@woylie woylie commented Feb 4, 2020

This fixes three issues I encountered.

  1. The docs for the Joken.Hooks.RequiredClaims had an example which wrapped the required claims in a keyword list, but the hook required just a plain list. I changed the docs. However, the Joken.Hooks behaviour asks for a keyword list as the first argument for all callbacks, so it would probably be better to change the implementation, although that would be a breaking change. If you prefer that, let me know and I'll change it.
  2. Joken.Jwks requires you to set the default signer to nil. If you call Joken.verify_and_validate/5 etc. directly and pass nil as a signer, you will get a dialyzer error. I changed the type specs of all those functions to allow nil as signer.
  3. You can pass options along with the hook module name, which wasn't reflected in the type specs and caused dialyzer errors.

@victorolinasc
Copy link
Collaborator

Awesome @woylie ! Thanks a lot for your work!

I don't think we should add a breaking change... it was my mistake but people should be already depending on it.

I still plan to release a new major version but haven't had the time to code about a crypto only signer dep. Let's live with this incompatibility for the time being.

Once again thanks for your work. I'll merge this and some other deps update and release a new version soon.

@victorolinasc victorolinasc merged commit 5f48455 into joken-elixir:master Feb 4, 2020
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.

2 participants