mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-10 23:23:27 -05:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user