Skip to content

Commit b778e9f

Browse files
authored
Merge pull request #311 from 4Science/task/main/DURACOM-372
Audit trail feature - REST Contract
2 parents 7993790 + 09c422b commit b778e9f

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

auditevents.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Admin Audit Events Endpoints
2+
[Back to the list of all defined endpoints](endpoints.md)
3+
4+
This endpoint allows administrators to check the events recorded in the audit log.
5+
6+
## Main Endpoint
7+
**GET /api/system/auditevents**
8+
9+
This endpoint will return a list of all the events recorded in the audit log.
10+
11+
The supported parameters are:
12+
* page, size [see pagination](README.md#Pagination)
13+
* sort, only timeStamp is supported
14+
15+
Return codes:
16+
* 200 OK - if the operation succeed
17+
* 401 Unauthorized - if you are not authenticated
18+
* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access the audit events
19+
* 404 Not Found - if the audit system is not enabled
20+
21+
## Single Event
22+
**GET /api/system/auditevents/<:event-uuid>**
23+
24+
This endpoint will return details about the event
25+
26+
```json
27+
{
28+
"id": "d7ca31fc-50a4-4a85-89ea-599fc1494f12",
29+
"epersonUUID": "685369f5-e169-48b3-bedc-70e5d03f8ce2",
30+
"objectUUID": null,
31+
"objectType": null,
32+
"subjectUUID": "e173a574-2de3-4f4a-843d-62fcfc4d2109",
33+
"subjectType": "COMMUNITY",
34+
"eventType": "MODIFY_METADATA",
35+
"timeStamp": "2025-07-21T14:49:54.718+00:00",
36+
"detail": null,
37+
"metadataField": "dc_identifier_uri",
38+
"value": "http://localhost:4000/handle/123456789/7",
39+
"authority": "",
40+
"confidence": -1,
41+
"place": 0,
42+
"action": "ADD",
43+
"checksum": null,
44+
"type": "auditevent",
45+
"_links": {
46+
"eperson": {
47+
"href": "http://localhost:8080/server/api/system/auditevents/d7ca31fc-50a4-4a85-89ea-599fc1494f12/eperson"
48+
},
49+
"object": {
50+
"href": "http://localhost:8080/server/api/system/auditevents/d7ca31fc-50a4-4a85-89ea-599fc1494f12/object"
51+
},
52+
"subject": {
53+
"href": "http://localhost:8080/server/api/system/auditevents/d7ca31fc-50a4-4a85-89ea-599fc1494f12/subject"
54+
},
55+
"self": {
56+
"href": "http://localhost:8080/server/api/system/auditevents/d7ca31fc-50a4-4a85-89ea-599fc1494f12"
57+
}
58+
}
59+
}
60+
```
61+
62+
## Search Events
63+
**GET /api/system/auditevents/search/findByObject?object=<:uuid>**
64+
65+
This supports a basic search of events related to an object
66+
67+
The supported parameters are:
68+
* page, size [see pagination](README.md#Pagination)
69+
* sort, only timeStamp is supported
70+
* object: mandatory, the uuid of the object that is involved in the Event (as subject or otherObjet)
71+
72+
Return codes:
73+
* 200 OK - if the operation succeed
74+
* 401 Unauthorized - if you are not authenticated
75+
* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access the audit events
76+
* 404 Not Found - if the audit system is not enabled

endpoints.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* [/api/submission/workspaceitems](workspaceitems.md)
3737
* [/api/submission/vocabularies](vocabularies.md)
3838
* [/api/submission/vocabularyEntryDetails](vocabularyEntryDetails.md)
39+
* [/api/system/auditevents](auditevents.md)
3940
* [/api/system/systemwidealerts](systemwidealerts.md)
4041
* [/api/versioning/versions](versions.md)
4142
* [/api/versioning/versionhistories](versionhistories.md)

0 commit comments

Comments
 (0)