scala-redis icon indicating copy to clipboard operation
scala-redis copied to clipboard

Issue #293 Unit tests demonstrating that BATCH mode redis client does not properly authenticate

Open noahlz opened this issue 3 years ago • 3 comments

I'm investigating an issue similar to Issue #282 and decided to add a unit test that demonstrates how the RedisClientPool supports Authentication.

noahlz avatar Nov 03 '21 16:11 noahlz

[info] SecurePoolSpec:
[info] redis pools with authentication
[info] - should be able to connect as normal
[info] ad-hoc clients connecting to a secure redis server
[info] - should be rejected for no password
[info] - should be rejected for wrong password

noahlz avatar Nov 03 '21 16:11 noahlz

[info] SecureBatchedPipelineSpec:
[info] a redis client in batch mode connecting to a password-protected redis instance
[info] - should be able to connect to the instance *** FAILED ***
[info]   An unexpected java.lang.Exception was thrown. (PipelineSpec.scala:388)
[info] - should be rejected when it is not initialized with a password
[info] - should be rejected when it is initialized with an incorrect password
[info] com.redis.SecureBatchedPipelineSpec *** ABORTED ***
[info]   java.lang.Exception: NOAUTH Authentication required.
[info]   at com.redis.Reply$$anonfun$errReply$1.applyOrElse(RedisProtocol.scala:132)
[info]   at com.redis.Reply$$anonfun$errReply$1.applyOrElse(RedisProtocol.scala:131)
[info]   at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:35)
[info]   at com.redis.Reply$$anonfun$singleLineReply$1.applyOrElse(RedisProtocol.scala:77)
[info]   at com.redis.Reply$$anonfun$singleLineReply$1.applyOrElse(RedisProtocol.scala:77)
[info]   at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
[info]   at com.redis.Reply$$anonfun$integerReply$1.applyOrElse(RedisProtocol.scala:67)
[info]   at com.redis.Reply$$anonfun$integerReply$1.applyOrElse(RedisProtocol.scala:67)
[info]   at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
[info]   at com.redis.Reply.receive(RedisProtocol.scala:152)
[info]   ...

noahlz avatar Nov 03 '21 17:11 noahlz

These unit tests expose #293

noahlz avatar Nov 03 '21 17:11 noahlz