Skip to content

HDDS-13855. Move ACL check in Key and Prefix requests to preExecute#10330

Open
ss77892 wants to merge 1 commit into
apache:masterfrom
ss77892:HDDS-13855-key-prefix-acl-preexecute
Open

HDDS-13855. Move ACL check in Key and Prefix requests to preExecute#10330
ss77892 wants to merge 1 commit into
apache:masterfrom
ss77892:HDDS-13855-key-prefix-acl-preexecute

Conversation

@ss77892
Copy link
Copy Markdown
Contributor

@ss77892 ss77892 commented May 21, 2026

Summary

  • Move ACL authorization checks for key bulk operations (DeleteKeys, RenameKeys) from validateAndUpdateCache to preExecute
  • Move ACL checks for key and prefix ACL operations (OMKeyAclRequest, OMKeyAclRequestWithFSO, OMPrefixAclRequest, and FSO add/remove/set variants) from validateAndUpdateCache to preExecute
  • For bulk operations, keys denied by ACL are collected in new proto fields (aclDeniedKeys / aclDeniedRenameKeys) and removed from the batch, so permitted keys in the same request can still be processed
  • Proto: add aclDeniedKeys to DeleteKeyArgs and aclDeniedRenameKeys to RenameKeysArgs

Motivation

When ACL enforcement happens inside validateAndUpdateCache, the request has already been written to the Ratis log on all OM peers. Moving the check to preExecute (which runs only on the leader, before log submission) prevents unauthorized requests from polluting the log and ensures consistent ACL rejection across HA leader changes.

Test plan

  • Unit tests pass for key/prefix request handlers
  • Integration test TestOMHALeaderSpecificACLEnforcement covers key operations (in a follow-up PR)

Related

Part of HDDS-13855. See also:

  • Volume requests (separate PR)
  • Bucket requests (separate PR)

Made with Cursor

Move ACL authorization checks for key operations (delete-keys,
rename-keys) and key/prefix ACL operations (add, remove, set ACL,
including FSO variants) from validateAndUpdateCache to preExecute.

For bulk operations (OMKeysDeleteRequest, OMKeysRenameRequest), keys
that fail the ACL check are collected in new proto fields
(aclDeniedKeys / aclDeniedRenameKeys) and removed from the batch so
the remaining permitted keys can still be processed.

Proto changes: add aclDeniedKeys to DeleteKeyArgs and
aclDeniedRenameKeys to RenameKeysArgs.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant