uranusjr commented on code in PR #32525:
URL: https://github.com/apache/airflow/pull/32525#discussion_r1260454586


##########
airflow/www/security.py:
##########
@@ -56,8 +57,11 @@
     "Public",
 }
 
+# Fetch the security manager override from the auth manager
+SecurityManagerOverride = 
get_auth_manager().get_security_manager_override_class()
 
-class AirflowSecurityManager(SecurityManager, LoggingMixin):
+
+class AirflowSecurityManager(SecurityManager, LoggingMixin, 
SecurityManagerOverride):  # type: ignore

Review Comment:
   Also does this order work? I seem to recall Python MRO is front over after, 
so in this setup `SecurityManager` would simply shadow anything declared in 
`SecurityManagerOverride`. This doesn’t seem to be what you intend.
   
   ```pycon
   >>> class A:
   ...  def f(self): pass
   ... 
   >>> class B:
   ...  def f(self): pass
   ... 
   >>> class X(A, B): pass
   ... 
   >>> class Y(B, A): pass
   ... 
   >>> X.f
   <function A.f at 0x104d9eac0>
   >>> Y.f
   <function B.f at 0x104d9eb60>
   >>>
   ```



##########
airflow/www/security.py:
##########
@@ -56,8 +57,11 @@
     "Public",
 }
 
+# Fetch the security manager override from the auth manager
+SecurityManagerOverride = 
get_auth_manager().get_security_manager_override_class()
 
-class AirflowSecurityManager(SecurityManager, LoggingMixin):
+
+class AirflowSecurityManager(SecurityManager, LoggingMixin, 
SecurityManagerOverride):  # type: ignore

Review Comment:
   Also does this order work? I seem to recall Python MRO is front over after, 
so in this setup `SecurityManager` would simply shadow anything declared in 
`SecurityManagerOverride`. This doesn’t seem to be what you intend.
   
   ```pycon
   >>> class A:
   ...  def f(self): pass
   ... 
   >>> class B:
   ...  def f(self): pass
   ... 
   >>> class X(A, B): pass
   ... 
   >>> class Y(B, A): pass
   ... 
   >>> X.f
   <function A.f at 0x104d9eac0>
   >>> Y.f
   <function B.f at 0x104d9eb60>
   >>>
   ```



-- 
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]

Reply via email to