-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Pools have disappeared from the Admin menu #39204
Comments
In production we're using the GitHub login. Added to the issue description, thanks! |
We're facing the same problem reported by @csp33 , but not only with pools. After navigating again for some tabs and come back to pool using directly URL, it apper again. Obs: Webserver and Scheduller logs doesn't show any error that appers to be related with that. |
What's your Github integration configuration @csp33 (Without secrets?) ? |
This is my import os
from typing import Dict, Any, List, Union
from airflow.www.security import AirflowSecurityManager
from flask_appbuilder import expose
from flask_appbuilder.security.manager import AUTH_OAUTH
from flask_appbuilder.security.views import AuthOAuthView
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Viewer"
PERMANENT_SESSION_LIFETIME = 1800
OAUTH_PROVIDERS = [
{
"name": "github",
"icon": "fa-github",
"token_key": "access_token",
"remote_app": {
"client_id": os.getenv("GITHUB_OAUTH_APP_ID"),
"client_secret": os.getenv("GITHUB_OAUTH_APP_SECRET"),
"api_base_url": "https://api.github.com",
"client_kwargs": {"scope": "read:user, read:org"},
"access_token_url": "https://github.com/login/oauth/access_token",
"authorize_url": "https://github.com/login/oauth/authorize",
"request_token_url": None,
},
},
]
class CustomAuthRemoteUserView(AuthOAuthView):
@expose("/logout/")
def logout(self):
"""Delete access token before logging out."""
return super().logout()
class GithubAuthorizer(AirflowSecurityManager):
authoauthview = CustomAuthRemoteUserView
def get_oauth_user_info(
self, provider: str, resp: Any
) -> Dict[str, Union[str, List[str]]]:
remote_app = self.appbuilder.sm.oauth_remotes[provider]
me = remote_app.get("user")
user_data = me.json()
username = user_data["login"]
try:
name_surname_list = user_data['name'].split(" ", 1)
first_name = name_surname_list[0]
last_name = name_surname_list[1]
except Exception:
first_name = last_name = "unknown"
return {
"username": username,
"email": user_data["email"],
"first_name": first_name,
"last_name": last_name,
}
SECURITY_MANAGER_CLASS = GithubAuthorizer |
Absolutely cannot reproduce - even with your settings: Questions:
airflow users list
|
The default implementation of filter_permitted_menu_items had a subtle side-effect. The filtering on child items was done in-place and modified the menu itself, so it was enough to get the same worker serve requests for multiple users for the same menu to get the items removed for subsequent user - even if they had permission to see it. Deepcopying the menu items before filtering them should fix the problem Fixes: apache#39204 Fixes: apache#39135
The default implementation of filter_permitted_menu_items had a subtle side-effect. The filtering on child items was done in-place and modified the menu itself, so it was enough to get the same worker serve requests for multiple users for the same menu to get the items removed for subsequent user - even if they had permission to see it. Deepcopying the menu items before filtering them should fix the problem Fixes: #39204 Fixes: #39135
The default implementation of filter_permitted_menu_items had a subtle side-effect. The filtering on child items was done in-place and modified the menu itself, so it was enough to get the same worker serve requests for multiple users for the same menu to get the items removed for subsequent user - even if they had permission to see it. Deepcopying the menu items before filtering them should fix the problem Fixes: #39204 Fixes: #39135 (cherry picked from commit 0d2c0c5)
Apache Airflow version
2.9.0
If "Other Airflow 2 version" selected, which one?
No response
What happened?
Pools
item is not shown in admin menu.However, I can still access the interface entering the URL
<webserver>/pool/list
My user has the
Admin
rolewhich can do everything related to
Pools
What you think should happen instead?
Pools should be displayed in the
Admin
menu, just like beforeHow to reproduce
Pools
in theAdmin
menu.Operating System
Airflow in Kubernetes
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
Anything else?
We're using GitHub login.
In local (user/password login) the
Pools
option still appears in theAdmin
menu.Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: