diff --git a/lib/async/redis/endpoint.rb b/lib/async/redis/endpoint.rb index a76e334..369d2b6 100644 --- a/lib/async/redis/endpoint.rb +++ b/lib/async/redis/endpoint.rb @@ -63,7 +63,7 @@ def self.parse(string, endpoint = nil, **options) # @parameter scheme [String, nil] The scheme to use, e.g. "redis" or "rediss". If nil, will auto-detect. # @parameter hostname [String] The hostname to connect to (or bind to). # @parameter options [Hash] Additional options, passed to {#initialize}. - def self.for(scheme, host, credentials: nil, port: nil, database: nil, **options) + def self.for(scheme, host, port: nil, database: nil, **options) # Auto-detect scheme if not provided: if default_scheme = options.delete(:scheme) scheme ||= default_scheme @@ -82,7 +82,6 @@ def self.for(scheme, host, credentials: nil, port: nil, database: nil, **options self.new( uri_klass.build( scheme: scheme, - userinfo: credentials&.join(":"), host: host, port: port, path: path, diff --git a/test/async/redis/endpoint.rb b/test/async/redis/endpoint.rb index f1ea469..445ca9c 100644 --- a/test/async/redis/endpoint.rb +++ b/test/async/redis/endpoint.rb @@ -106,8 +106,7 @@ it "handles credentials correctly" do endpoint = Async::Redis::Endpoint.for("redis", "localhost", credentials: ["user", "pass"], port: 6380) - expect(endpoint.url.to_s).to be == "redis://user:pass@localhost:6380" - expect(endpoint.url.userinfo).to be == "user:pass" + expect(endpoint.url.to_s).to be == "redis://localhost:6380" expect(endpoint.credentials).to be == ["user", "pass"] end @@ -131,11 +130,10 @@ port: 6380, database: 3 ) - expect(endpoint.url.to_s).to be == "rediss://user:pass@[#{ipv6}]:6380/3" + expect(endpoint.url.to_s).to be == "rediss://[#{ipv6}]:6380/3" expect(endpoint.url.scheme).to be == "rediss" expect(endpoint.url.host).to be == "[#{ipv6}]" expect(endpoint.url.hostname).to be == ipv6 - expect(endpoint.url.userinfo).to be == "user:pass" expect(endpoint.url.port).to be == 6380 expect(endpoint.url.path).to be == "/3" expect(endpoint).to be(:secure?)