{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/route-attestation-verification.schema.json",
  "title": "dpone GitOps route attestation verification",
  "type": "object",
  "required": [
    "schema",
    "decision",
    "code",
    "message",
    "attestation_id",
    "attestation_sha256",
    "certification_bundle_sha256",
    "policy_fingerprint",
    "route_id",
    "release_id",
    "deployment_id",
    "environment",
    "authorization_profile",
    "signer",
    "validity",
    "verified_at",
    "errors"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "dpone.route-attestation-verification.v1"
    },
    "decision": {
      "enum": [
        "verified",
        "invalid",
        "unverified"
      ]
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "message": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "attestation_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "attestation_sha256": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "certification_bundle_sha256": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "policy_fingerprint": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "route_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "release_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "deployment_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "environment": {
      "type": [
        "string",
        "null"
      ]
    },
    "authorization_profile": {
      "type": [
        "string",
        "null"
      ]
    },
    "signer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "backend": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "certificate_identity": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "certificate_oidc_issuer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "verifier_version": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "validity": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "not_before": {
          "type": [
            "string",
            "null"
          ]
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "verified_at": {
      "type": "string",
      "format": "date-time"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    }
  }
}
