Open theduke opened 8 years ago
Actually, I am inclined to go in a different direction by using a string-keyed (rather than atom) map for the options being passed by an un-trusted user.
@garyf Hey there, thanks for making this library!
I also noticed you’re using Maps instead of Keyword lists for the opts. I agree with @theduke that a Keyword list would be more idiomatic for Elixir. But right now, both Maps and Keywords seem to be working with this library anyways.
I was also wondering about your rationale for using a string-keyed map - would the verify/3 function not usually be called from code with trusted information? Or were you referring to the map returned by a successful verification? I think here it might make sense to have an additional option to choose between atoms and strings as keys.
The idiomatic Elixir way would be to accept a Keyword list for options, not a map.
Maybe the API can be changed to accept both for now, and eventually deprecate the map and remove support in a future major release?
I'd be happy to provide a patch.