Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to FAB 4.5.0 #39851

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions airflow/providers/fab/auth_manager/security_manager/override.py
Original file line number Diff line number Diff line change
Expand Up @@ -2229,13 +2229,17 @@ def get_oauth_user_info(self, provider: str, resp: dict[str, Any]) -> dict[str,
me = self.oauth_remotes[provider].get("userinfo")
data = me.json()
log.debug("User info from Okta: %s", data)
return {
"username": f"{provider}_{data['sub']}",
"first_name": data.get("given_name", ""),
"last_name": data.get("family_name", ""),
"email": data["email"],
"role_keys": data.get("groups", []),
}
if "error" not in data:
return {
"username": f"{provider}_{data['sub']}",
"first_name": data.get("given_name", ""),
"last_name": data.get("family_name", ""),
"email": data["email"],
"role_keys": data.get("groups", []),
}
else:
log.error(data.get("error_description"))
return {}
# for Auth0
if provider == "auth0":
data = self.appbuilder.sm.oauth_remotes[provider].userinfo()
Expand All @@ -2258,8 +2262,8 @@ def get_oauth_user_info(self, provider: str, resp: dict[str, Any]) -> dict[str,
"first_name": data.get("given_name", ""),
"last_name": data.get("family_name", ""),
"email": data.get("email", ""),
"role_keys": data.get("groups", []),
}

# for Authentik
if provider == "authentik":
id_token = resp["id_token"]
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/fab/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies:
# Every time we update FAB version here, please make sure that you review the classes and models in
# `airflow/providers/fab/auth_manager/security_manager/override.py` with their upstream counterparts.
# In particular, make sure any breaking changes, for example any new methods, are accounted for.
- flask-appbuilder==4.4.1
- flask-appbuilder==4.5.0
- flask-login>=0.6.2
- google-re2>=1.0
- jmespath
Expand Down
6 changes: 3 additions & 3 deletions dev/breeze/tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_get_documentation_package_path():
"",
"""
"apache-airflow>=2.9.0",
"flask-appbuilder==4.4.1",
"flask-appbuilder==4.5.0",
"flask-login>=0.6.2",
"flask>=2.2,<2.3",
"google-re2>=1.0",
Expand All @@ -179,7 +179,7 @@ def test_get_documentation_package_path():
"dev0",
"""
"apache-airflow>=2.9.0.dev0",
"flask-appbuilder==4.4.1",
"flask-appbuilder==4.5.0",
"flask-login>=0.6.2",
"flask>=2.2,<2.3",
"google-re2>=1.0",
Expand All @@ -192,7 +192,7 @@ def test_get_documentation_package_path():
"beta0",
"""
"apache-airflow>=2.9.0b0",
"flask-appbuilder==4.4.1",
"flask-appbuilder==4.5.0",
"flask-login>=0.6.2",
"flask>=2.2,<2.3",
"google-re2>=1.0",
Expand Down
2 changes: 1 addition & 1 deletion generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@
"fab": {
"deps": [
"apache-airflow>=2.9.0",
"flask-appbuilder==4.4.1",
"flask-appbuilder==4.5.0",
"flask-login>=0.6.2",
"flask>=2.2,<2.3",
"google-re2>=1.0",
Expand Down
1 change: 0 additions & 1 deletion scripts/in_container/run_generate_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ def generate_constraints_pypi_providers(config_params: ConfigParams) -> None:
run_command(
cmd=[
*config_params.get_install_command,
"-e",
potiuk marked this conversation as resolved.
Show resolved Hide resolved
".[all-core]",
*packages_to_install,
*config_params.eager_upgrade_additional_requirements_list,
Expand Down
Loading