SameerMesiah97 commented on code in PR #69773:
URL: https://github.com/apache/airflow/pull/69773#discussion_r3566535734
##########
providers/fab/src/airflow/providers/fab/auth_manager/middleware.py:
##########
@@ -47,6 +54,12 @@ async def dispatch(self, request: Request, call_next):
public_user = auth_manager.build_public_user()
if public_user is not None:
request.state.user = public_user
+
+ if _USER_INJECTED_BY_TRUSTED_MIDDLEWARE is not None:
Review Comment:
I don't see the need for the `_USER_INJECTED_BY_TRUSTED_MIDDLEWARE ` if it
is only being used once. It would be better to in-line it like this:
```
user_injected = getattr(
core_api_security,
"USER_INJECTED_BY_TRUSTED_MIDDLEWARE",
None,
)
if user_injected is not None:
request.state.user_authenticated_via = user_injected
```
--
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]