Search
K
Links

Audit Plugin

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,
public interface AuditPlugin {
/**
+ 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.
*/
void logAudit(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.
*/
void logAudit(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.
@ConditionalOnProperty(value = "mosip.esignet.integration.audit-plugin", havingValue = "mock-audit-service")
@Component
@Slf4j
public class LoggerAuditService implements AuditPlugin {
//Implement audit plugin methods
}
Last modified 2mo ago
Copyright © 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.