Skip to content

v0.6.0 breaks omniauth due to transform_keys change #271

@JamesChevalier

Description

@JamesChevalier

The original worked:
https://github.com/oauth-xx/oauth-ruby/blob/de8c3861cf9669cfd10066479d4a3507d4d6a590/lib/oauth/consumer.rb#L98-L100

The new version does not:
https://github.com/oauth-xx/oauth-ruby/blob/62d3f3e52daa565a04e508df915456a21a7faf37/lib/oauth/consumer.rb#L106

It's because omniauth ultimately defines options as a Hashie::Mash not a Hash:
https://github.com/omniauth/omniauth/blob/master/lib/omniauth/strategy.rb#L547
https://github.com/omniauth/omniauth/blob/master/lib/omniauth/key_store.rb#L5

Hashie::Mash.new(one: "1", two: "2").transform_keys(&:to_sym)
{"one"=>"1", "two"=>"2"}

Hashie::Mash.new(one: "1", two: "2").to_hash.transform_keys(&:to_sym)
=> {:one=>"1", :two=>"2"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions