{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opentine.com/schemas/opentine-admission-policy-1.schema.json",
  "title": "opentine.admission-policy (version 1)",
  "description": "A named server-side trust policy for `tine serve --trust-policy NAME=FILE` (SPEC 8.17). `refs` are fnmatch globs; the optional lists narrow tenants, pusher roles (any one) and subjects, and the ref target's object type; `levels` are the VSA's verifiedLevels (default OPENTINE_ADMITTED). First covering policy decides.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "kind",
    "version",
    "refs"
  ],
  "properties": {
    "kind": {
      "const": "opentine.admission-policy"
    },
    "version": {
      "const": 1
    },
    "refs": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "tenants": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "roles": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "subjects": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "object_types": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "levels": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    }
  }
}
