Skip to content

Commit

Permalink
Fix bug with auth endpoints (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattops authored Feb 22, 2024
1 parent 9e322c0 commit c6325c4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions github_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,17 @@ def process_repo(**component):
dev_url = False

if dev_url:
health_path = "/health"
info_path = "/info"
# Hack for hmpps-auth non standard endpoints
if 'sign-in' in dev_url:
dev_url = f"{dev_url}/auth"
health_path = "/auth/health"
info_path = "/auth/info"

if test_endpoint(dev_url, '/health'):
e.update({'health_path': '/health'})
if test_endpoint(dev_url, '/info'):
e.update({'info_path': '/info'})
if test_endpoint(dev_url, health_path):
e.update({'health_path': health_path})
if test_endpoint(dev_url, info_path):
e.update({'info_path': info_path})
if test_swagger_docs(dev_url):
e.update({'swagger_docs': '/swagger-ui.html'})
data.update({'api': True, 'frontend': False})
Expand Down Expand Up @@ -383,9 +386,12 @@ def process_repo(**component):
e.update({'namespace': env_namespace})

if env_url:
health_path = "/health"
info_path = "/info"
# Hack for hmpps-auth non standard endpoints
if 'sign-in' in env_url:
env_url = f"{env_url}/auth"
health_path = "/auth/health"
info_path = "/auth/info"

if test_endpoint(env_url, '/health'):
e.update({'health_path': '/health'})
Expand Down

0 comments on commit c6325c4

Please sign in to comment.