Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment API Gateway related env variables #79

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading