Skip to content

Fix oauth_whitelists in BaseSecurityManager#21308

Merged
potiuk merged 1 commit intoapache:mainfrom
astronomer:fix_oauth
Feb 3, 2022
Merged

Fix oauth_whitelists in BaseSecurityManager#21308
potiuk merged 1 commit intoapache:mainfrom
astronomer:fix_oauth

Conversation

@jedcunningham
Copy link
Member

Recent typing changes in BaseSecurityManager broke oauth integrations. This fixes it by initializing oauth_whitelists as an empty dict, like it is in FAB.

Without a whitelist:

  File "/Users/jedc/Envs/af/lib/python3.7/site-packages/flask_appbuilder/security/views.py", line 674, in oauth_authorized
    if provider in self.appbuilder.sm.oauth_whitelists:
AttributeError: 'AirflowSecurityManager' object has no attribute 'oauth_whitelists'

With a whitelist:

  File "/Users/jedc/github/airflow/airflow/www/fab_security/manager.py", line 238, in __init__               
    self.oauth_whitelists[provider_name] = _provider["whitelist"]                              
AttributeError: 'AirflowSecurityManager' object has no attribute 'oauth_whitelists'

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Feb 3, 2022
@potiuk potiuk merged commit 5b908ec into apache:main Feb 3, 2022
@jedcunningham jedcunningham deleted the fix_oauth branch February 3, 2022 23:03
@jedcunningham jedcunningham added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants