Skip to content

HDDS-15460. Move ACL checks for key and prefix requests to preExecute - #10330

Closed
ss77892 wants to merge 2 commits into
apache:masterfrom
ss77892:HDDS-13855-key-prefix-acl-preexecute
Closed

HDDS-15460. Move ACL checks for key and prefix requests to preExecute#10330
ss77892 wants to merge 2 commits into
apache:masterfrom
ss77892:HDDS-13855-key-prefix-acl-preexecute

Conversation

@ss77892

@ss77892 ss77892 commented May 21, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • 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

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15460

How was this patch tested?

By existing tests, more tests would be added in a separate PR #10331

Made with Cursor

@sarvekshayr sarvekshayr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @ss77892 for the patch.

checkKeyAcls(ozoneManager, volumeName, bucketName, keyName,
IAccessAuthorizer.ACLType.DELETE, OzoneObj.ResourceType.KEY,
volumeOwner);
perfMetrics.setDeleteKeysAclCheckLatencyNs(Time.monotonicNowNanos() - startNanosDeleteKeysAclCheckLatency);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

deleteKeysAclCheckLatencyNs metric is no longer updated after moving out the ACL check from validateAndUpdateCache(). Let's restore the metric in OMKeysDeleteRequest.preExecute().

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>
@ss77892
ss77892 force-pushed the HDDS-13855-key-prefix-acl-preexecute branch from 5291e8c to 38c39f2 Compare June 2, 2026 14:35
@ss77892 ss77892 changed the title HDDS-13855. Move ACL check in Key and Prefix requests to preExecute HDDS-15460. Move ACL checks for key and prefix requests to preExecute Jun 2, 2026
@github-actions

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions Bot added the stale label Jun 24, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it.

@github-actions github-actions Bot closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants