{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Proxy Node Configuration Schema",
  "description": "Validation schema for configurations dynamically pushed to and evaluated by the HD_PROXY.",
  "type": "object",
  "properties": {
    "listen_address": {
      "type": "string",
      "description": "Port the proxy exposes for control plane REST interactions (e.g. :6986)"
    },
    "sc_routing_table": {
      "type": "object",
      "description": "Matrix mapping logical Storage Clusters to their upstream network gateways.",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "pbac_policies": {
      "type": "array",
      "description": "Ordered list of Policy-Based Access Control contexts determining payload mask behaviors.",
      "items": {
        "type": "object",
        "required": ["id", "policy_rego"],
        "properties": {
          "id": {
            "type": "string"
          },
          "policy_rego": {
            "type": "string",
            "description": "Raw OPA Rego string evaluating attribute clearance."
          },
          "restricted_fields": {
            "type": "array",
            "items": { "type": "string" }
          },
          "enforced_fields": {
            "type": "object"
          }
        }
      }
    },
    "sc_status": {
      "type": "string",
      "description": "Indicates the explicit upstream Operational Status of the bounded logical Storage Cluster.",
      "default": "Active"
    },
    "webhooks": {
      "type": "array",
      "description": "Optional list of WebHook endpoints to notify upon significant node lifecycle events.",
      "items": {
        "type": "object",
        "properties": {
          "url": { "type": "string", "format": "uri" },
          "events": { 
            "type": "array",
            "items": { "type": "string" }
          },
          "headers": { 
             "type": "object", 
             "additionalProperties": { "type": "string" }
          }
        },
        "required": ["url"]
      }
    },
    "command_interface": {
      "type": "string",
      "description": "The IPv4 interface for the Command Network to bind to.",
      "default": "0.0.0.0"
    },
    "observability_interface": {
      "type": "string",
      "description": "The IPv4 interface for the Observability Network to bind to.",
      "default": "0.0.0.0"
    },
    "production_interface": {
      "type": "string",
      "description": "The physical PCIe network interface bound to the VFIO kernel module used for fast-path DPDK packet RX/TX. If 'none', uses posix system stack.",
      "default": "none"
    }
  }
}
