From e34e1a1a2158ca92715fb19988398d9f625a0c88 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Sun, 30 Jan 2022 04:51:29 +0200 Subject: [PATCH 1/4] unsupported auth --- redis/commands/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 73003e7fb6..075c6ccda9 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -314,6 +314,11 @@ class ManagementCommands: Redis management commands """ + def auth(self): + raise NotImplementedError( + "COMMAND INFO is intentionally not implemented in the client." + ) + def bgrewriteaof(self, **kwargs): """Tell the Redis server to rewrite the AOF file from data in memory. From 4ee97793085e7390efa9e02abca778f9cef270ae Mon Sep 17 00:00:00 2001 From: dvora-h Date: Sun, 30 Jan 2022 04:53:23 +0200 Subject: [PATCH 2/4] unsupported-auth --- redis/commands/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index 075c6ccda9..5ef1a5b331 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -316,7 +316,7 @@ class ManagementCommands: def auth(self): raise NotImplementedError( - "COMMAND INFO is intentionally not implemented in the client." + "AUTH is intentionally not implemented in the client." ) def bgrewriteaof(self, **kwargs): From 5edb8536d5767ab6a959bba6376f016236c0e262 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Thu, 3 Feb 2022 12:54:56 +0200 Subject: [PATCH 3/4] add test and docstring --- redis/commands/core.py | 7 +++++++ tests/test_commands.py | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 5ef1a5b331..7dd5b598bc 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -315,6 +315,13 @@ class ManagementCommands: """ def auth(self): + """ + The AUTH command authenticates the current connection in two cases: + 1. If the Redis server is password protected via the requirepass option. + 2. If a Redis 6.0 instance, or greater, is using the Redis ACL system. + + For more information check https://redis.io/commands/auth + """ raise NotImplementedError( "AUTH is intentionally not implemented in the client." ) diff --git a/tests/test_commands.py b/tests/test_commands.py index b28b63ea6e..9705f7cd3c 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -71,6 +71,10 @@ def test_command_on_invalid_key_type(self, r): r["a"] # SERVER INFORMATION + def test_auth_not_implemented(self, r): + with pytest.raises(NotImplementedError): + r.auth() + @skip_if_server_version_lt("6.0.0") def test_acl_cat_no_category(self, r): categories = r.acl_cat() From 5100dd94ad0e7ee85b8ff83ab0abd9b20f80211a Mon Sep 17 00:00:00 2001 From: dvora-h Date: Sun, 6 Feb 2022 11:35:01 +0200 Subject: [PATCH 4/4] fix docstring --- redis/commands/core.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index 7dd5b598bc..36be0c14f4 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -316,11 +316,8 @@ class ManagementCommands: def auth(self): """ - The AUTH command authenticates the current connection in two cases: - 1. If the Redis server is password protected via the requirepass option. - 2. If a Redis 6.0 instance, or greater, is using the Redis ACL system. - - For more information check https://redis.io/commands/auth + This function throws a NotImplementedError since it is intentionally + not supported. """ raise NotImplementedError( "AUTH is intentionally not implemented in the client."