fat-catTW commented on code in PR #76748:
URL: https://github.com/apache/airflow/pull/76748#discussion_r4623601159
##########
providers/fab/src/airflow/providers/fab/auth_manager/fab_auth_manager.py:
##########
@@ -345,6 +348,29 @@ def _fetch_user() -> User:
self.session.remove()
raise
+ async def deserialize_user_async(self, token: dict[str, Any]) -> User:
+ """Deserialize a user for FastAPI JWT authentication without blocking
its event loop."""
+ # Preserve legacy synchronous overrides while the default FAB
implementation uses async lookup below.
+ deserialize_user_owner = next(cls for cls in type(self).__mro__ if
"deserialize_user" in cls.__dict__)
+ if deserialize_user_owner is not FabAuthManager:
Review Comment:
I tried the identity check first, but it fails in the Airflow 3.3.2
compatibility test because `cachedmethod` can expose a different wrapper
identity, making the default `FabAuthManager` look overridden and fall back to
the synchronous path. The MRO check avoids that version-specific behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]