{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capp.local/schemas/capp.gateway-assertion.v2.schema.json",
  "title": "cApp gateway assertion v2",
  "type": "object",
  "required": [
    "protocol",
    "aud",
    "appId",
    "installId",
    "route",
    "method",
    "capability",
    "jti",
    "iat",
    "exp"
  ],
  "properties": {
    "protocol": {
      "const": "capp.gateway-assertion.v2"
    },
    "aud": {
      "type": "string",
      "minLength": 1
    },
    "appId": {
      "type": "string",
      "minLength": 1
    },
    "installId": {
      "type": "string",
      "minLength": 1
    },
    "keyId": {
      "type": "string",
      "minLength": 1
    },
    "siteId": {
      "type": [
        "string",
        "null"
      ]
    },
    "capsuleHash": {
      "type": [
        "string",
        "null"
      ]
    },
    "bindingId": {
      "type": [
        "string",
        "null"
      ]
    },
    "route": {
      "type": "string",
      "pattern": "^/"
    },
    "method": {
      "type": "string",
      "minLength": 1
    },
    "capability": {
      "type": "string",
      "minLength": 1
    },
    "bodySha256": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-fA-F]{64}$"
    },
    "sub": {
      "type": [
        "string",
        "null"
      ]
    },
    "jti": {
      "type": "string",
      "minLength": 8
    },
    "iat": {
      "type": "integer",
      "minimum": 1
    },
    "nbf": {
      "type": "integer",
      "minimum": 1
    },
    "exp": {
      "type": "integer",
      "minimum": 1
    }
  },
  "additionalProperties": true
}
