Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qpid 8567 report rule identity in acl logger #111

Open
wants to merge 1 commit into
base: 8.0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ public class AccessControlMessages

/**
* Log a AccessControl message of the Format:
* <pre>ACL-1001 : Allowed : {0} {1} {2}</pre>
* <pre>ACL-1001 : Allowed : {0} {1} {2} [{3}]</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage ALLOWED(String param1, String param2, String param3)
public static LogMessage ALLOWED(String param1, String param2, String param3, String param4)
{
String rawMessage = _messages.getString("ALLOWED");

final Object[] messageArguments = {param1, param2, param3};
final Object[] messageArguments = {param1, param2, param3, param4};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
Expand Down Expand Up @@ -331,11 +331,11 @@ public int hashCode()
* sequentially in the method call.
*
*/
public static LogMessage DENIED(String param1, String param2, String param3)
public static LogMessage DENIED(String param1, String param2, String param3, String param4)
{
String rawMessage = _messages.getString("DENIED");

final Object[] messageArguments = {param1, param2, param3};
final Object[] messageArguments = {param1, param2, param3, param4};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
# Access Control logging message i18n strings.

# 'accept-log' rule message
ALLOWED = ACL-1001 : Allowed : {0} {1} {2}
ALLOWED = ACL-1001 : Allowed : {0} {1} {2} [{3}]

# 'deny-log' rule message
DENIED = ACL-1002 : Denied : {0} {1} {2}
DENIED = ACL-1002 : Denied : {0} {1} {2} [{3}]

CREATE = ACL-1011 : Create "{0}"
OPEN = ACL-1012 : Open
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ public Result check(Subject subject,
getEventLogger().message(AccessControlMessages.ALLOWED(
action.getOperation().toString(),
action.getObjectType().toString(),
action.getProperties().toString()));
action.getProperties().toString(), rule.getIdentity().toString()));
}
else
{
getEventLogger().message(AccessControlMessages.DENIED(
action.getOperation().toString(),
action.getObjectType().toString(),
action.getProperties().toString()));
action.getProperties().toString(), rule.getIdentity().toString()));
}
}

Expand Down