1 2 3 4 5
from typing import Literal def my_custom_validate(token: str) -> Literal[True]: raise Exception("Custom validate failed")