Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2026.2.1",
"version": "2026.3.0-eap01",
"commands": [
"jb"
],
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/Steeltoe.All.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.*
9.0.*
10.0.*
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Turn off dev certificate (macOS only)
if: ${{ matrix.os == 'macos-latest' }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/component-shared-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.*
9.0.*
10.0.*
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Turn off dev certificate (macOS only)
if: ${{ inputs.OS == 'macos' }}
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.*
9.0.*
10.0.*
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Git checkout
uses: actions/checkout@v6
Expand Down Expand Up @@ -151,6 +154,12 @@ jobs:
with:
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Install code signing tool
run: dotnet tool install --global sign --prerelease

Expand Down Expand Up @@ -214,6 +223,15 @@ jobs:
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview
source-url: ${{ vars.AZURE_ARTIFACTS_FEED_URL }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install credential provider for Azure Artifacts
run: sh -c "$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)"

Expand Down Expand Up @@ -244,6 +262,12 @@ jobs:
with:
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Download signed packages
uses: actions/download-artifact@v8
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/scan-vulnerable-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.*
9.0.*
10.0.*
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Git checkout
uses: actions/checkout@v6
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/sonarcube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.*
9.0.*
10.0.*
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Install Sonar .NET Scanner
run: dotnet tool install --global dotnet-sonarscanner
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/verify-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.*
9.0.*
10.0.*
dotnet-version: 10.0.*

- name: Setup .NET 11 Preview
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.*
dotnet-quality: preview

- name: Git checkout
uses: actions/checkout@v6
Expand Down
7 changes: 3 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ This document provides essential guidelines for working with the Steeltoe codeba

## Prerequisites

- **.NET SDK 10.0** (latest patch version)
- **.NET Runtime 8.0** (latest patch version)
- **.NET Runtime 9.0** (latest patch version)
- **.NET SDK 11.0** (latest patch version)
- **ASP.NET Core Runtime 10.0** (latest patch version)

Verify your installation:
```bash
Expand All @@ -50,7 +49,7 @@ dotnet test src/Steeltoe.All.slnx --configuration Release
For detailed test procedures including environment-specific filters, test categories, and coverage collection, see [`.github/workflows/Steeltoe.All.yml`](.github/workflows/Steeltoe.All.yml).

**Important context for agents:**
- Tests run on multiple frameworks: net8.0, net9.0, and net10.0
- Tests run on multiple frameworks: net11.0 and net10.0
- Tests use xUnit trait categories: `Integration` (requires Docker services), `MemoryDumps` (generates memory dumps)
- Platform-specific test skipping uses attributes like `[FactSkippedOnPlatform]` and `[TheorySkippedOnPlatform]` instead of trait categories
- Integration tests require Docker containers to be running (e.g., Config Server, Eureka Server) and are primarily designed for Linux CI environments
Expand Down
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- .NET 11 Preview -->

<Project>
<PropertyGroup>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>

<!-- NU1608: Detected package version outside of dependency constraint (not all EF Core providers already offer compatible preview packages) -->
<NoWarn>$(NoWarn);NU1608</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net11.0' And '$(MSBuildProjectName)' != 'Steeltoe.Management.GitProperties.Build'">
<Using Include="System.Net.Http.Json" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In addition to the [feature documentation](https://steeltoe.io/api), we have bui

| Steeltoe Branch | .NET Version | Status |
| --- | --- | --- |
| main | .NET 8 - 10 | Unstable |
| main | .NET 10 - 11 | Unstable |
| 4.x | .NET 8 - 10 | Stable |
| 3.x | .NET 8 | Stable |
| 2.x | .NET Framework 4.6.1+ | Out of Support |
Expand Down
6 changes: 2 additions & 4 deletions shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
<NoWarn>$(NoWarn);IDE0051;IDE0052</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'net8.0' And '$(TargetFramework)' != 'net9.0'">
<!--
Suppress new obsolete warnings for WebHostBuilder and WebHost on .NET 10 and higher.
-->
<PropertyGroup>
<!-- Suppress obsolete warnings for WebHostBuilder and WebHost. -->
<NoWarn>$(NoWarn);ASPDEPR004;ASPDEPR008</NoWarn>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<TargetFrameworks>net11.0;net10.0</TargetFrameworks>
<Description>Automatically configure Steeltoe packages that are referenced by a project. This is not a meta package, other packages must be added separately.</Description>
<PackageTags>autoconfiguration;automatic;configuration;application;bootstrapping;starter</PackageTags>
<IsPackable>true</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net11.0;net10.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Expand All @@ -12,7 +12,7 @@
<PackageReference Include="MongoDB.Driver" Version="$(MongoDbDriverVersion)" />
<PackageReference Include="MySqlConnector" Version="$(MySqlConnectorVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="Npgsql" Version="$(EntityFrameworkCoreTestVersion)" />
<PackageReference Include="Npgsql" Version="$(EntityFrameworkCorePossiblyDowngradedTestVersion)" />
<PackageReference Include="RabbitMQ.Client" Version="$(RabbitClientTestVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net11.0;net10.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Expand Down
16 changes: 1 addition & 15 deletions src/Common/src/Certificates/ConfigureCertificateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,10 @@ public void Configure(string? name, CertificateOptions options)

private static X509Certificate2 LoadCertificate(string certificateFilePath, bool isPkcs12)
{
#if NET9_0_OR_GREATER
// LoadCertificateFromFile handles PEM and DER but not PKCS#12; .pfx/.p12 need a separate loader.
return isPkcs12
? X509CertificateLoader.LoadPkcs12FromFile(certificateFilePath, null)
: X509CertificateLoader.LoadCertificateFromFile(certificateFilePath);
#else
// This code path does not need to know if the certificate is PKCS12.
_ = isPkcs12;
return new X509Certificate2(certificateFilePath);
#endif
}

private static X509Certificate2 LoadCertificateWithKey(string certificateFilePath, string privateKeyFilePath)
Expand All @@ -91,11 +85,7 @@ private static X509Certificate2 LoadCertificateWithKey(string certificateFilePat
// See https://learn.microsoft.com/dotnet/core/extensions/sslstream-troubleshooting
using var certificate = X509Certificate2.CreateFromPemFile(certificateFilePath, privateKeyFilePath);
byte[] pkcs12Bytes = certificate.Export(X509ContentType.Pkcs12);
#if NET9_0_OR_GREATER
return X509CertificateLoader.LoadPkcs12(pkcs12Bytes, null, X509KeyStorageFlags.UserKeySet);
#else
return new X509Certificate2(pkcs12Bytes, (string?)null, X509KeyStorageFlags.UserKeySet);
#endif
}

return X509Certificate2.CreateFromPemFile(certificateFilePath, privateKeyFilePath);
Expand All @@ -106,12 +96,8 @@ private static X509Certificate2Collection LoadIssuerChainFromPkcs12(string certi
// PKCS#12 does not guarantee certificate ordering, so the leaf cannot be identified by position.
// The leaf thumbprint is used to exclude it; all other certificates are chain members.
var issuerChain = new X509Certificate2Collection();
#if NET9_0_OR_GREATER
X509Certificate2Collection fullCertificateChain = X509CertificateLoader.LoadPkcs12CollectionFromFile(certificateFilePath, null);
#else
var fullCertificateChain = new X509Certificate2Collection();
fullCertificateChain.Import(certificateFilePath);
#endif

foreach (X509Certificate2 certificate in fullCertificateChain)
{
if (certificate.Thumbprint != skipThumbprint)
Expand Down
10 changes: 1 addition & 9 deletions src/Common/src/Certificates/LocalCertificateWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static string GetAppBasePath()
{
if (AppContext.BaseDirectory.Contains($"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}", StringComparison.Ordinal))
{
// Traverse up to the project directory, if running from IDE. Strips off a sub-path like: \bin\Debug\net8.0\win-x64\
// Traverse up to the project directory, if running from IDE. Strips off a sub-path like: \bin\Debug\net10.0\win-x64\
return AppContext.BaseDirectory[..AppContext.BaseDirectory.LastIndexOf($"{Path.DirectorySeparatorChar}bin", StringComparison.Ordinal)];
}

Expand Down Expand Up @@ -69,11 +69,7 @@ public void Write(Guid orgId, Guid spaceId)
}
else
{
#if NET9_0_OR_GREATER
caCertificate = X509CertificateLoader.LoadPkcs12FromFile(RootCaSigningPfxPath, null);
#else
caCertificate = new X509Certificate2(RootCaSigningPfxPath);
#endif
}

File.WriteAllText(RootCaCrtPath, caCertificate.ExportCertificatePem());
Expand All @@ -88,11 +84,7 @@ public void Write(Guid orgId, Guid spaceId)
}
else
{
#if NET9_0_OR_GREATER
intermediateCertificate = X509CertificateLoader.LoadPkcs12FromFile(IntermediateSigningPfxPath, null);
#else
intermediateCertificate = new X509Certificate2(IntermediateSigningPfxPath);
#endif
}

File.WriteAllText(IntermediateCrtPath, intermediateCertificate.ExportCertificatePem());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<TargetFrameworks>net11.0;net10.0</TargetFrameworks>
<Description>Steeltoe shared library for working with certificates.</Description>
<PackageTags>security;pem;certificate</PackageTags>
<IsPackable>true</IsPackable>
Expand Down
18 changes: 1 addition & 17 deletions src/Common/src/Common/Extensions/MaskedUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System.Buffers;
using System.Collections.Specialized;
using System.Web;
#if NET9_0_OR_GREATER
using System.Buffers;
#endif

namespace Steeltoe.Common.Extensions;

Expand All @@ -33,11 +31,9 @@ internal readonly record struct MaskedUri
"cert"
];

#if NET9_0_OR_GREATER
private static readonly SearchValues<string> SensitiveQueryStringParameterNameSearchValues =
// Vectorized, case-insensitive multi-substring search: much faster than looping over SensitiveQueryStringParameterNameParts per parameter name.
SearchValues.Create(SensitiveQueryStringParameterNameParts, StringComparison.OrdinalIgnoreCase);
#endif

private readonly Uri? _value;

Expand Down Expand Up @@ -116,19 +112,7 @@ internal static Uri Mask(Uri source)

private static bool IsSensitiveParameterName(string parameterName)
{
#if NET9_0_OR_GREATER
return parameterName.AsSpan().ContainsAny(SensitiveQueryStringParameterNameSearchValues);
#else
foreach (string namePart in SensitiveQueryStringParameterNameParts)
{
if (parameterName.Contains(namePart, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}

return false;
#endif
}

public static implicit operator MaskedUri(Uri? uri)
Expand Down
Loading
Loading