{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-sso-claim-mapping-schema.json",
  "title": "SsoClaimMapping",
  "description": "Rules that turn identity-provider claims into a role at a location.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-sso-connections-api-openapi.yml#/components/schemas/SsoClaimMapping",
  "type": "object",
  "properties": {
    "locationClaim": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The claim whose value names a location (matched to a location's name or Location ID)."
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "claim": {
            "type": "string",
            "description": "The identity-provider claim to read, e.g. `groups`."
          },
          "match": {
            "type": "string",
            "enum": [
              "equals",
              "contains"
            ]
          },
          "value": {
            "type": "string"
          },
          "roleId": {
            "type": "string",
            "description": "The role to grant when the rule matches."
          },
          "at": {
            "type": "string",
            "enum": [
              "location",
              "root",
              "node"
            ],
            "description": "Where to grant it: the location named by `locationClaim`, the workspace root, or the fixed `nodeId`."
          },
          "nodeId": {
            "description": "The location for an `at: node` rule.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "claim",
          "match",
          "value",
          "roleId",
          "at"
        ]
      }
    },
    "noMatch": {
      "type": "string",
      "enum": [
        "default",
        "deny"
      ],
      "description": "When no rule matches: give `defaultRoleId` at the root, or refuse the sign-in."
    }
  },
  "required": [
    "locationClaim",
    "rules",
    "noMatch"
  ]
}