mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 17:38:02 -04:00
clients: add cbc proxy clients
We are going to invoke a lambda to send a message to the CBC We need a CBC Proxy Client to do this The Client will be able to send/update/cancel broadcasts in the CBC Unless we have configured the app with AWS credentials for the CBCProxyClient, we just want to use a client that does nothing: the noop client The AWS access keys are separate for the CBC Proxy vs other Notify AWS things because the CBC Proxy lives in another AWS account Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk> Co-authored-by: Pea <pea.tyczynska@digital.cabinet-office.gov.uk> Co-authored-by: Katie <katie.smith@digital.cabinet-office.gov.uk>
This commit is contained in:
@@ -23,6 +23,7 @@ from werkzeug.local import LocalProxy
|
||||
|
||||
from app.celery.celery import NotifyCelery
|
||||
from app.clients import Clients
|
||||
from app.clients.cbc_proxy import CBCProxyClient, CBCProxyNoopClient
|
||||
from app.clients.document_download import DocumentDownloadClient
|
||||
from app.clients.email.aws_ses import AwsSesClient
|
||||
from app.clients.email.aws_ses_stub import AwsSesStubClient
|
||||
@@ -60,6 +61,7 @@ zendesk_client = ZendeskClient()
|
||||
statsd_client = StatsdClient()
|
||||
redis_store = RedisClient()
|
||||
performance_platform_client = PerformancePlatformClient()
|
||||
cbc_proxy_client = CBCProxyNoopClient()
|
||||
document_download_client = DocumentDownloadClient()
|
||||
metrics = GDSMetrics()
|
||||
|
||||
@@ -112,6 +114,10 @@ def create_app(application):
|
||||
performance_platform_client.init_app(application)
|
||||
document_download_client.init_app(application)
|
||||
|
||||
if application.config['CBC_PROXY_AWS_ACCESS_KEY_ID']:
|
||||
cbc_proxy_client = CBCProxyClient()
|
||||
cbc_proxy_client.init_app(application)
|
||||
|
||||
register_blueprint(application)
|
||||
register_v2_blueprints(application)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user