1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00
Commit graph

50 commits

Author SHA1 Message Date
Kostas Kyrimis
ec353e1522
chore: add logs to test_acl_cat_commands_multi_exec_squash (#3826)
* add logs to test

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-09-30 12:03:40 +00:00
Kostas Kyrimis
b19f722011
chore: do not close connections at the end of pytest (#3811)
A common case is that we need to clean up a connection before we exit a test via .close() method. This is needed because otherwise the connection will raise a warning that it is left unclosed. However, remembering to call .close() at each connection at the end of the test is cumbersome! Luckily, fixtures in python can be marked as async which allow us to:

* cache all clients created by DflyInstance.client()
* clean them all at the end of the fixture in one go

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-09-30 09:54:41 +03:00
Shahar Mike
9aadc0cd2b
fix: Fix flaky test test_acl_revoke_pub_sub_while_subscribed (#3768)
fix: Fix flaky test `test_acl_revoke_pub_sub_while_subscribed`

The reason it failed is that, in some rare cases, the subscriber did not
get the first few messages of the publisher. This is likely due to
timing of subscribe and publish, in different connections / threads.

Given Pub/Sub has very weak guarantees, it's probably ok as is, so I
just added a sleep to get the test to pass always.
2024-09-24 11:47:17 +03:00
Kostas Kyrimis
15fce9df2d
chore: logs on assert fail for test_acl_cat_commands_multi_exec_squash (#3749)
* print result if assertion fails

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-09-23 09:51:58 +03:00
Kostas Kyrimis
b5929f0162
fix: allow parsing extra spaces on acl files (#3703)
* allow parsing extra whitespace characters in acl files

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-09-13 10:17:20 +03:00
Kostas Kyrimis
d041386184
fix: test_acl_revoke_pub_sub_while_subscribed (#3680)
* add logs
* add asyncio sleep to avoid producer stalls

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-09-11 12:00:49 +03:00
Kostas Kyrimis
959b96e7cc
fix(test_auth_resp3_bug): release build failing (#3621)
* remove problematic assertion

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-09-02 14:32:53 +00:00
Kostas Kyrimis
0705bbb536
feat(acl): add pub/sub (#3574)
* add support for pub/sub
* add tests
---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-30 15:41:28 +03:00
Borys
f386b0b294
test: fix test_acl_deluser (#3488)
* test: fix test_acl_deluser
2024-08-12 09:34:51 +03:00
Kostas Kyrimis
b6d528cb5c
fix: HELLO AUTH with non default user (#3486)
* fix HELLO AUTH with non default user
* add test_auth_resp3_bug
* add decode_responses=True to acl tests and refactor
* fix test_default_user_bug

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-11 14:35:26 +03:00
Shahar Mike
18ca61d29b
feat(namespaces): Initial support for multi-tenant (#3260)
* feat(namespaces): Initial support for multi-tenant #3050

This PR introduces a way to create multiple, separate and isolated
namespaces in Dragonfly. Each user can be associated with a single
namespace, and will not be able to interact with other namespaces.

This is still experimental, and lacks some important features, such as:
* Replication and RDB saving completely ignores non-default namespaces
* Defrag and statistics either use the default namespace or all
  namespaces without separation

To associate a user with a namespace, use the `ACL` command with the
`TENANT:<namespace>` flag:

```
ACL SETUSER user TENANT:namespace1 ON >user_pass +@all ~*
```

For more examples and up to date info check
`tests/dragonfly/acl_family_test.py` - specifically the
`test_namespaces` function.
2024-07-16 19:34:49 +03:00
Kostas Kyrimis
73abd68f2d
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>
2024-07-15 08:28:29 +03:00
Kostas Kyrimis
9782eb2ac4
fix(acl): loading interleaved plain and hashed passwords (#3297)
* fix a bug of rehashing hashed passwords while loading plan/hashed passwords from acl file

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-07-10 12:40:40 +00:00
Kostas Kyrimis
5956275818
chore: replace session wide fixtures with scope (#3251)
* chore: replace session wide fixtures with scope
2024-07-02 10:26:26 +03:00
Kostas Kyrimis
f01aa2d76b
feat(acl): add support of multiple passwords (#3189)
* add support for multiple passwords
* add support for deleting passwords
* add support for resetpass
* add tests
* always prefix passwords with hashtag when printed
2024-06-21 20:39:33 +03:00
Kostas Kyrimis
8d82581c96
chore: small acl compat changes (#3177)
* print categories and commands in lower case instead of capital case
* fix a bug of default user inheriting the wrong acl rules on new connections
* move keys position to be after password when printed from an acl command
2024-06-17 09:40:41 +03:00
Kostas Kyrimis
d2ae0ab75c
fix: acl compatibility (#3147)
* remove acl categories from context and all acl checks
* category assign,ent now assigns all the acl commands for that category to the user
* introduce modification order of acl's per user
* acl rules are now printed in the same order as in redis/valkey
* remove old user_registry_test which was part of the poc
2024-06-13 10:56:30 +03:00
Kostas Kyrimis
2391f49e1c
fix(acl): return -NOPERM instead of response error (#3049) 2024-05-27 09:25:54 +03:00
Kostas Kyrimis
39c7cfdf72
fix: allow non hashed passwords when loading users from acl file (#2982)
* allow non hashed passwords when loading from acl file
2024-05-01 09:57:59 +03:00
Kostas Kyrimis
652d4da932
chore(acl): allow multiple users in acl deluser (#2945)
* add allow multiple users in acl deluser command
2024-04-29 17:03:54 +03:00
Joe Zhou
84aa237ba7
chore(acl): adjust some ACL command responses (#2943)
* change ACL DELUSER, ACL WHOAMI, and some ACL DRYRUN string/integer responses.
* change ACL GETUSER response, when the user does not exist, it should reply (nil).
2024-04-22 18:14:47 +03:00
Kostas Kyrimis
8640edad71
feat(acl): add acl keys to acl log command (#2274)
* add acl keys to acl log command
* add tests
2023-12-12 17:00:41 +02:00
Kostas Kyrimis
8323c82dc5
feat(acl): add acl keys to acl save/load (#2273)
* add acl keys to acl savel/load
* add tests
2023-12-08 16:08:33 +00:00
Kostas Kyrimis
2703d4635d
feat(acl): add validation for acl keys (#2272)
* add validation for acl keys
* add tests
2023-12-08 17:28:53 +02:00
Kostas Kyrimis
8126cf8252
feat(acl): add acl keys to acl list command (#2261)
* add acl keys to acl list
2023-12-08 15:32:15 +03:00
Kostas Kyrimis
2baadd1e90
fix(acl): case insensitive parsing from files and serialization format (#2123)
* replace > with # for acl files
* replace ACL SETUSER with USER for acl files
* add case insensitive parsing for acl files
* update tests
2023-11-05 11:43:11 +02:00
iko1
ac170748fb
feat(acl): add config set for acllog_max_len (#1979) 2023-10-29 18:17:02 +02:00
Kostas Kyrimis
dd2cb1def1
fix(regTests): properly handle other error codes on timeouts (#2057) 2023-10-23 16:35:29 +03:00
iko1
954e5a0a80
feat(acl): add config set for aclfile (#1978) 2023-10-19 10:15:38 +00:00
Kostas Kyrimis
cbba6f4e11
fix(acl/admin_port): skip acl validation on admin port (#1997)
* skip all acl related functionality on admin port
2023-10-10 08:28:07 +03:00
Kostas Kyrimis
5471827448
update(requirepass): behave as redis requirepass (#1996)
* requirepass also updates ACL default user password
* update config set requirepass to include the new behaviour
* add tests
* fix non existent default user when loading empty files
2023-10-09 16:34:42 +03:00
Roy Jacobson
5c9c9255d2
chore: Small refactor of DflyInstance (#1951)
* Move to its own file
* Unify self.args and self.params.args earlier so it can be inspected.
2023-09-28 10:11:11 +03:00
Kostas Kyrimis
949cedf66c
fix(AclFamily): do not allow to delete default user (#1954)
* do not allow to delete default user
* upon loading an acl file, if default does not exist create them
* add test
2023-09-28 09:22:45 +03:00
Kostas Kyrimis
890761989c
feat(AclFamily): add acl log (#1865) 2023-09-18 20:10:53 +03:00
Kostas Kyrimis
bbd4c6b636
feat(AclFamily): add acl commands (#1844) 2023-09-15 14:28:36 +03:00
Kostas Kyrimis
684bf97ce6
fix(AclFamily): move acl test files to pytest (#1843)
* Fixes broken release build
* Moves acl test files to acl pytest
2023-09-12 09:38:58 +03:00
Kostas Kyrimis
fc6b7e5f9a
fix(regression-tests): correct path for acl files (#1829) 2023-09-09 11:59:17 +03:00
Kostas Kyrimis
164b045505
fix: regression tests for acl family test (#1826) 2023-09-08 19:57:09 +03:00
Kostas Kyrimis
48488c5682
feat(AclFamily): load/store aclfile (#1820)
* add ACL LOAD
* add ACL SAVE
* add --aclfile command
2023-09-08 14:20:06 +03:00
Kostas Kyrimis
d1002842b8
chore(AclFamily): Move some of the regressions tests to unit and add (#1816)
* move error handling tests from regression to unit
* move ACL LIST regression to unit test
* move AUTH regression to unit test
* move ACL WHOAMI regression to unit test
* add unit tests for SETUSER/DELUSER (so they run on every PR)
* add unit tests for all ACL categories
2023-09-06 16:03:22 +00:00
Kostas Kyrimis
196650a39d
chore(AclFamily): disable flaky tests (#1791) 2023-09-03 09:23:14 +00:00
Kostas Kyrimis
846d421d25
fix(AclFamily): setuser interleaved signed categories update (#1790) 2023-09-03 09:02:32 +00:00
Kostas Kyrimis
68fa3f420b
feat(AclFamily): add acl whoami command (#1774)
* add acl whoami
* add tests
2023-09-01 21:23:01 +03:00
Kostas Kyrimis
6706707585
feat(AclFamily): add acl deluser (#1773)
* add acl deluser command
* add tests
2023-09-01 16:12:02 +00:00
Kostas Kyrimis
9ca7dba143
fix(AclFamily): stream acl updates via dispatch queue in connection (#1786)
There was a bug on updates of the acl categories when squashing was used. Basically, the parent context could be accessed in parallel by the "stub" contexts causing a dreaded data race on the update.

This is fixed by adding a new AclUpdateMessage at the front of the dispatch queue of the connection.
2023-09-01 15:40:50 +00:00
Kostas Kyrimis
7c43cbf2b5
feat: add validation of acl users (#1743)
* add validation for categories
* add tests
2023-08-29 18:52:46 +03:00
Kostas Kyrimis
50545fc176
feat(AclFamily): add AUTH for acl members (#1732)
* Extends AUTH command to authenticate ACL users
* Add tests
2023-08-25 18:56:15 +03:00
Kostas Kyrimis
bd87fb75fa
feat(AclFamily): add acl setuser command (#1725)
* Add `ACL SETUSER` command
* Add tests
2023-08-24 13:24:18 +03:00
Kostas Kyrimis
7f89bf37d8
fix(AclFamily): commands parsing and error handling (#1726)
* Fixed broken ACL command (prev df crashed)
* Fixed broken ACL LIST STR (now prints error)
* Added tests
2023-08-23 14:23:41 +03:00
Kostas Kyrimis
898061d738
feat(AclFamilly): add acl list command (#1722)
* Add acl-family source and header
* Add `ACL LIST` command
* Add a simple test to check the default user
2023-08-22 15:33:14 +00:00