Skip to content

Options hash uses both symbols and strings as keys. #95

Closed
@aj-michael

Description

@aj-michael

I tried to verify the issuer on a JWT that I was decoding today, and I found this line (and others like it) very ugly.

if options[:verify_iss] && options['iss']

This means that my code to decode the JWT looked like this:

JWT.decode(token, public_key, true, :verify_iss => true, 'iss' => 'my issuer')

In my opinion, the consumer of this API should be be able to do one of the following:

  1. Always use symbols as keys in the options hash.
  2. Always use strings as keys in the options hash.
  3. Be able to either use symbols or keys in the options in hash and have our library deal with it under the hood.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions