{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "policyId",
    "status",
    "positiveReadinessAllowed",
    "authorityId",
    "authorityClass",
    "publicKeyBase64",
    "publicKeySha256",
    "reviewedPolicyCommit",
    "blocker",
    "rootAuthorityId",
    "authorityCredentialPath",
    "authorityCredentialSha256",
    "publicBeaconEndpoint"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0.0"
    },
    "policyId": {
      "const": "vaultfire-randomness-beacon-trust-v1"
    },
    "status": {
      "enum": [
        "disabled-until-genuine-independent-authority-is-reviewed-and-pinned",
        "enabled-reviewed-pinned"
      ]
    },
    "positiveReadinessAllowed": {
      "type": "boolean"
    },
    "authorityId": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^randomness-authority:[0-9a-f]{64}$"
    },
    "authorityClass": {
      "const": "independent-public-randomness-beacon"
    },
    "publicKeyBase64": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Za-z0-9+/]{43}=$"
    },
    "publicKeySha256": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$"
    },
    "reviewedPolicyCommit": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{40}$"
    },
    "blocker": {
      "type": "string",
      "minLength": 20
    },
    "rootAuthorityId": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^randomness-root:[0-9a-f]{64}$"
    },
    "authorityCredentialPath": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^pr10/partner-package/evidence/organizational/privacy-inputs/[a-z0-9-]+\\.json$"
    },
    "authorityCredentialSha256": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$"
    },
    "publicBeaconEndpoint": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^https://[a-z0-9.-]+/[A-Za-z0-9._/-]+$"
    }
  }
}
