Programmatically working with Audit Event JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "date-time"
},
"eventId": {
"type": "string",
"format": "uuid"
},
"entity": { "$ref": "#/definitions/entity" },
"parentEntity": { "$ref": "#/definitions/entity" },
"organisation": { "$ref": "#/definitions/entity" },
"principal": { "$ref": "#/definitions/entity" },
"clientType": {
"anyOf": [
{
"type": "string",
"enum": [
"UI",
"API",
"SYSTEM",
"ADMIN",
"CLI"
]
},
{ "type": "string" }
]
},
"action": {
"anyOf": [
{
"type": "string",
"enum": [
"CREATE",
"UPDATE",
"DELETE",
"SIGNUP",
"LOGIN",
"ACL_GRANT",
"ACL_REVOKE",
"INVITE"
]
},
{ "type": "string" }
]
},
"before": {
"type": "object"
},
"after": {
"type": "object"
},
"subject": { "$ref": "#/definitions/entity" },
"permission": {
"oneOf": [
{
"type": "string",
"const": "ALL_PERMISSIONS"
},
{
"type": "object",
"properties": {
"permissions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"friendlyId": {
"type": "string"
}
},
"required": [
"id",
"friendlyId"
]
}
}
},
"required": ["permissions"]
}
]
}
},
"required": [
"timestamp",
"eventId",
"entity",
"organisation",
"principal",
"clientType",
"action"
],
"definitions": {
"entity": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"entityType": {
"anyOf": [
{
"type": "string",
"enum": [
"MOCK_API",
"USER",
"TEAM",
"ORGANISATION",
"API_TEMPLATE",
"API_TEMPLATE_CATALOGUE",
"DATA_SOURCE",
"KEY",
"DATABASE_CONNECTION",
"STUB_MAPPING",
"MOCK_API_SETTINGS",
"SUBSCRIPTION",
"OPENAPI_GIT_INTEGRATION",
"API_KEY",
"S3_AUDIT_SINK"
]
},
{ "type": "string" }
]
}
},
"required": ["id", "name", "entityType"]
}
}
}