forgejo/modules/queue
Victoria Nadasdi df0d1a2134 feat: parse prefix from redis URI for queues (#3836)
For security reasons, scoping access to a redis server via ACL rules is
a good practice. Some parts of the codebase handles prefix like cache[^1]
and session[^2], but the queue module doesn't.

This patch adds this missing functionality to the queue module.

Note about relevant test:
I tried to keep the PR as small as possible (and reasonable), and not
change how the test runs. Updated the existing test to use the same
redis address and basically duplicated the test with the extra flag. It
does NOT test if the keys are correct, it ensures only it works as
expected. To make assertions about the keys, the whole test has to be
updated as the general wrapper doesn't allow the main test to check
anything provider (redis) specific property. That's not something I
wanted to take on now.

[^1]: e4c3c039be/modules/cache/cache_redis.go (L139-L150)
[^2]: e4c3c039be/modules/session/redis.go (L122-L129)

Signed-off-by: Victoria Nadasdi <victoria@efertone.me>

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3836
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Victoria Nadasdi <victoria@efertone.me>
Co-committed-by: Victoria Nadasdi <victoria@efertone.me>
2024-05-20 14:10:54 +00:00
..
lqinternal Help to recover from corrupted levelqueue (#24912) 2023-05-29 10:52:32 +08:00
backoff.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
base.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
base_channel.go Improve queue & process & stacktrace (#24636) 2023-05-11 07:45:47 +00:00
base_channel_test.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
base_dummy.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
base_levelqueue.go Help to recover from corrupted levelqueue (#24912) 2023-05-29 10:52:32 +08:00
base_levelqueue_common.go Help to recover from corrupted levelqueue (#24912) 2023-05-29 10:52:32 +08:00
base_levelqueue_test.go Help to recover from corrupted levelqueue (#24912) 2023-05-29 10:52:32 +08:00
base_levelqueue_unique.go Help to recover from corrupted levelqueue (#24912) 2023-05-29 10:52:32 +08:00
base_redis.go feat: parse prefix from redis URI for queues (#3836) 2024-05-20 14:10:54 +00:00
base_redis_test.go feat: parse prefix from redis URI for queues (#3836) 2024-05-20 14:10:54 +00:00
base_test.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
config.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
manager.go Improve queue and logger context (#24924) 2023-05-26 07:31:55 +00:00
manager_test.go Increase queue length (#27555) 2023-10-10 18:47:49 +08:00
queue.go Add codespell support and fix a good number of typos with its help (#3270) 2024-05-09 13:49:37 +00:00
testhelper.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
workergroup.go workergroup: gracefully exit on close(popItemErr) 2024-03-24 07:12:31 +01:00
workerqueue.go [CI] workerqueue attempt to fix flacky test 2024-03-22 08:52:16 +01:00
workerqueue_test.go [CI] workerqueue attempt to fix flacky test 2024-03-22 08:52:16 +01:00