INNER CODE UNIT · Python
verifier
tokusumi/fastapi-cloudauth · fastapi_cloudauth/base.py:31
def verifier(self, instance: Verifier) -> None:
... # pragma: no cover
@abstractmethod
async def call(self, http_auth: HTTPAuthorizationCredentials) -> Any:
"""Define postprocess for verified token"""
... # pragma: no cover
def clone(self, instance: "CloudAuth") -> "CloudAuth":
"""Create clone of this instance"""
# In some case, Verifier can't pickle (deepcopy).
# Tempolary put it aside to deepcopy. Then, undo it at the last line.
if not isinstance(instance, CloudAuth):
raise TypeError(
"Only subclass of CloudAuth can be cloned"
) # pragma: no cover
_verifier = instance.verifier