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

Make JWT the first argument for Elixir sign and encrypt functions #85

Open
tanguilp opened this issue Apr 9, 2020 · 0 comments
Open

Comments

@tanguilp
Copy link

tanguilp commented Apr 9, 2020

To make using pipes more natural with Elixir, I suggest that the first argument of signature and encryptions functions become the JWT to be signed or encrypted in the next version. It seems to me that it is a common practice in the Elixir community to have the subject of the operation as the first parameter of the function. It'd allow writing:

%{
iss: iss,
exp: now() + 30,
...
}
|> JOSE.JWT.from_map()
|> JOSE.JWT.sign(some_jwk)
|> JOSE.JWS.compact()
|> elem(1)
@potatosalad potatosalad added this to the jose 2.0.0 milestone Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants