Sample audit4j applications.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
audit4j-demo-annotation-int
audit4j-demo-hibernate
audit4j-demo-http
audit4j-demo-spring-petclinic
audit4j-demo-spring
audit4j-demo-springboot
audit4j-integration-tests
audit4j-kotlin-demo-springboot
sample
.gitignore
.travis.yml
LICENSE
README.md

README.md

Build Status

Audit4j-demo

Sample audit4j applications.

Audit4j-demo-springboot

example taken from SpringBoot documentation https://spring.io/guides/gs/securing-web/

the login page is http://localhost:8080

The users passwords are user/password and user2/password2.

the following page http://localhost:8080/hello is audited.

Audit4j-annotation-int

Simple example showing how to integrate the @Audit annotation using aspectj.

Audit4j-kotlin-demo-springboot

example showing the usage of audit4j with Kotlin "Petclinic" application

Links and sources

this example is coming from the following github repositories https://github.com/spring-petclinic/spring-petclinic-kotlin https://github.com/spring-projects/spring-petclinic

Example with Audit4j and Kotlin language

Of course the annotation @Audit works fine.

AuditManager

AuditManager
val actor = MyApplicationContext.getAuthenticatedUser()
var manager = AuditManager.getInstance()
manager.audit(AuditEvent(actor, "myMethod", Field("myParam1Name", myParam1), Field("myParam2Name", myParam2)))

EventBuilder

val actor = MyApplicationContext.getAuthenticatedUser()
var builder = EventBuilder();
builder.addActor(actor).addAction("myMethod").addField("myParam1Name", myParam1).addField("myParam2Name", myParam2)
var manager = AuditManager.getInstance()
manager.audit(builder.build())