From 1b17520e0e3544f6d5904afb595d7311648196e2 Mon Sep 17 00:00:00 2001 From: Ronaldo Macapobre Date: Wed, 20 Nov 2024 21:50:24 +0000 Subject: [PATCH 1/3] Comment out using the AWS_API_GATEWAY_API_KEY and AuthorizerKey until mtls has been finalized --- api/Infrastructure/ServiceCollectionExtensions.cs | 10 +++++----- docker/docker-compose.yaml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/Infrastructure/ServiceCollectionExtensions.cs b/api/Infrastructure/ServiceCollectionExtensions.cs index dd432956..46733ccf 100644 --- a/api/Infrastructure/ServiceCollectionExtensions.cs +++ b/api/Infrastructure/ServiceCollectionExtensions.cs @@ -63,12 +63,12 @@ public static IServiceCollection AddHttpClientsAndScvServices(this IServiceColle services.AddHttpClient(client => { - // client.DefaultRequestHeaders.Authorization = new BasicAuthenticationHeaderValue( - // configuration.GetNonEmptyValue("LocationServicesClient:Username"), - // configuration.GetNonEmptyValue("LocationServicesClient:Password")); + client.DefaultRequestHeaders.Authorization = new BasicAuthenticationHeaderValue( + configuration.GetNonEmptyValue("LocationServicesClient:Username"), + configuration.GetNonEmptyValue("LocationServicesClient:Password")); client.BaseAddress = new Uri(configuration.GetNonEmptyValue("LocationServicesClient:Url").EnsureEndingForwardSlash()); - client.DefaultRequestHeaders.Add(X_APIGW_KEY_HEADER, apigwKey); - client.DefaultRequestHeaders.Add(X_ORIGIN_VERIFY_HEADER, authorizerKey); + // client.DefaultRequestHeaders.Add(X_APIGW_KEY_HEADER, apigwKey); + // client.DefaultRequestHeaders.Add(X_ORIGIN_VERIFY_HEADER, authorizerKey); }).AddHttpMessageHandler(); services.AddHttpClient(client => diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 889c6bb0..afbdb463 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -1,6 +1,5 @@ version: "3.4" services: - web: image: "${COMPOSE_PROJECT_NAME}-web" environment: @@ -69,6 +68,7 @@ services: - SplunkToken=${SplunkToken} - AWS_API_GATEWAY_URL=${AWS_API_GATEWAY_URL} - AWS_API_GATEWAY_API_KEY=${AWS_API_GATEWAY_API_KEY} + - AuthorizerKey=${AuthorizerKey} ports: - 5000:5000 volumes: From b274ab72d16fae91ea796a6c73b464bcabe86cfd Mon Sep 17 00:00:00 2001 From: Ronaldo Macapobre Date: Wed, 20 Nov 2024 22:45:19 +0000 Subject: [PATCH 2/3] Comment out AWS related env vars for now --- api/Infrastructure/ServiceCollectionExtensions.cs | 4 ++-- docker/docker-compose.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/Infrastructure/ServiceCollectionExtensions.cs b/api/Infrastructure/ServiceCollectionExtensions.cs index 46733ccf..cd74d6f8 100644 --- a/api/Infrastructure/ServiceCollectionExtensions.cs +++ b/api/Infrastructure/ServiceCollectionExtensions.cs @@ -40,8 +40,8 @@ public static IServiceCollection AddMapster(this IServiceCollection services, Ac public static IServiceCollection AddHttpClientsAndScvServices(this IServiceCollection services, IConfiguration configuration) { - var apigwKey = configuration.GetNonEmptyValue("AWS_API_GATEWAY_API_KEY"); - var authorizerKey = configuration.GetNonEmptyValue("AuthorizerKey"); + // var apigwKey = configuration.GetNonEmptyValue("AWS_API_GATEWAY_API_KEY"); + // var authorizerKey = configuration.GetNonEmptyValue("AuthorizerKey"); services.AddTransient(); services.AddHttpClient(client => diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index afbdb463..4bb2c96a 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -66,9 +66,9 @@ services: - SplunkCollectorUrl=${SplunkCollectorUrl} - SplunkCollectorId=${SplunkCollectorId} - SplunkToken=${SplunkToken} - - AWS_API_GATEWAY_URL=${AWS_API_GATEWAY_URL} - - AWS_API_GATEWAY_API_KEY=${AWS_API_GATEWAY_API_KEY} - - AuthorizerKey=${AuthorizerKey} + # - AWS_API_GATEWAY_URL=${AWS_API_GATEWAY_URL} + # - AWS_API_GATEWAY_API_KEY=${AWS_API_GATEWAY_API_KEY} + # - AuthorizerKey=${AuthorizerKey} ports: - 5000:5000 volumes: From 02b40e6e315ab5b3c71b7dc10cbdf2bd806ca944 Mon Sep 17 00:00:00 2001 From: Ronaldo Macapobre Date: Wed, 20 Nov 2024 17:02:07 -0800 Subject: [PATCH 3/3] Removed commented code --- api/Infrastructure/ServiceCollectionExtensions.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/api/Infrastructure/ServiceCollectionExtensions.cs b/api/Infrastructure/ServiceCollectionExtensions.cs index cd74d6f8..ec229bf1 100644 --- a/api/Infrastructure/ServiceCollectionExtensions.cs +++ b/api/Infrastructure/ServiceCollectionExtensions.cs @@ -40,9 +40,6 @@ public static IServiceCollection AddMapster(this IServiceCollection services, Ac public static IServiceCollection AddHttpClientsAndScvServices(this IServiceCollection services, IConfiguration configuration) { - // var apigwKey = configuration.GetNonEmptyValue("AWS_API_GATEWAY_API_KEY"); - // var authorizerKey = configuration.GetNonEmptyValue("AuthorizerKey"); - services.AddTransient(); services.AddHttpClient(client => { @@ -67,8 +64,6 @@ public static IServiceCollection AddHttpClientsAndScvServices(this IServiceColle configuration.GetNonEmptyValue("LocationServicesClient:Username"), configuration.GetNonEmptyValue("LocationServicesClient:Password")); client.BaseAddress = new Uri(configuration.GetNonEmptyValue("LocationServicesClient:Url").EnsureEndingForwardSlash()); - // client.DefaultRequestHeaders.Add(X_APIGW_KEY_HEADER, apigwKey); - // client.DefaultRequestHeaders.Add(X_ORIGIN_VERIFY_HEADER, authorizerKey); }).AddHttpMessageHandler(); services.AddHttpClient(client =>