Xj|ddlmZddlmZddlmZmZmZmZddl m Z ddl m Z m Z ddlmZmZmZmZGddZy ) ) annotations)Callable)AuthCredentialsAuthenticationBackendAuthenticationErrorUnauthenticatedUser)HTTPConnection)PlainTextResponseResponse)ASGIAppReceiveScopeSendc@eZdZ d ddZddZeddZy) AuthenticationMiddlewareNcV||_||_|||_y|j|_yN)appbackenddefault_on_erroron_error)selfrrrs w/mnt/ssd/data/Dropbox/adrian/vault-secondbrain/venv/lib/python3.12/site-packages/starlette/middleware/authentication.py__init__z!AuthenticationMiddleware.__init__s1   ,H 262G2G cK|ddvr|j|||d{yt|} |jj|d{}|t tf}|\|d<|d<|j|||d{y7q7C#t$rL}|j ||}|ddk(r|dddd{7n||||d{7Yd}~yd}~wwxYw7aw) Ntype)http websocketrzwebsocket.closei)rcodeauthuser)rr r authenticaterrrr)rscopereceivesendconn auth_resultexcresponses r__call__z!AuthenticationMiddleware.__call__s = 5 5((5'40 0 0 e$  $ 9 9$ ??K  )+-@-BBK'2$f uV}hhugt,,,# 1 @" }}T3/HV} +$5tDEEEugt444    -snC0BC0BBB7C0 C. C0B C+(C&C C&CC&!C0&C++C0c.tt|dS)Ni) status_code)r str)r'r)s rrz)AuthenticationMiddleware.default_on_error2s Ss;;rr)rr rrrz@Callable[[HTTPConnection, AuthenticationError], Response] | NonereturnNone)r$rr%r r&rr/r0)r'r r) Exceptionr/r )__name__ __module__ __qualname__rr+ staticmethodrrrrrsN VZ    '  S    -*<r=s-"$ .;99$<$