Skip to content

Commit

Permalink
ARTEMIS-3902 Adding reason to Audit Security Message
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Jul 22, 2022
1 parent 3d5f588 commit db8f530
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2267,13 +2267,13 @@ static void handleManagementMessage(Object source, Subject user, String remoteAd
void handleManagementMessage2(String user, Object source, Object... args);


static void securityFailure(Exception cause) {
BASE_LOGGER.securityFailure(getCaller(), cause);
static void securityFailure(Exception cause, String reason) {
BASE_LOGGER.securityFailure(getCaller(), reason, cause);
}

@LogMessage(level = Logger.Level.INFO)
@Message(id = 601264, value = "User {0} gets security check failure", format = Message.Format.MESSAGE_FORMAT)
void securityFailure(String user, @Cause Throwable cause);
@Message(id = 601264, value = "User {0} gets security check failure, reason={1}", format = Message.Format.MESSAGE_FORMAT)
void securityFailure(String user, String reason, @Cause Throwable cause);


static void createCoreConsumer(Object source, Subject user, String remoteAddress, Object... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void check(final SimpleString address,
} else {
ex = ActiveMQMessageBundle.BUNDLE.userNoPermissionsQueue(session.getUsername(), checkType, bareQueue, bareAddress);
}
AuditLogger.securityFailure(ex);
AuditLogger.securityFailure(ex, ex.getMessage());
throw ex;
}

Expand Down

0 comments on commit db8f530

Please sign in to comment.