{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$ref": "#/definitions/SigninResponse",
    "definitions": {
        "SigninResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "number",
                    "enum": [
                        200,
                        409
                    ],
                    "description": "409 if MFA or escrow is required, 200 if the trust token was accepted"
                },
                "data": {
                    "type": "object",
                    "properties": {
                        "authType": {
                            "type": "string",
                            "const": "hsa2"
                        }
                    },
                    "required": [
                        "authType"
                    ],
                    "description": "Data should be irrelevant for this one"
                },
                "headers": {
                    "type": "object",
                    "properties": {
                        "scnt": {
                            "type": "string",
                            "description": "Scnt token - required to keep track of MFA request",
                            "minLength": 1
                        },
                        "x-apple-session-token": {
                            "type": "string",
                            "description": "Session secret - required to keep track of MFA request",
                            "minLength": 1
                        },
                        "x-apple-id-session-id": {
                            "type": "string",
                            "description": "Session id used by the web frontend to track the authentication flow",
                            "minLength": 1
                        },
                        "x-apple-id-account-country": {
                            "type": "string",
                            "description": "Country code of the account, used during account setup"
                        },
                        "set-cookie": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "description": "Should hold the 'aasp' cookie",
                            "minItems": 1
                        }
                    },
                    "required": [
                        "scnt",
                        "x-apple-session-token",
                        "set-cookie"
                    ]
                }
            },
            "required": [
                "status",
                "data",
                "headers"
            ],
            "description": "The expected response format for the signin request"
        }
    }
}
