Ianleeclark / Paseto

An Elixir implementation of Paseto (Platform-Agnostic Security Tokens)
Other
97 stars 8 forks source link

Improve `parse_token/2` and `generate_token/5` #85

Closed sgessa closed 4 months ago

sgessa commented 5 months ago

It seems that generate_token/5 expects a keypair, at least when the scope is public. However I believe it should only need the secret key, in fact the public key is ignored. To avoid this, it's possible to pass {nil, sk} or if possible, determine the public key from the secret key but it could be annoying..

Same thing goes for parse_token/2

Also the specs for generate_token only list 4 arguments but the function takes 5 arguments.

sgessa commented 5 months ago

@Ianleeclark could you please have a look? thx!

baldarn commented 5 months ago

interested! any updates?

Ianleeclark commented 5 months ago

Thank you for the PR! I just got back from vacation, but I'll try and find some time for this before Friday

Ianleeclark commented 4 months ago

Sorry for the delay, I'll get it released in a few hours!