From b5d98699c124558b092bb74e32f14657bd573d1a Mon Sep 17 00:00:00 2001 From: Pc Date: Tue, 21 Feb 2023 23:20:41 +0330 Subject: [PATCH] chore: Update kubernetes configs --- deployments/k8s/flight.yml | 22 +++++++++++----------- deployments/k8s/identity.yml | 6 +++--- src/BuildingBlocks/Jwt/JwtExtensions.cs | 3 +++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/deployments/k8s/flight.yml b/deployments/k8s/flight.yml index f5a342b..96ad74e 100644 --- a/deployments/k8s/flight.yml +++ b/deployments/k8s/flight.yml @@ -15,37 +15,37 @@ spec: app: flight spec: containers: - - image: meysamh66/booking-microservices-flight:v1.5.9 + - image: meysamh66/booking-microservices-flight:v1.6.1 name: flight ports: - containerPort: 80 env: - name: "ASPNETCORE_ENVIRONMENT" - value: "docker" + value: "docker" - name: ASPNETCORE_URLS value: "http://+" - name: "RabbitMqOptions__HostName" - value: "rabbitmq" + value: "rabbitmq" - name: "RabbitMqOptions__ExchangeName" - value: "flight" + value: "flight" - name: "RabbitMqOptions__UserName" - value: "guest" + value: "guest" - name: "RabbitMqOptions__Password" - value: "guest" + value: "guest" - name: "RabbitMqOptions__Port" value: "5672" - name: "MongoOptions__ConnectionString" - value: "mongodb://mongo:27017" + value: "mongodb://mongo:27017" - name: "MongoOptions__DatabaseName" value: "flight-db" - name: "Jwt__Authority" - value: "http://127.0.0.1:13872" + value: "http://127.0.0.1:2521" - name: "Jwt__Audience" value: "flight-api" - name: "Jwt__RequireHttpsMetadata" - value: "false" + value: "false" # - name: "HealthOptions__Enabled" - # value: "true" + # value: "true" volumeMounts: - name: appsettings-volume mountPath: /app/Settings @@ -67,4 +67,4 @@ spec: port: 80 # targetPort: 80 nodePort: 30444 - type: NodePort \ No newline at end of file + type: NodePort diff --git a/deployments/k8s/identity.yml b/deployments/k8s/identity.yml index ad6a293..4abab07 100644 --- a/deployments/k8s/identity.yml +++ b/deployments/k8s/identity.yml @@ -15,7 +15,7 @@ spec: app: identity spec: containers: - - image: meysamh66/booking-microservices-identity:v1.5.9 + - image: meysamh66/booking-microservices-identity:v1.6.1 name: identity ports: - containerPort: 80 @@ -23,7 +23,7 @@ spec: - name: "ASPNETCORE_ENVIRONMENT" value: "docker" - name: ASPNETCORE_URLS - value: http://+:80 + value: http://+:80 volumeMounts: - name: appsettings-volume mountPath: /app/Settings @@ -45,4 +45,4 @@ spec: port: 80 targetPort: 80 nodePort: 30443 - type: NodePort \ No newline at end of file + type: NodePort diff --git a/src/BuildingBlocks/Jwt/JwtExtensions.cs b/src/BuildingBlocks/Jwt/JwtExtensions.cs index d92a23a..627f55b 100644 --- a/src/BuildingBlocks/Jwt/JwtExtensions.cs +++ b/src/BuildingBlocks/Jwt/JwtExtensions.cs @@ -5,6 +5,8 @@ using Microsoft.Extensions.DependencyInjection; namespace BuildingBlocks.Jwt; +using Microsoft.IdentityModel.Protocols.OpenIdConnect; + public static class JwtExtensions { public static IServiceCollection AddJwt(this IServiceCollection services) @@ -17,6 +19,7 @@ public static class JwtExtensions options.Authority = jwtOptions.Authority; options.TokenValidationParameters.ValidateAudience = false; options.RequireHttpsMetadata = jwtOptions.RequireHttpsMetadata; + options.Configuration = new OpenIdConnectConfiguration(); }); if (!string.IsNullOrEmpty(jwtOptions.Audience))