{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kabinethq.com/protocol/1/auth.schema.json",
  "title": "Auth",
  "description": "The session: `POST /panel/login`, `GET /panel/me`, and the realtime channel's authorization.",
  "$defs": {
    "Me": {
      "title": "Me",
      "description": "The signed-in user (`GET /panel/me`, `POST /panel/login`).",
      "type": "object",
      "required": ["id", "name", "email"],
      "properties": {
        "id": { "$ref": "common.schema.json#/$defs/Key" },
        "name": { "type": "string" },
        "email": { "type": "string", "format": "email" }
      },
      "additionalProperties": false
    },
    "ChannelAuth": {
      "title": "ChannelAuth",
      "description": "The Pusher protocol's signature for a private channel (`POST {realtime.authEndpoint}`).",
      "type": "object",
      "required": ["auth"],
      "properties": {
        "auth": { "type": "string", "pattern": "^[^:]+:[0-9a-f]{64}$" }
      },
      "additionalProperties": false
    }
  }
}
