{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-auth-test-session-response-schema.json",
  "title": "AuthTestSessionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-auth-api-openapi.yml#/components/schemas/AuthTestSessionResponse",
  "type": "object",
  "required": [
    "user",
    "session",
    "access_token",
    "token_type",
    "expires_in",
    "app_origins",
    "examples",
    "test_mode"
  ],
  "properties": {
    "user": {
      "$ref": "#/$defs/AuthTestUser"
    },
    "session": {
      "type": "object",
      "required": [
        "cookie_name",
        "cookie_value",
        "session_id",
        "amr",
        "auth_time",
        "expires_at",
        "hard_expires_at"
      ],
      "properties": {
        "cookie_name": {
          "type": "string"
        },
        "cookie_value": {
          "type": "string",
          "description": "Secret-bearing cookie value. Returned once; do not log."
        },
        "session_id": {
          "type": "string"
        },
        "amr": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "auth_time": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "hard_expires_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "access_token": {
      "type": "string",
      "description": "2-hour bearer token with is_test=true. No refresh token is issued."
    },
    "token_type": {
      "type": "string",
      "enum": [
        "bearer"
      ]
    },
    "expires_in": {
      "type": "integer"
    },
    "app_origins": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "test_mode": {
      "$ref": "#/$defs/TestModeStatus"
    }
  },
  "$defs": {
    "AuthTestUser": {
      "type": "object",
      "required": [
        "id",
        "label",
        "email",
        "is_test",
        "is_admin",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "label": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "is_test": {
          "type": "boolean",
          "enum": [
            true
          ]
        },
        "is_admin": {
          "type": "boolean"
        },
        "created": {
          "type": "boolean",
          "description": "Present on POST /auth/v1/test-sessions to distinguish create vs reuse."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "email_verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "last_minted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "active_sessions": {
          "type": "integer"
        }
      }
    },
    "TestModeStatus": {
      "type": "object",
      "required": [
        "value",
        "effective",
        "source",
        "default_for_tier"
      ],
      "properties": {
        "value": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Stored project override. null means use the tier default."
        },
        "effective": {
          "type": "boolean",
          "description": "Whether test sessions are currently enabled."
        },
        "source": {
          "type": "string",
          "enum": [
            "explicit",
            "tier_default"
          ]
        },
        "default_for_tier": {
          "type": "boolean",
          "description": "Tier default before the project override is applied."
        }
      }
    }
  }
}