"""Their identity in, a P2HS app-user grant out. Core remains the authority."""

from __future__ import annotations

from typing import Any


def plan_session_exchange(session_verification: str) -> dict[str, Any]:
    """Describe the exchange. This does not mint a grant or call their session URL."""
    if session_verification == "public":
        return {
            "app_user": None,
            "their_session_stays_theirs": True,
            "authority": "p2hs_core",
            "browser_receives_customer_secret": False,
        }
    return {
        "verify_server_side": session_verification,
        "grant": "p2hs_app_user",
        "their_session_stays_theirs": True,
        "authority": "p2hs_core",
        "browser_receives_customer_secret": False,
    }
