-
Notifications
You must be signed in to change notification settings - Fork 82
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
[APPS-3152] fix for mnt-24137 #3102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code seems to be okay considering the test that it pass.
@@ -913,7 +913,7 @@ public int getAuditEntriesCountByAppAndProperties(AuditService.AuditApplication | |||
final String applicationName = auditApplication.getKey().substring(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can change this line to:
final String applicationName = auditApplication.getName();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are done as per the comment.
@@ -913,7 +913,7 @@ public int getAuditEntriesCountByAppAndProperties(AuditService.AuditApplication | |||
final String applicationName = auditApplication.getKey().substring(1); | |||
|
|||
AuditQueryParameters parameters = new AuditQueryParameters(); | |||
parameters.setApplicationName(applicationName); | |||
parameters.setApplicationName(auditApplication.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the previous suggestion, we could supply the applicationName
variable again here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are done as per the comment.
I have added two suggestions in order to avoid having two different logic for the application name inside the same method. |
https://hyland.atlassian.net/browse/APPS-3129
This issue is happening when appNamePair shortvalue is generated with stringlowercase irrespective of caseSensitive flag, but as per the scenario the appName in audit application is differed by case (Upper vs Lower).
When its try to get appNamePair for appName its not matching value and its returning null from convertFromRestAuditQueryParameters(parameters) in getAuditEntriesCountByAppAndProperties method in AuditDAOImpl class.
So instead of getting auditEntries by the appKey we are now getting auditEntries by appName it will resolve the issue. Same approch already was there in getAuditEntry method in AuditImpl class.
Tested Scenarios:
We can’t use same AppName or AppKey for multiple applications which is already validated.
If we use same AppName or AppKey for multiple applications we are getting exception like org.alfresco.repo.audit.model.AuditModelException: 11200000 Audit application key 'testpermissionaudit' is used by: AuditApplication[ name=TESTPermissionaudit, id=3, disabledPathsId=4]