-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from bento-platform/toggle-ssl
Add environment variable to toggle ssl
- Loading branch information
Showing
7 changed files
with
35 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,12 +56,7 @@ async def get_service(session: aiohttp.ClientSession, service_artifact: str) -> | |
service_resp: dict[str, dict] = {} | ||
|
||
try: | ||
async with session.get( | ||
service_info_url, | ||
headers=headers, | ||
ssl=not current_app.config["BENTO_DEBUG"], | ||
timeout=timeout, | ||
) as r: | ||
async with session.get(service_info_url, headers=headers, timeout=timeout) as r: | ||
if r.status != 200: | ||
r_text = await r.text() | ||
print(f"[{SERVICE_NAME}] Non-200 status code on {service_artifact}: {r.status}\n" | ||
|
@@ -99,7 +94,8 @@ async def chord_services(): | |
|
||
|
||
async def get_services() -> list[dict]: | ||
async with aiohttp.ClientSession() as session: | ||
async with aiohttp.ClientSession( | ||
connector=aiohttp.TCPConnector(ssl=current_app.config["BENTO_VALIDATE_SSL"])) as session: | ||
# noinspection PyTypeChecker | ||
service_list: list[Optional[dict]] = await asyncio.gather(*[ | ||
get_service(session, s["type"]["artifact"]) | ||
|
@@ -119,7 +115,8 @@ async def service_by_id(service_id: str): | |
if service_id not in services_by_id: | ||
return quart_not_found_error(f"Service with ID {service_id} was not found in registry") | ||
|
||
async with aiohttp.ClientSession() as session: | ||
async with aiohttp.ClientSession( | ||
connector=aiohttp.TCPConnector(ssl=current_app.config["BENTO_VALIDATE_SSL"])) as session: | ||
return await get_service(session, services_by_id[service_id]["type"]["artifact"]) | ||
|
||
|
||
|
@@ -142,7 +139,7 @@ async def get_service_info() -> dict: | |
"description": "Service registry for a Bento platform node.", | ||
"organization": { | ||
"name": "C3G", | ||
"url": "http://www.computationalgenomics.ca" | ||
"url": "https://www.computationalgenomics.ca" | ||
}, | ||
"contactUrl": "mailto:[email protected]", | ||
"version": __version__, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "bento_service_registry" | ||
version = "0.7.0" | ||
version = "0.7.1" | ||
description = "An implementation of GA4GH Service Registry API for the Bento platform." | ||
authors = ["David Lougheed <[email protected]>"] | ||
readme = "README.md" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters