Skip to content

pannonia-expertise/audit-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Known Vulnerabilities Coverage Bugs Maintainability

pannonia-expertise/audit-starter:pom.xml

Auditing Mechanism

Audit starter module provides mechanism for auditing write operations on database. Default implementation of type AuditUsernameProvider - PrincipalUsernameProvider will provide current's user name from principal (using spring security) in ThreadLocal manner.
To override it, one just need to provide custom implementation.

After AuditUsernameProvider bean has been provided, auditing system is used by implementing Auditable interface in entity, adding AuditListener entity listener, and embeded Audit class object.

@Getter  
@Setter  
@Entity  
@EntityListeners(AuditListener.class)  
public class TheAuditedEntity extends BaseEntity implements Auditable {  
	  
    @Embedded
    Audit audit;
}

Adding custom UsernameProvider implementation

If needed a custom username provider can be added as a Spring Bean that implements UsernameProvider interface. For reference see: com.pannoniaexpertise.audit.usernameProviders.impl.ClientDetailsUsernameProvider or com.pannoniaexpertise.audit.usernameProviders.impl.UserDetailsUsernameProvider

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages