-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add ACL DIGEST command #4446
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
Open
melancholictheory
wants to merge
2
commits into
valkey-io:unstable
Choose a base branch
from
melancholictheory:acl-digest
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+232
−7
Open
Add ACL DIGEST command #4446
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "DIGEST": { | ||
| "summary": "Returns a fingerprint of the ACL rules currently in effect.", | ||
| "complexity": "O(N). Where N is the number of configured users.", | ||
| "group": "server", | ||
| "since": "9.2.0", | ||
| "arity": 2, | ||
| "container": "ACL", | ||
| "function": "aclCommand", | ||
| "command_flags": [ | ||
| "ADMIN", | ||
| "NOSCRIPT", | ||
| "LOADING", | ||
| "STALE", | ||
| "SENTINEL" | ||
| ], | ||
| "reply_schema": { | ||
| "type": "string", | ||
| "description": "The hex representation of the digest of the rules currently in effect." | ||
| }, | ||
| "acl_categories": [ | ||
| "ADMIN", | ||
| "DANGEROUS", | ||
| "SLOW" | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is node-local state, but there is no request-policy tip telling cluster clients to query every node.
ACL SETUSER,ACL DELUSER, andACL SAVEall declareREQUEST_POLICY:ALL_NODES, and read-only node-local introspection such asSLOWLOG GETpairs that withNONDETERMINISTIC_OUTPUT. Without the same metadata here, a cluster-aware client can routeACL DIGESTto one arbitrary node and miss an ACL revision that differs elsewhere. Addcommand_tipswithREQUEST_POLICY:ALL_NODESandNONDETERMINISTIC_OUTPUT.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparisons are accurate:
ACL SETUSER,ACL DELUSERandACL SAVEdo carryREQUEST_POLICY:ALL_NODES, andSLOWLOG GETdoes pair it withNONDETERMINISTIC_OUTPUT. I left both tips off on purpose.NONDETERMINISTIC_OUTPUTwould say the wrong thing here. The definition in command-tips is that calls "may yield different results with the same arguments and data", which is whatINFO,CLIENT LISTandTTLdo.ACL DIGESTis the opposite: the same ACL state always produces the same reply. That is the contract of the command and there is a test asserting it. The tip tells a client the reply is not meant to be compared, and comparing it is the only thing the command is for.REQUEST_POLICY:ALL_NODESis a fairer question, but I do not think it belongs on this command alone. The rest of the ACL read family carries no tips at all:ACL LIST,ACL USERS,ACL GETUSER,ACL WHOAMI, andACL LOADtoo.ACL DIGESTis node local in exactly the wayACL LISTis. Tagging only the digest puts a cluster client in an odd spot, where it fans outACL DIGEST, finds two nodes disagreeing, and then cannot fan outACL LISTthe same way to see what differs. There is also no usefulRESPONSE_POLICYfor a set of hex strings, so it would end up asSPECIAL.If node-local ACL introspection should be fanned out, I would rather do it as one change across the whole family than on the single new command, and I can open that separately. If a maintainer wants the tip here now, say so and I will add it.