joken icon indicating copy to clipboard operation
joken copied to clipboard

Why do claim need to have binary keys?

Open anthonator opened this issue 2 years ago • 1 comments

The claims/0 spec is defined as claims() :: %{required(binary()) => term(). I'm curious why the claims you pass into Joken functions need to have binary keys. It also works with atom keys but dialyzer fails.

anthonator avatar Jun 07 '22 18:06 anthonator

This is probably just because claims are JSON data and that is how JSON libraries usually encode to the format. Nothing really "needed" but thought of as a good practice when dealing with JSON in general.

Do you have a particular use case that atom keys would be a nice fit?

victorolinasc avatar Jun 18 '22 22:06 victorolinasc