1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

chore(acl): add test with requirepass and aclfile (#3312)

* add a test that uses both requirepass and aclfile

Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
Kostas Kyrimis 2024-07-15 08:28:29 +03:00 committed by GitHub
parent 4e3bd94358
commit 73abd68f2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -457,6 +457,23 @@ async def test_require_pass(df_factory):
await client.close()
@pytest.mark.asyncio
@dfly_args({"port": 1111, "requirepass": "temp"})
async def test_require_pass_with_acl_file_order(df_factory, tmp_dir):
acl = create_temp_file(
"USER default ON >jordan ~* +@all",
tmp_dir,
)
df = df_factory.create(aclfile=acl)
df.start()
client = aioredis.Redis(username="default", password="jordan", port=df.port)
assert await client.set("foo", "bar")
await client.close()
@pytest.mark.asyncio
async def test_set_acl_file(async_client: aioredis.Redis, tmp_dir):
acl_file_content = "USER roy ON #ea71c25a7a602246b4c39824b855678894a96f43bb9b71319c39700a1e045222 +@string +@fast +hset\nUSER john on nopass +@string"