Project

General

Profile

Actions

Task #182

closed

Audit for all entities

Added by Ondřej Kopr over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Ondřej Kopr
Category:
Audit
Target version:
Start date:
11/15/2016
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Owner:

Description

  • New item in menu Audit - Audit?
  • Agenda audit with table. All entities in one table (Identity, Role, Notification, tree structure, tree nodes, ...)
  • Filter with from, to, who edited, which entity.
  • BE new endpoint - audit, with quick search implementation for filter.
  • Envers collect all entities and back it in pageable object for table.
  • Detail for one recrod? Discussion.

Subtasks 1 (0 open1 closed)

Task #189: Tests for AuditClosedOndřej Kopr11/15/2016

Actions
Actions #1

Updated by Ondřej Kopr over 7 years ago

  • % Done changed from 0 to 20
Actions #2

Updated by Ondřej Kopr over 7 years ago

  • % Done changed from 20 to 0
Actions #3

Updated by Ondřej Kopr over 7 years ago

  • % Done changed from 0 to 40
Actions #4

Updated by Ondřej Kopr over 7 years ago

  • % Done changed from 40 to 70
Actions #5

Updated by Ondřej Kopr over 7 years ago

  • % Done changed from 70 to 80
  • Connect envers listener to our entity - IdmAudit
  • New table idm_audit - Repository with find method and controller with quick search.
  • Audit service use find quick and envers queries for getting revision and audit entity - Method findRevision return object from _aud tables, findRevisions return revisions from idm_audit table.
  • Method getNameChangedColumns use property descriptor, please check correct use.
  • Method getAllAuditedEntitiesNames return list of audited entities, use meta model.
  • Method getLastVersionNumber using envers queries and return last revisionNumber (id) for entity.
  • Tests will be implemented in another task.

Please do code review. Thank you.

Actions #6

Updated by Ondřej Kopr over 7 years ago

Possible extensions

  • Modifier - in select box missing [SYSTEM]
  • Detail - diff two version? Detail of entity?
  • Add original modifier
  • Version
Actions #7

Updated by Ondřej Kopr over 7 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Ondřej Kopr to Radek Tomiška
Actions #8

Updated by Radek Tomiška over 7 years ago

  • Assignee changed from Radek Tomiška to Vít Švanda
Actions #9

Updated by Vít Švanda over 7 years ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Vít Švanda to Ondřej Kopr

- Sort in audit table is not working
-- When i try sort over revisionId (and others), then is workin only asc
-- When i try sort over revisonDate, then i get error

org.hibernate.QueryException: could not resolve property: revisionDate of: eu.bcvsolutions.idm.core.model.entity.IdmAudit [SELECT e FROM eu.bcvsolutions.idm.core.model.entity.IdmAudit e WHERE (?1 IS null OR lower(e.modification) like ?2 ) AND (?3 IS null OR lower(e.changedAttributes) like ?4 ) AND (?5 IS null OR (lower(e.modifier) like ?6 AND lower(e.originalModifier) like ?6 )) AND (?8 IS null OR e.entityId = ?8 ) AND (?10 = 'null' or e.timestamp >= ?11 ) AND (?12 = 'null' or e.timestamp <= ?13 ) AND (?14 IS null OR lower(e.type) like ?15 ) order by e.revisionDate asc]; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: revisionDate of: eu.bcvsolutions.idm.core.model.entity.IdmAudit [SELECT e FROM eu.bcvsolutions.idm.core.model.entity.IdmAudit e WHERE (?1 IS null OR lower(e.modification) like ?2 ) AND (?3 IS null OR lower(e.changedAttributes) like ?4 ) AND (?5 IS null OR (lower(e.modifier) like ?6 AND lower(e.originalModifier) like ?6 )) AND (?8 IS null OR e.entityId = ?8 ) AND (?10 = 'null' or e.timestamp >= ?11 ) AND (?12 = 'null' or e.timestamp <= ?13 ) AND (?14 IS null OR lower(e.type) like ?15 ) order by e.revisionDate asc]

- When I removed some IdentityContract from Identity, then I don't see item in auditlog for IdentityContract delete.
- When I add subrole to some role, then I see in auditlog delete operation (create missing) for multiplied fields (subRoles, superiorRoles,guarantees, subRoles,superiorRoles, authorities,superiorRoles).
- In this branch is not woking search for workflow instances/tasks (http://localhost:3000/#/identity/admin/roles). Why is missing "quick/search" in url (http://localhost:8080/idm-backend/api/v1/workflow/processes?size=10&page=0&sort=processDefinitionName,asc&identity=admin&category=eu.bcvsolutions.identity.roles.change)

..to be continued...

Actions #10

Updated by Ondřej Kopr over 7 years ago

Thank you for report.

  • Sort over revisonDate was fixed. Problem was in name of column,
  • problem with ASC sorting was fix. In audit table was user forceSearchParameters changed to defaultSearchParameters
  • Search for workflow instance/task was fixed. Problem: To abstract service was added override setName for search parameters. Fix if statement.
  • Remove all audited annotations from list and add save to child revision
Actions #11

Updated by Ondřej Kopr over 7 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Ondřej Kopr to Vít Švanda
Actions #12

Updated by Vít Švanda over 7 years ago

  • Status changed from Needs feedback to In Progress

I did review and everything looking good.

Actions #13

Updated by Vít Švanda over 7 years ago

  • Assignee changed from Vít Švanda to Ondřej Kopr
Actions #14

Updated by Ondřej Kopr over 7 years ago

  • AuditFilter - fix style,
  • remove unnecessary rawtypes check from AuditListener, method changeRevisionEntity.
  • remove selectBox with identity and add simple textfield,
  • replace exception e.printStackTrace with IllegalArgumentException. Found on DefaultAuditService,
  • fix alert margin in table.
Actions #15

Updated by Ondřej Kopr over 7 years ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF