{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/domani-run/json-schema/domani-run-http-route-policy-schema.json",
  "title": "HttpRoutePolicy",
  "description": "Structured hostname, concurrency, and lease authority for a least-privilege HTTP route token.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/domani-run-api-tokens-api-openapi.yml#/components/schemas/HttpRoutePolicy",
  "type": [
    "object",
    "null"
  ],
  "required": [
    "hostname_rules",
    "max_concurrent",
    "max_lease_seconds"
  ],
  "properties": {
    "hostname_rules": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "domain",
              "kind",
              "hostname"
            ],
            "properties": {
              "domain": {
                "type": "string"
              },
              "kind": {
                "const": "exact"
              },
              "hostname": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "domain",
              "kind",
              "prefix"
            ],
            "properties": {
              "domain": {
                "type": "string"
              },
              "kind": {
                "const": "subdomain_prefix"
              },
              "prefix": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "max_concurrent": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20
    },
    "max_lease_seconds": {
      "type": "integer",
      "minimum": 60,
      "maximum": 86400
    }
  }
}