@@ -212,7 +212,7 @@ An authentication interceptor checking bearer tokens and storing them to a conte
212212 def __init__(self, valid_tokens: list[str]):
213213 self._valid_tokens = valid_tokens
214214
215- def on_start (self, ctx: RequestContext) -> Token["auth_token"]:
215+ def on_start_sync (self, ctx: RequestContext) -> Token["auth_token"]:
216216 authorization = ctx.request_headers().get("authorization")
217217 if not authorization or not authorization.startswith("Bearer "):
218218 raise ConnectError(Code.UNAUTHENTICATED)
@@ -221,7 +221,7 @@ An authentication interceptor checking bearer tokens and storing them to a conte
221221 raise ConnectError(Code.PERMISSION_DENIED)
222222 return _auth_token.set(token)
223223
224- def on_end (self, token: Token["auth_token"], ctx: RequestContext):
224+ def on_end_sync (self, token: Token["auth_token"], ctx: RequestContext):
225225 _auth_token.reset(token)
226226 ```
227227
@@ -253,7 +253,7 @@ the authorization header.
253253 _auth_token = ContextVar["auth_token"]("current_auth_token")
254254
255255 class ClientAuthInterceptor:
256- def on_start (self, ctx: RequestContext):
256+ def on_start_sync (self, ctx: RequestContext):
257257 auth_token = _auth_token.get(None)
258258 if auth_token:
259259 ctx.request_headers()["authorization"] = f"Bearer {auth_token}"
0 commit comments