dabla commented on issue #71499:
URL: https://github.com/apache/airflow/issues/71499#issuecomment-7060542096

   @stephen-bracken #77007 adds an opt-in setting for the setup you describe 
(team-level policies, no policy that looks at the individual Dag). It is in 
`apache-airflow-providers-keycloak` 0.13.0rc1, currently in the release vote 
(#77411):
   
   ```ini
   [keycloak_auth_manager]
   team_level_authorization = True
   ```
   
   With it the list filters ask Keycloak once per team instead of once per Dag, 
and once in total for assets, and apply the answer to every resource of that 
type. It is only safe when no policy of the realm reads the `resource_id` 
claim, which is the case for the permissions the CLI creates 
(`create-permissions`, `create-team`). The setting is described in the 
[permissions 
documentation](https://github.com/apache/airflow/blob/main/providers/keycloak/docs/auth-manager/manage/permissions.rst).
   
   I tested the rc on Airflow 3.4.0 against Keycloak 26.4, without multi-team: 
filtering 200 Dags took 200 requests to Keycloak (2.9 s) without the setting 
and 1 request (0.03 s) with it, with the same Dags authorized for a user with 
access and none for a user without.
   
   Could you try 0.13.0rc1 on your multi-team instance (about 900 Dags over 10 
teams) and tell us what the Dag list does? If that solves it for you, I think 
this issue can be closed. Realms that do grant access per Dag still need one 
request per Dag; that part waits for batch authorization on the Keycloak side 
(keycloak/keycloak#45311).
   


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