Skip to content

Commit

Permalink
Handle deployment-service-check user for auth0
Browse files Browse the repository at this point in the history
That user (which we use for our health checks) does not have
any auth state, so this was causing health checks to fail.

Follow-up to 2i2c-org#3618
  • Loading branch information
yuvipanda committed Jan 25, 2024
1 parent de54ad3 commit e986799
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions config/clusters/earthscope/common.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ basehub:
return False
def populate_token(spawner, auth_state):
token_env = {
'AUTH0_ACCESS_TOKEN': auth_state.get("access_token", ""),
'AUTH0_ID_TOKEN': auth_state.get("id_token", ""),
'AUTH0_REFRESH_TOKEN': auth_state.get('refresh_token', '')
}
spawner.environment.update(token_env)
# For our deployment-service-check health check user, there is no auth_state.
# So these env variables need not be set.
if auth_state:
token_env = {
'AUTH0_ACCESS_TOKEN': auth_state.get("access_token", ""),
'AUTH0_ID_TOKEN': auth_state.get("id_token", ""),
'AUTH0_REFRESH_TOKEN': auth_state.get('refresh_token', '')
}
spawner.environment.update(token_env)
c.Spawner.auth_state_hook = populate_token
Expand Down

0 comments on commit e986799

Please sign in to comment.