"""User ID must be a trusted Keygen User UUID supplied by your backend."""
from keygen_device_sdk import LicenseSDKError, ValidationScope


def validate_signed_in_user(client, keygen_user_uuid: str):
    try:
        scope = ValidationScope(user_id=keygen_user_uuid)
        return client.validate_or_raise(scope=scope)
    except LicenseSDKError as exc:
        raise RuntimeError(f"User-based validation failed: {exc}") from exc
