Skip to content

Commit

Permalink
updated to .net9 and fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedeler committed Jan 6, 2025
1 parent 0aca77e commit ae0dac7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .mock/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.6.8';
const PACKAGE_VERSION = '2.7.0';
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f';
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse');
const activeClientIds = new Set();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand All @@ -14,11 +14,13 @@
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.7.0" />
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Bcl.Cryptography" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public async Task<string> GetAccessToken()
_accessToken = _accessTokenGenerator.GenerateAccessToken(
_clientSettings.Issuer,
_clientSettings.App,
new X509Certificate2(Convert.FromBase64String(certBase64), (string)null, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable));
X509CertificateLoader.LoadPkcs12(Convert.FromBase64String(certBase64), (string)null, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable));

_cacheTokenUntil = DateTime.UtcNow.AddSeconds(_accessTokenSettings.TokenLifetimeInSeconds - 2); // Add some slack to avoid tokens expiring in transit

Check warning on line 64 in backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Core/Services/AccessTokenProvider.cs

View workflow job for this annotation

GitHub Actions / Continous Integration / Analyze

Remove this set, which updates a 'static' field from an instance method. (https://rules.sonarsource.com/csharp/RSPEC-2696)

Check warning on line 64 in backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Core/Services/AccessTokenProvider.cs

View workflow job for this annotation

GitHub Actions / Continous Integration / Analyze

Remove this set, which updates a 'static' field from an instance method. (https://rules.sonarsource.com/csharp/RSPEC-2696)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private async Task<ICollection<SecurityKey>> GetSigningKeys()
{
List<SecurityKey> signingKeys = new List<SecurityKey>();

X509Certificate2 cert = new X509Certificate2("selfSignedTestCertificatePublic.cer");
X509Certificate2 cert = X509CertificateLoader.LoadCertificateFromFile("selfSignedTestCertificatePublic.cer");
SecurityKey key = new X509SecurityKey(cert);

signingKeys.Add(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ private static SigningCredentials GetSigningCredentials(string issuer)
{
certPath = $"{issuer}-org.pfx";

X509Certificate2 certIssuer = new X509Certificate2(certPath);
X509Certificate2 certIssuer = X509CertificateLoader.LoadCertificateFromFile(certPath);
return new X509SigningCredentials(certIssuer, SecurityAlgorithms.RsaSha256);
}

X509Certificate2 cert = new X509Certificate2(certPath, "qwer1234");
X509Certificate2 cert = X509CertificateLoader.LoadPkcs12FromFile(certPath, "qwer1234");
return new X509SigningCredentials(cert, SecurityAlgorithms.RsaSha256);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>a673dbb3-54f1-477a-b0d6-2751f915f4fb</UserSecretsId>
Expand All @@ -26,6 +26,8 @@
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="9.0.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Altinn.AccessManagement.UI.Core\Altinn.AccessManagement.UI.Core.csproj" />
Expand Down

0 comments on commit ae0dac7

Please sign in to comment.