Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backporting]Fix empty response for ACL CAT category subcommand for module defined… #1413

Closed
wants to merge 1 commit into from

Conversation

roshkhatri
Copy link
Member

@roshkhatri roshkhatri commented Dec 9, 2024

[Backporting]Fix empty response for ACL CAT category subcommand for module defined categories (#1140)

The module commands which were added to acl categories were getting skipped when ACL CAT category command was executed.

This PR fixes the bug.
Before:

127.0.0.1:6379> ACL CAT foocategory
(empty array)

After:

127.0.0.1:6379> ACL CAT foocategory
aclcheck.module.command.test.add.new.aclcategories

… categories (valkey-io#1140)

The module commands which were added to acl categories were getting
skipped when `ACL CAT category` command was executed.

This PR fixes the bug.
Before:
```
127.0.0.1:6379> ACL CAT foocategory
(empty array)
```
After:
```
127.0.0.1:6379> ACL CAT foocategory
aclcheck.module.command.test.add.new.aclcategories
```

---------

Signed-off-by: Roshan Khatri <[email protected]>
Co-authored-by: Harkrishn Patro <[email protected]>
Signed-off-by: Roshan Khatri <[email protected]>
@roshkhatri roshkhatri requested a review from madolson December 10, 2024 00:00
Comment on lines +134 to +146
test {test if foocategory acl categories is added} {
r acl SETUSER j8 on >password -@all +@foocategory
assert_equal [r acl DRYRUN j8 aclcheck.module.command.test.add.new.aclcategories] OK
}

test {test if ACL CAT output for the new category is correct} {
assert_equal [r ACL CAT foocategory] aclcheck.module.command.test.add.new.aclcategories
}

test {test permission compaction and simplification for categories added by a module} {
r acl SETUSER j9 on >password -@all +@foocategory -@foocategory
catch {r ACL GETUSER j9} res
assert_equal {-@all -@foocategory} [lindex $res 5]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these tests aren't part of the unstable merge changes? I don't think we should get change beyond the scope of the commit 9b8a061.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats true.

@roshkhatri
Copy link
Member Author

roshkhatri commented Dec 17, 2024

I think this was a mistake to backport - we will not be able to backport this as we do not support modules to declare ACL categories in 7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants