Attempt to debug SSL cert validation error

This changeset introduces a few changes:

* Removes UK Notify Logo URL and config
* Removes UK Notify API URL and replaces with Notify.gov
* Improves the error handler for HTTPErrors to provide actual exception and stack trace information

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2025-07-29 17:33:13 -04:00
parent c1b071adea
commit f85efba737
4 changed files with 23 additions and 20 deletions

View File

@@ -2,6 +2,8 @@ import json
import logging
import urllib.parse
from os import getenv
import requests
from notifications_python_client import __version__
@@ -10,21 +12,22 @@ from notifications_python_client.errors import HTTPError, InvalidResponse
logger = logging.getLogger(__name__)
API_PUBLIC_URL = getenv("API_PUBLIC_URL", "localhost")
class BaseAPIClient:
"""
Base class for GOV.UK Notify API client.
Base class for Notify.gov API client.
This class is not thread-safe.
"""
def __init__(
self, api_key, base_url="https://api.notifications.service.gov.uk", timeout=30
self, api_key, base_url=API_PUBLIC_URL, timeout=30
):
"""
Initialise the client
Error if either of base_url or secret missing
:param base_url - base URL of GOV.UK Notify API:
:param base_url - base URL of Notify.gov API:
:param secret - application secret - used to sign the request:
:param timeout - request timeout on the client
:return: