Skip to content

Commit

Permalink
Merge pull request #79 from bcgov/fix-location-services
Browse files Browse the repository at this point in the history
Comment API Gateway related env variables
  • Loading branch information
WadeBarnes authored Nov 21, 2024
2 parents 8c09615 + 02b40e6 commit 7c6710a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions api/Infrastructure/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TimingHandler>();
services.AddHttpClient<FileServicesClient>(client =>
{
Expand All @@ -63,12 +60,10 @@ public static IServiceCollection AddHttpClientsAndScvServices(this IServiceColle

services.AddHttpClient<LocationServicesClient>(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);
}).AddHttpMessageHandler<TimingHandler>();

services.AddHttpClient<UserServiceClient>(client =>
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: "3.4"
services:

web:
image: "${COMPOSE_PROJECT_NAME}-web"
environment:
Expand Down Expand Up @@ -67,8 +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}
# - AWS_API_GATEWAY_URL=${AWS_API_GATEWAY_URL}
# - AWS_API_GATEWAY_API_KEY=${AWS_API_GATEWAY_API_KEY}
# - AuthorizerKey=${AuthorizerKey}
ports:
- 5000:5000
volumes:
Expand Down

0 comments on commit 7c6710a

Please sign in to comment.