Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def register_routes(app: Application):
relative_path = route["path"].lstrip("/")
if relative_path not in existing_endpoints:
service_data = {
"base_url": f"{config.WEATHER_SRV_HOSTNAME}:{config.WEATHER_SRV_PORT}",
"base_url": f"http://{config.WEATHER_SRV_HOSTNAME}:{config.WEATHER_SRV_PORT}/",
"service_name": "weather_data",
"endpoint": relative_path,
"methods": route["methods"],
Expand Down
1 change: 0 additions & 1 deletion src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

# GATEKEEPER
GATEKEEPER_URL= os.environ.get('GATEKEEPER_URL', '')
GATEKEEPER_APP_PORT = os.environ.get('GATEKEEPER_APP_PORT', '8001')
WEATHER_SRV_GATEKEEPER_USER = os.environ.get('WEATHER_SRV_GATEKEEPER_USER', '')
WEATHER_SRV_GATEKEEPER_PASSWORD = os.environ.get('WEATHER_SRV_GATEKEEPER_PASSWORD', '')

Expand Down
8 changes: 4 additions & 4 deletions src/gatekeeper_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def gk_login() -> str:
'password': config.WEATHER_SRV_GATEKEEPER_PASSWORD
}
async with httpx.AsyncClient() as client:
url = f'{config.GATEKEEPER_URL}:{config.GATEKEEPER_APP_PORT}/api/login/'
url = f'{config.GATEKEEPER_URL}/api/login/'
r = await client.post(url, data=login_credentials)
r.raise_for_status()
return (r.json()['access'], r.json()['refresh'])
Expand All @@ -20,7 +20,7 @@ async def gk_login() -> str:
# Logout to gatekeeper using credentials from config file
async def gk_logout(refresh_token):
async with httpx.AsyncClient() as client:
url = f'{config.GATEKEEPER_URL}:{config.GATEKEEPER_APP_PORT}/api/logout/'
url = f'{config.GATEKEEPER_URL}/api/logout/'
r = await client.post(url, json={"refresh": refresh_token})
r.raise_for_status()
return
Expand All @@ -32,7 +32,7 @@ async def gk_service_directory(token: str) -> dict:
headers = {
"Authorization": f"Bearer {token}"
}
r = await client.get(f'{config.GATEKEEPER_URL}:{config.GATEKEEPER_APP_PORT}/api/service_directory/', headers=headers)
r = await client.get(f'{config.GATEKEEPER_URL}/api/service_directory/', headers=headers)
r.raise_for_status()
return r.json()

Expand All @@ -43,6 +43,6 @@ async def gk_service_register(token: str, service_data: dict) -> dict:
headers = {
"Authorization": f"Bearer {token}"
}
r = await client.post(f'{config.GATEKEEPER_URL}:{config.GATEKEEPER_APP_PORT}/api/register_service/', headers=headers, json=service_data)
r = await client.post(f'{config.GATEKEEPER_URL}/api/register_service/', headers=headers, json=service_data)
r.raise_for_status()
return r.json()