Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2421

Auth mechanism properties not downcased when client is created with host and Ruby options with symbol key

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.14.0.rc1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible

      Correct behavior - string key:

      irb(main):003:0> Mongo::Client.new(['localhost'],'auth_mech_properties'=>{Foo:42}).options
      => {"database"=>"admin", "retry_reads"=>true, "retry_writes"=>true, "auth_mech_properties"=>{"foo"=>42}}
      

      Correct behavior - URI + Ruby option:

      irb(main):004:0> Mongo::Client.new('mongodb://localhost',auth_mech_properties:{Foo:42}).options
      => {"database"=>"admin", "retry_reads"=>true, "retry_writes"=>true, "auth_mech_properties"=>{"foo"=>42}}
      

      Wrong behavior - host + Ruby option with symbol key:

      irb(main):002:0> Mongo::Client.new(['localhost'],auth_mech_properties:{Foo:42}).options
      => {"database"=>"admin", "retry_reads"=>true, "retry_writes"=>true, "auth_mech_properties"=>{"Foo"=>42}}
      

      This makes AWS auth not work when the session token is specified using the uppercase AWS_SESSION_TOKEN key when :auth_mech_properties is a symbol.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: