{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/devarmor/json-schema/devarmor-trust-boundary-schema.json",
  "title": "TrustBoundary",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/devarmor-openapi.json#/components/schemas/TrustBoundary",
  "properties": {
    "access_control_methods": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/AccessControlMethod"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Access Control Methods"
    },
    "authentication_methods": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/AuthenticationMethod"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Authentication Methods"
    },
    "access_token_expires": {
      "type": "boolean",
      "title": "Access Token Expires"
    },
    "access_token_ttl": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Access Token Ttl"
    },
    "has_refresh_token": {
      "type": "boolean",
      "title": "Has Refresh Token"
    },
    "refresh_token_expires": {
      "type": "boolean",
      "title": "Refresh Token Expires"
    },
    "refresh_token_ttl": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Refresh Token Ttl"
    },
    "can_user_logout": {
      "type": "boolean",
      "title": "Can User Logout"
    },
    "can_system_logout": {
      "type": "boolean",
      "title": "Can System Logout"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "project": {
      "$ref": "#/$defs/Project"
    },
    "threat_model_versions": {
      "items": {
        "type": "string",
        "pattern": "^\\d+(\\.\\d+)*$"
      },
      "type": "array",
      "title": "Threat Model Versions"
    },
    "trust_zone_a": {
      "$ref": "#/$defs/TrustZone"
    },
    "trust_zone_b": {
      "$ref": "#/$defs/TrustZone"
    }
  },
  "type": "object",
  "required": [
    "access_control_methods",
    "authentication_methods",
    "access_token_expires",
    "access_token_ttl",
    "has_refresh_token",
    "refresh_token_expires",
    "refresh_token_ttl",
    "can_user_logout",
    "can_system_logout",
    "id",
    "project",
    "threat_model_versions",
    "trust_zone_a",
    "trust_zone_b"
  ],
  "$defs": {
    "AccessControlMethod": {
      "type": "string",
      "enum": [
        "acl",
        "rbac",
        "mac",
        "dac",
        "abac"
      ],
      "title": "AccessControlMethod"
    },
    "AuthenticationMethod": {
      "type": "string",
      "enum": [
        "password",
        "otp",
        "challenge_response",
        "public_key",
        "token",
        "biometrics",
        "sso",
        "social"
      ],
      "title": "AuthenticationMethod"
    },
    "Project": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "default": {
          "type": "boolean",
          "title": "Default",
          "default": false
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "use_memory": {
          "type": "boolean",
          "title": "Use Memory",
          "default": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "owner_user": {
          "$ref": "#/$defs/User"
        },
        "memory_effective": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective"
        },
        "memory_effective_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective Reason"
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "id",
        "owner_user"
      ],
      "title": "Project"
    },
    "TrustZone": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "$ref": "#/$defs/Project"
        },
        "threat_model_versions": {
          "items": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)*$"
          },
          "type": "array",
          "title": "Threat Model Versions"
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "description",
        "id",
        "project",
        "threat_model_versions"
      ],
      "title": "TrustZone"
    },
    "User": {
      "properties": {
        "email": {
          "type": "string",
          "title": "Email"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "state": {
          "$ref": "#/$defs/UserState",
          "default": "active"
        },
        "roles": {
          "items": {
            "$ref": "#/$defs/UserRole"
          },
          "type": "array",
          "title": "Roles",
          "default": []
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        }
      },
      "type": "object",
      "required": [
        "email",
        "name",
        "id"
      ],
      "title": "User"
    },
    "UserRole": {
      "type": "string",
      "enum": [
        "admin",
        "customer_support"
      ],
      "title": "UserRole"
    },
    "UserState": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "pending_org_approval"
      ],
      "title": "UserState"
    }
  }
}