Skip to content

Commit

Permalink
Merge pull request #457 from digipost/version-number-fixing
Browse files Browse the repository at this point in the history
Version number fixing et al
  • Loading branch information
hernil authored Dec 10, 2024
2 parents 64b4aec + 2b50ea1 commit 719df0f
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
15 changes: 12 additions & 3 deletions Digipost.Signature.Api.Client.Core.Tests/BaseClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ILoggerFactory>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ILoggerFactory>());
return client;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand Down

0 comments on commit 719df0f

Please sign in to comment.