Skip to content

Commit

Permalink
fix(rate-limiting) Fix ACL tests
Browse files Browse the repository at this point in the history
Give the `REDIS_USER_VALID` permission to execute all commands rather
than a restricted list. This fixes the "respects database setting" test
after restoring atomic updates in the preceding commit because it now
has permission to execute `EVAL` commands. It was painful to debug
because `commit_pipeline` didn't return any errors and just silently
failed to increment the key.
dcarley committed Oct 21, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nikolaybotev Nikolay Botev
1 parent 111aca6 commit f18458d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/03-plugins/23-rate-limiting/05-integration_spec.lua
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ local function flush_redis(red, db)
end

local function add_redis_user(red)
assert(red:acl("setuser", REDIS_USER_VALID, "on", "allkeys", "+incrby", "+select", "+info", "+expire", "+get", "+exists", ">" .. REDIS_PASSWORD))
assert(red:acl("setuser", REDIS_USER_VALID, "on", "allkeys", "allcommands", ">" .. REDIS_PASSWORD))
assert(red:acl("setuser", REDIS_USER_INVALID, "on", "allkeys", "+get", ">" .. REDIS_PASSWORD))
end

0 comments on commit f18458d

Please sign in to comment.