Skip to content

Commit

Permalink
Remove uppercase logic from oidc_auth
Browse files Browse the repository at this point in the history
Remove automatic conversion of provider names to uppercase from
get_oidc_secondary_providers().
  • Loading branch information
sbreker committed Sep 25, 2024
1 parent 1654a22 commit 46a3374
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/dashboard/src/settings/components/oidc_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,25 @@


def get_oidc_secondary_providers(oidc_secondary_provider_names):
"""Build secondary OIDC provider details dict. Takes a list of secondary
OIDC providers and gathers details about these providers from env vars.
Output dict contains details for each OIDC connection which can then be
referenced by name.
"""

providers = {}

for provider_name in oidc_secondary_provider_names:
provider_name = provider_name.strip()
client_id = os.environ.get(f"OIDC_RP_CLIENT_ID_{provider_name.upper()}")
client_secret = os.environ.get(f"OIDC_RP_CLIENT_SECRET_{provider_name.upper()}")
client_id = os.environ.get(f"OIDC_RP_CLIENT_ID_{provider_name}")
client_secret = os.environ.get(f"OIDC_RP_CLIENT_SECRET_{provider_name}")
authorization_endpoint = os.environ.get(
f"OIDC_OP_AUTHORIZATION_ENDPOINT_{provider_name.upper()}", ""
)
token_endpoint = os.environ.get(
f"OIDC_OP_TOKEN_ENDPOINT_{provider_name.upper()}", ""
)
user_endpoint = os.environ.get(
f"OIDC_OP_USER_ENDPOINT_{provider_name.upper()}", ""
)
jwks_endpoint = os.environ.get(
f"OIDC_OP_JWKS_ENDPOINT_{provider_name.upper()}", ""
)
logout_endpoint = os.environ.get(
f"OIDC_OP_LOGOUT_ENDPOINT_{provider_name.upper()}", ""
f"OIDC_OP_AUTHORIZATION_ENDPOINT_{provider_name}", ""
)
token_endpoint = os.environ.get(f"OIDC_OP_TOKEN_ENDPOINT_{provider_name}", "")
user_endpoint = os.environ.get(f"OIDC_OP_USER_ENDPOINT_{provider_name}", "")
jwks_endpoint = os.environ.get(f"OIDC_OP_JWKS_ENDPOINT_{provider_name}", "")
logout_endpoint = os.environ.get(f"OIDC_OP_LOGOUT_ENDPOINT_{provider_name}", "")

if client_id and client_secret:
providers[provider_name] = {
Expand Down

0 comments on commit 46a3374

Please sign in to comment.