diff --git a/.github/actions/docker-build-publish/action.yml b/.github/actions/docker-build-publish/action.yml index ae657be..efa20fb 100644 --- a/.github/actions/docker-build-publish/action.yml +++ b/.github/actions/docker-build-publish/action.yml @@ -38,11 +38,11 @@ runs: if: ${{ github.ref == 'refs/heads/main' && success() }} shell: bash run: | - docker build -t ${{ inputs.registry-username }}/${{ inputs.image-name }}:${{ inputs.tag-name }} -f "${{ github.workspace }}/${{ inputs.dockerfile-path }}" . + docker build -t ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.5.1 -f "${{ github.workspace }}/${{ inputs.dockerfile-path }}" . - name: Publish Docker Image if: ${{ github.ref == 'refs/heads/main' && success() }} shell: bash run: | - docker push ${{ inputs.registry-username }}/${{ inputs.image-name }}:${{ inputs.tag-name }} + docker push ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.5.1 diff --git a/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs b/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs index e447267..8c0bf6e 100644 --- a/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs +++ b/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs @@ -3,14 +3,19 @@ using Identity.Identity.Models; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; namespace Identity.Extensions.Infrastructure; +using System.Net; +using Microsoft.IdentityModel.Logging; + public static class IdentityServerExtensions { - public static IServiceCollection AddIdentityServer(this IServiceCollection services, IWebHostEnvironment env) + public static IServiceCollection AddCustomIdentityServer(this IServiceCollection services, IWebHostEnvironment env) { + IdentityModelEventSource.ShowPII = true; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + services.AddIdentity(config => { config.Password.RequiredLength = 6; diff --git a/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs b/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs index 29abf9e..6a79089 100644 --- a/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs +++ b/src/Services/Identity/src/Identity/Extensions/Infrastructure/InfrastructureExtensions.cs @@ -77,7 +77,7 @@ public static class InfrastructureExtensions SnowFlakIdGenerator.Configure(4); - builder.Services.AddIdentityServer(env); + builder.Services.AddCustomIdentityServer(env); //ref: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-7.0&viewFallbackFrom=aspnetcore-2.2 //ref: https://medium.com/@christopherlenard/identity-server-and-nginx-ingress-controller-in-kubernetes-7146c22a2466 @@ -121,16 +121,6 @@ public static class InfrastructureExtensions return next(); }); - app.Use(async (ctx, next) => - { - if (ctx.Request.Headers.ContainsKey("from-ingress")) - { - ctx.SetIdentityServerOrigin("https://myidentityserver.com"); - } - - await next(); - }); - if (env.IsDevelopment()) { app.UseCustomSwagger();