diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35a59be4..c8b3c733 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,9 +10,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 3.1.101 + dotnet-version: 8.0.403 - name: Install dependencies run: dotnet restore - name: Build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d5b9358..09ba23d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 3.1.101 + dotnet-version: 8.0.403 - name: Install dependencies run: dotnet restore - name: Build @@ -24,6 +24,10 @@ jobs: run: echo "ASSEMBLY_VERSION=$(echo ${GITHUB_REF:10} | cut -d '.' -f 1).0.0" >> $GITHUB_ENV - name: Print assembly version run: echo $ASSEMBLY_VERSION + - name: Sed InformationalVersion number for build purposes + run: sed -i -e "s|0.0.0.0<\/Version>|$RELEASE_VERSION<\/Version>|g" Directory.Build.props + - name: Sed AssemblyVersion number for build purposes + run: sed -i -e "s|0.0.0.0<\/AssemblyVersion>>|$RELEASE_VERSION<\/AssemblyVersion>>|g" Directory.Build.props - name: Pack nupkg run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Core - name: Pack nupkg diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9fad1f7..2852b0fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,13 +10,15 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 3.1.101 + dotnet-version: 8.0.403 - name: Install dependencies run: dotnet restore - name: Decode certificate run: echo -n $(echo ${{ secrets.ENCODED_SMOKE_TEST_CERTIFICATE }}) | base64 -d > $(echo ${GITHUB_WORKSPACE})/Bring_Digital_Signature_Key_Encipherment_Data_Encipherment.p12 + - name: checksum p12 (for debug-purposes) + run: sha256sum $(echo ${GITHUB_WORKSPACE})/Bring_Digital_Signature_Key_Encipherment_Data_Encipherment.p12 - name: Set certificate path run: dotnet user-secrets set Certificate:Path:Absolute $(echo ${GITHUB_WORKSPACE})/Bring_Digital_Signature_Key_Encipherment_Data_Encipherment.p12 --project Digipost.Signature.Api.Client.Core - name: Set certificate password diff --git a/Digipost.Signature.Api.Client.Archive.Tests/Digipost.Signature.Api.Client.Archive.Tests.csproj b/Digipost.Signature.Api.Client.Archive.Tests/Digipost.Signature.Api.Client.Archive.Tests.csproj index 318a5006..fec9265c 100644 --- a/Digipost.Signature.Api.Client.Archive.Tests/Digipost.Signature.Api.Client.Archive.Tests.csproj +++ b/Digipost.Signature.Api.Client.Archive.Tests/Digipost.Signature.Api.Client.Archive.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net8.0 false diff --git a/Digipost.Signature.Api.Client.Core.Tests/BaseClientTests.cs b/Digipost.Signature.Api.Client.Core.Tests/BaseClientTests.cs index bc80f9e2..02ade2af 100644 --- a/Digipost.Signature.Api.Client.Core.Tests/BaseClientTests.cs +++ b/Digipost.Signature.Api.Client.Core.Tests/BaseClientTests.cs @@ -53,7 +53,10 @@ public void Returns_client_client_configuration_sender_if_only_set() { //Arrange var expected = new Sender(BringPublicOrganizationNumber); - var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), expected); + var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), expected) + { + CertificateValidationPreferences = {ValidateSenderCertificate = false} + }; var client = new ClientStub(clientConfiguration); //Act @@ -69,7 +72,10 @@ public void Returns_job_sender_if_both_set() //Arrange var expected = new Sender(BringPublicOrganizationNumber); var clientConfigurationSender = new Sender(PostenOrganizationNumber); - var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), clientConfigurationSender); + var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), clientConfigurationSender) + { + CertificateValidationPreferences = {ValidateSenderCertificate = false} + }; var client = new ClientStub(clientConfiguration); //Act @@ -84,7 +90,10 @@ public void Returns_job_sender_if_only_set() { //Arrange var expected = new Sender(BringPublicOrganizationNumber); - var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate()); + var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate()) + { + CertificateValidationPreferences = {ValidateSenderCertificate = false} + }; var client = new ClientStub(clientConfiguration); //Act diff --git a/Digipost.Signature.Api.Client.Core.Tests/Digipost.Signature.Api.Client.Core.Tests.csproj b/Digipost.Signature.Api.Client.Core.Tests/Digipost.Signature.Api.Client.Core.Tests.csproj index 510919f1..47a1ca73 100644 --- a/Digipost.Signature.Api.Client.Core.Tests/Digipost.Signature.Api.Client.Core.Tests.csproj +++ b/Digipost.Signature.Api.Client.Core.Tests/Digipost.Signature.Api.Client.Core.Tests.csproj @@ -23,7 +23,7 @@ - netcoreapp3.1 + net8.0 false diff --git a/Digipost.Signature.Api.Client.Core.Tests/Utilities/CoreDomainUtility.cs b/Digipost.Signature.Api.Client.Core.Tests/Utilities/CoreDomainUtility.cs index 9b678350..1ff05734 100644 --- a/Digipost.Signature.Api.Client.Core.Tests/Utilities/CoreDomainUtility.cs +++ b/Digipost.Signature.Api.Client.Core.Tests/Utilities/CoreDomainUtility.cs @@ -28,7 +28,10 @@ public static class CoreDomainUtility public static ClientConfiguration GetClientConfiguration() { - return new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), GetSender()); + return new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), GetSender()) + { + CertificateValidationPreferences = {ValidateSenderCertificate = false} + }; } public static Document GetDocument() diff --git a/Digipost.Signature.Api.Client.Direct.Tests/Digipost.Signature.Api.Client.Direct.Tests.csproj b/Digipost.Signature.Api.Client.Direct.Tests/Digipost.Signature.Api.Client.Direct.Tests.csproj index 747111eb..6f91e797 100644 --- a/Digipost.Signature.Api.Client.Direct.Tests/Digipost.Signature.Api.Client.Direct.Tests.csproj +++ b/Digipost.Signature.Api.Client.Direct.Tests/Digipost.Signature.Api.Client.Direct.Tests.csproj @@ -20,7 +20,7 @@ - netcoreapp3.1 + net8.0 false diff --git a/Digipost.Signature.Api.Client.Direct.Tests/Smoke/DirectClientSmokeTests.cs b/Digipost.Signature.Api.Client.Direct.Tests/Smoke/DirectClientSmokeTests.cs index 72908d6b..8e092b3a 100644 --- a/Digipost.Signature.Api.Client.Direct.Tests/Smoke/DirectClientSmokeTests.cs +++ b/Digipost.Signature.Api.Client.Direct.Tests/Smoke/DirectClientSmokeTests.cs @@ -28,7 +28,8 @@ private static DirectClient DirectClient(Environment environment) var clientConfig = new ClientConfiguration(environment, GetBringCertificate(), new Sender(BringPublicOrganizationNumber)) { - LogRequestAndResponse = true + LogRequestAndResponse = true, + CertificateValidationPreferences = {ValidateSenderCertificate = false} }; var client = new DirectClient(clientConfig, serviceProvider.GetService()); diff --git a/Digipost.Signature.Api.Client.Portal.Tests/Digipost.Signature.Api.Client.Portal.Tests.csproj b/Digipost.Signature.Api.Client.Portal.Tests/Digipost.Signature.Api.Client.Portal.Tests.csproj index a98d5b61..318942bb 100644 --- a/Digipost.Signature.Api.Client.Portal.Tests/Digipost.Signature.Api.Client.Portal.Tests.csproj +++ b/Digipost.Signature.Api.Client.Portal.Tests/Digipost.Signature.Api.Client.Portal.Tests.csproj @@ -22,7 +22,7 @@ - netcoreapp3.1 + net8.0 false diff --git a/Digipost.Signature.Api.Client.Portal.Tests/PortalClientTests.cs b/Digipost.Signature.Api.Client.Portal.Tests/PortalClientTests.cs index b9eaa0e0..04e5d8ab 100644 --- a/Digipost.Signature.Api.Client.Portal.Tests/PortalClientTests.cs +++ b/Digipost.Signature.Api.Client.Portal.Tests/PortalClientTests.cs @@ -60,7 +60,10 @@ public async Task Can_be_called_without_sender_uses_sender_in_client_configurati { //Arrange var sender = new Sender(BringPublicOrganizationNumber); - var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), sender); + var clientConfiguration = new ClientConfiguration(Environment.DifiQa, GetBringCertificate(), sender) + { + CertificateValidationPreferences = {ValidateSenderCertificate = false} + }; var fakeHttpClientHandlerChecksCorrectSender = new FakeHttpClientHandlerChecksCorrectSenderResponse(); var portalClient = new PortalClient(clientConfiguration) { diff --git a/Digipost.Signature.Api.Client.Portal.Tests/Smoke/PortalClientSmokeTests.cs b/Digipost.Signature.Api.Client.Portal.Tests/Smoke/PortalClientSmokeTests.cs index 2531a72f..6ee8681c 100644 --- a/Digipost.Signature.Api.Client.Portal.Tests/Smoke/PortalClientSmokeTests.cs +++ b/Digipost.Signature.Api.Client.Portal.Tests/Smoke/PortalClientSmokeTests.cs @@ -32,7 +32,11 @@ private static PortalClient GetPortalClient(Environment environment) { var serviceProvider = LoggingUtility.CreateServiceProviderAndSetUpLogging(); var sender = new Sender(BringPublicOrganizationNumber); - var clientConfig = new ClientConfiguration(environment, GetBringCertificate(), sender) {HttpClientTimeoutInMilliseconds = 30000, LogRequestAndResponse = true}; + var clientConfig = new ClientConfiguration(environment, GetBringCertificate(), sender) + { + HttpClientTimeoutInMilliseconds = 30000, LogRequestAndResponse = true, + CertificateValidationPreferences = {ValidateSenderCertificate = false} + }; var client = new PortalClient(clientConfig, serviceProvider.GetService()); return client; } diff --git a/Digipost.Signature.Api.Client.Program/Digipost.Signature.Api.Client.Program.csproj b/Digipost.Signature.Api.Client.Program/Digipost.Signature.Api.Client.Program.csproj index ef693b52..5c34a493 100644 --- a/Digipost.Signature.Api.Client.Program/Digipost.Signature.Api.Client.Program.csproj +++ b/Digipost.Signature.Api.Client.Program/Digipost.Signature.Api.Client.Program.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net8.0 Exe