This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 0ded4851ae9 Skip building an unused token on Keycloak authorization
checks (#77746)
0ded4851ae9 is described below
commit 0ded4851ae924c317ba5c13eb37408debc08f1a3
Author: Baptiste Gouhoury <[email protected]>
AuthorDate: Mon Nov 30 17:10:32 2026 +0100
Skip building an unused token on Keycloak authorization checks (#77746)
The auth manager only reads the status code of the check, but Keycloak
built and signed a full token for every allowed one.
Signed-off-by: Baptiste Gouhoury <[email protected]>
---
.../src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py | 1 +
.../tests/unit/keycloak/auth_manager/test_keycloak_auth_manager.py | 1 +
2 files changed, 2 insertions(+)
diff --git
a/providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py
b/providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py
index 150ac51f194..360c71a0080 100644
---
a/providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py
+++
b/providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py
@@ -940,6 +940,7 @@ class
KeycloakAuthManager(BaseAuthManager[KeycloakAuthManagerUser]):
"grant_type": "urn:ietf:params:oauth:grant-type:uma-ticket",
"audience": client_id,
"permission": permission,
+ "response_mode": "decision",
}
if attributes:
# Per UMA spec, push claims using claim_token parameter with
base64-encoded JSON
diff --git
a/providers/keycloak/tests/unit/keycloak/auth_manager/test_keycloak_auth_manager.py
b/providers/keycloak/tests/unit/keycloak/auth_manager/test_keycloak_auth_manager.py
index 3268b50ccfa..5e1687b81b2 100644
---
a/providers/keycloak/tests/unit/keycloak/auth_manager/test_keycloak_auth_manager.py
+++
b/providers/keycloak/tests/unit/keycloak/auth_manager/test_keycloak_auth_manager.py
@@ -1299,6 +1299,7 @@ class TestKeycloakAuthManager:
assert payload["grant_type"] ==
"urn:ietf:params:oauth:grant-type:uma-ticket"
assert payload["audience"] == client_id
assert payload["permission"] == permission
+ assert payload["response_mode"] == "decision"
if attributes is None:
# When no attributes, claim_token should not be present