Skip to content

HDDS-14204. Reduce duplication in auditing S3G requests#9524

Merged
peterxcli merged 1 commit intoapache:masterfrom
adoroszlai:HDDS-14204
Dec 18, 2025
Merged

HDDS-14204. Reduce duplication in auditing S3G requests#9524
peterxcli merged 1 commit intoapache:masterfrom
adoroszlai:HDDS-14204

Conversation

@adoroszlai
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

EndpointBase has methods to simplify auditing failures in subclasses, but:

  • these are used in only some places
  • SUCCESS case is not covered

This PR adds the missing auditReadSuccess and auditWriteSuccess, and changes all calls to use the simplified methods, except BucketEndpoint#multiDelete, which needs to add extra params for the message.

Also:

  • Return AuditMessage.Builder from the helper methods to allow further customization of the message (add perf, etc.), thus reduce duplication.
  • Move getAuditParameters() call into auditMessageBaseBuilder, renamed to auditMessageFor.

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

How was this patch tested?

CI:
https://github.com/adoroszlai/ozone/actions/runs/20336484273 (in progress)
https://github.com/adoroszlai/ozone/actions/runs/20334289695 (mostly OK)

@adoroszlai adoroszlai self-assigned this Dec 18, 2025
@adoroszlai adoroszlai added s3 S3 Gateway code-cleanup Changes that aim to make code better, without changing functionality. labels Dec 18, 2025
Copy link
Copy Markdown
Member

@peterxcli peterxcli left a comment

Choose a reason for hiding this comment

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

LGTM +1

@peterxcli peterxcli merged commit da68b9e into apache:master Dec 18, 2025
43 checks passed
@peterxcli
Copy link
Copy Markdown
Member

Thanks @adoroszlai for this patch!

@adoroszlai adoroszlai deleted the HDDS-14204 branch December 18, 2025 18:40
@adoroszlai
Copy link
Copy Markdown
Contributor Author

Thanks @peterxcli for reviewing and merging this.

echonesis pushed a commit to echonesis/ozone that referenced this pull request Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-cleanup Changes that aim to make code better, without changing functionality. s3 S3 Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants