audit-event.schema.json

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://titip.id/schemas/audit-event.schema.json",
  "title": "AuditEvent",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "at",
    "actor"
  ],
  "properties": {
    "type": {
      "type": "string",
      "minLength": 3
    },
    "at": {
      "type": "string",
      "format": "date-time"
    },
    "actor": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "kind",
        "id"
      ],
      "properties": {
        "kind": {
          "enum": [
            "owner",
            "trusted_contact",
            "recipient",
            "reviewer",
            "system"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "user_id": {
      "type": "string"
    },
    "release_case_id": {
      "type": "string"
    },
    "policy_version": {
      "type": "string"
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "vault_id": {
      "type": "string"
    },
    "from_state": {
      "type": "string"
    },
    "to_state": {
      "type": "string"
    }
  }
}