steveloughran commented on code in PR #5548:
URL: https://github.com/apache/hadoop/pull/5548#discussion_r1176328084
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/audit/AuditIntegration.java:
##########
@@ -142,4 +144,20 @@ public static <T extends HandlerContextAware> void
attachSpanToRequest(
request.addHandlerContext(AUDIT_SPAN_HANDLER_CONTEXT, span);
}
+ /**
+ * Translate an audit exception.
+ * @param path path of operation.
+ * @param exception exception
+ * @return the IOE to raise.
+ */
+ public static IOException translateAuditException(String path,
+ AuditFailureException exception) {
+ if (exception instanceof AuditOperationRejectedException) {
+ // special handling of this subclass
+ return new UnsupportedRequestException(path,
+ exception.getMessage(), exception);
+ }
+ return (AccessDeniedException)new AccessDeniedException(path, null,
Review Comment:
that's the way it was before when the auditor rejected a request, e.g. an
unaudited operation (with such calls forbidden). just moved from S3AUtils
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]