Audit plugin interface provides two methods to audit any action in eSignet. An instance of this audit plugin is injected into all the services of eSignet, and almost all the events are audited using this plugin.
Below is the eSignet audit interface,
publicinterfaceAuditPlugin { /** + Plugin method to audit all the actions in e-Signet service. + + @param action Action to audit @{@link Action} + @param actionStatus Action status to audit @{@link ActionStatus} + @param audit @{@link AuditDTO} during this action + @param t Any error / exception occurred during this action, null if no errors / exception found. */voidlogAudit(Action action,ActionStatus status,AuditDTO audit,Throwable t); /** + Plugin method to audit all the actions in e-Signet service. + + @param username Session username for audit + @param action Action to audit @{@link Action} + @param actionStatus Action status to audit @{@link ActionStatus} + @param audit @{@link AuditDTO} during this action + @param t Any error / exception occurred during this action, null if no errors / exception found. */voidlogAudit(String username,Action action,ActionStatus status,AuditDTO audit,Throwable t);}
For the latest version of the interface please check our code base - AuditPlugin.java
How to implement this plugin?
The Audit plugin implementation class must be annotated with ConditionalOnProperty with mosip.esignet.integration.audit-plugin property.
Below is an example of how the Audit plugin can be implemented.