Skip to content

Commit

Permalink
Merge a82747b into 0d6c4c5
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Feb 24, 2022
2 parents 0d6c4c5 + a82747b commit 75e82fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fence/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def wrapper(*args, **kwargs):
]
else:
# fall back on "providers"
enable_shib = "shibboleth" in config.get(
"ENABLED_IDENTITY_PROVIDERS", {}
enable_shib = "shibboleth" in (
config.get("ENABLED_IDENTITY_PROVIDERS") or {}
).get("providers", {})

if enable_shib and "SHIBBOLETH_HEADER" in config:
Expand Down
4 changes: 2 additions & 2 deletions fence/blueprints/login/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_login_providers_info():
# default login option
if config.get("DEFAULT_LOGIN_IDP"):
default_idp = config["DEFAULT_LOGIN_IDP"]
elif "default" in config.get("ENABLED_IDENTITY_PROVIDERS", {}):
elif "default" in (config.get("ENABLED_IDENTITY_PROVIDERS") or {}):
# fall back on ENABLED_IDENTITY_PROVIDERS.default
default_idp = config["ENABLED_IDENTITY_PROVIDERS"]["default"]
else:
Expand All @@ -188,7 +188,7 @@ def get_login_providers_info():
# other login options
if config["LOGIN_OPTIONS"]:
login_options = config["LOGIN_OPTIONS"]
elif "providers" in config.get("ENABLED_IDENTITY_PROVIDERS", {}):
elif "providers" in (config.get("ENABLED_IDENTITY_PROVIDERS") or {}):
# fall back on "providers" and convert to "login_options" format
enabled_providers = config["ENABLED_IDENTITY_PROVIDERS"]["providers"]
login_options = [
Expand Down
4 changes: 2 additions & 2 deletions fence/blueprints/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def authorize(*args, **kwargs):

login_url = None
if not idp:
if not config.get("DEFAULT_LOGIN_IDP") and "default" not in config.get(
"ENABLED_IDENTITY_PROVIDERS", {}
if not config.get("DEFAULT_LOGIN_IDP") and "default" not in (
config.get("ENABLED_IDENTITY_PROVIDERS") or {}
):
# fall back on deprecated DEFAULT_LOGIN_URL
login_url = config.get("DEFAULT_LOGIN_URL")
Expand Down

0 comments on commit 75e82fe

Please sign in to comment.