diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 644631f..af43178 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,9 +12,9 @@ updates: microsoft: patterns: ["Microsoft.*", "System.*"] tests: - patterns: ["xunit*", "Microsoft.NET.Test.Sdk", "coverlet.*", "AwesomeAssertions"] + patterns: ["xunit*", "AwesomeAssertions"] ignore: - # Microsoft.* are pinned per TFM (net8 -> 8.x, net9 -> 9.x, net10 -> 10.x); only patch bumps are safe + # Microsoft.* follow the target framework (net10 -> 10.0.x); only patch bumps are safe - dependency-name: "Microsoft.*" update-types: ["version-update:semver-major"] - dependency-name: "System.Security.Cryptography.Xml" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a32d2f0..b559cc3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,18 +26,15 @@ jobs: working-directory: src steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 0 ref: ${{ inputs.version && format('v{0}', inputs.version) || github.sha }} - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v6 with: - dotnet-version: | - 8.0.x - 9.0.x - 10.0.x + global-json-file: global.json - name: Restore dependencies run: dotnet restore @@ -57,6 +54,7 @@ jobs: extra_plugins: | @semantic-release/changelog@6 @semantic-release/git@10 + conventional-changelog-conventionalcommits@8 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2446fe1..986593b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,17 +15,14 @@ jobs: working-directory: src steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v6 with: - dotnet-version: | - 8.0.x - 9.0.x - 10.0.x + global-json-file: global.json - name: Restore dependencies run: dotnet restore diff --git a/.releaserc b/.releaserc index 9c6b271..dcf3033 100644 --- a/.releaserc +++ b/.releaserc @@ -1,17 +1,28 @@ { - "branches": ["master"], - - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", - [ - "@semantic-release/github", - { - "successComment": false, - "failTitle": false - } - ], - "@semantic-release/git" - ] + "branches": [ + "master" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + "@semantic-release/changelog", + [ + "@semantic-release/github", + { + "successComment": false, + "failTitle": false + } + ], + "@semantic-release/git" + ] } diff --git a/AGENTS.md b/AGENTS.md index c470a8f..e25bd58 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,18 +1,18 @@ # NetDevPack.Security.Jwt -.NET library (NuGet) that generates, rotates, stores and publishes (JWKS) JWT signing/encryption keys. Targets net8.0/net9.0/net10.0. +.NET library (NuGet) that generates, rotates, stores and publishes (JWKS) JWT signing/encryption keys. Targets net10.0. **Knowledge base:** `docs/` is an Obsidian vault. Start at `docs/00-Index.md`, then read `docs/Workflows/Agent-Playbook.md` before making changes. ## Commands (run from `src/`) ```bash dotnet restore && dotnet build -c Release -dotnet test -c Release # add -f net10.0 for a single TFM +dotnet test -c Release dotnet list NetDevPack.Security.Jwt.sln package --vulnerable --include-transitive ``` ## Rules -- Package versions only in `Directory.Packages.props` (Central Package Management). Never add `Version=` to a csproj. Microsoft.* packages are versioned per TFM (8.0.x / 9.0.x / 10.0.x). See `docs/Dependencies/Policy.md`. +- Package versions only in `Directory.Packages.props` (Central Package Management). Never add `Version=` to a csproj. Microsoft.* packages follow the TFM (10.0.x). See `docs/Dependencies/Policy.md`. - NuGet Audit warnings NU1901-NU1904 are build errors. IdentityServer4 is the only deliberate exception (deprecated, ADR-002). - Commits: Conventional Commits (no local hook enforces it; semantic-release reads the messages). Use `chore(deps)` for dependency bumps. Breaking change = `feat!:` + `BREAKING CHANGE:` footer. semantic-release owns `CHANGELOG.md` and versions. - Public API in `src/` is a NuGet contract. Treat changes to it as breaking. diff --git a/CLAUDE.md b/CLAUDE.md index c470a8f..e25bd58 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,18 +1,18 @@ # NetDevPack.Security.Jwt -.NET library (NuGet) that generates, rotates, stores and publishes (JWKS) JWT signing/encryption keys. Targets net8.0/net9.0/net10.0. +.NET library (NuGet) that generates, rotates, stores and publishes (JWKS) JWT signing/encryption keys. Targets net10.0. **Knowledge base:** `docs/` is an Obsidian vault. Start at `docs/00-Index.md`, then read `docs/Workflows/Agent-Playbook.md` before making changes. ## Commands (run from `src/`) ```bash dotnet restore && dotnet build -c Release -dotnet test -c Release # add -f net10.0 for a single TFM +dotnet test -c Release dotnet list NetDevPack.Security.Jwt.sln package --vulnerable --include-transitive ``` ## Rules -- Package versions only in `Directory.Packages.props` (Central Package Management). Never add `Version=` to a csproj. Microsoft.* packages are versioned per TFM (8.0.x / 9.0.x / 10.0.x). See `docs/Dependencies/Policy.md`. +- Package versions only in `Directory.Packages.props` (Central Package Management). Never add `Version=` to a csproj. Microsoft.* packages follow the TFM (10.0.x). See `docs/Dependencies/Policy.md`. - NuGet Audit warnings NU1901-NU1904 are build errors. IdentityServer4 is the only deliberate exception (deprecated, ADR-002). - Commits: Conventional Commits (no local hook enforces it; semantic-release reads the messages). Use `chore(deps)` for dependency bumps. Breaking change = `feat!:` + `BREAKING CHANGE:` footer. semantic-release owns `CHANGELOG.md` and versions. - Public API in `src/` is a NuGet contract. Treat changes to it as breaking. diff --git a/Directory.Packages.props b/Directory.Packages.props index a99f97e..38c4abc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@  @@ -10,7 +10,6 @@ true - @@ -23,53 +22,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + diff --git a/README.md b/README.md index 58d986a..d8ecefb 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,16 @@ It generates keys with RSA and ECDsa algorithms, which are the most recommended ### Supported frameworks -All packages target **.NET 8, .NET 9 and .NET 10**. +All packages target **.NET 10** (LTS). +| Version | Target frameworks | +| ------- | ----------------- | +| 11.x | .NET 10 | +| 10.x | .NET 8, .NET 9, .NET 10 | +| 9.x | .NET Standard 2.1, .NET 8, .NET 9, .NET 10 | + +> **Breaking change in v11:** .NET 8 and .NET 9 are out of support since 2026-11-10 and are no longer targeted. If you need them, stay on v10.x. +> > **Breaking change in v10:** `netstandard2.1` is no longer supported (it pulled EF Core 3.1, which is out of support). If you need it, stay on v9.x. ## Token Validation diff --git a/docs/00-Index.md b/docs/00-Index.md index 84c25c2..ca0ff27 100644 --- a/docs/00-Index.md +++ b/docs/00-Index.md @@ -1,6 +1,6 @@ --- tags: [moc, index] -updated: 2026-10-01 +updated: 2026-11-17 --- # NetDevPack.Security.Jwt — Knowledge Base @@ -21,7 +21,7 @@ Open the `docs/` folder as an Obsidian vault, or just read the Markdown on GitHu - [[Samples]] ## Dependencies -- [[Policy]]: Central Package Management, per-TFM versions, how to update +- [[Policy]]: Central Package Management, .NET package versions, how to update - [[Known-Issues]]: tech debt and pending migrations ## Decisions (ADRs) @@ -29,3 +29,4 @@ Open the `docs/` folder as an Obsidian vault, or just read the Markdown on GitHu - [[ADR-002-identityserver4-deprecated]] - [[ADR-003-central-package-management]] - [[ADR-004-remove-legacy-asymmetric-sample]] +- [[ADR-005-net10-only]] diff --git a/docs/Architecture/Overview.md b/docs/Architecture/Overview.md index 21d8f50..dc615ba 100644 --- a/docs/Architecture/Overview.md +++ b/docs/Architecture/Overview.md @@ -1,12 +1,12 @@ --- tags: [architecture] -updated: 2026-10-01 +updated: 2026-11-17 --- # Overview Library that **generates, stores, rotates and publishes** the keys used to sign (JWS) and encrypt (JWE) JWTs, so apps don't hardcode symmetric secrets. See [[Key-Lifecycle]]. -## Packages (all `net8.0;net9.0;net10.0`) +## Packages (all `net10.0`, see [[ADR-005-net10-only]]) | Project (`src/`) | NuGet id | Role | | --- | --- | --- | diff --git a/docs/Decisions/ADR-005-net10-only.md b/docs/Decisions/ADR-005-net10-only.md new file mode 100644 index 0000000..bae446a --- /dev/null +++ b/docs/Decisions/ADR-005-net10-only.md @@ -0,0 +1,17 @@ +--- +tags: [adr] +status: accepted +date: 2026-11-17 +--- +# ADR-005 — Target net10.0 only + +**Context.** .NET 8 (LTS) and .NET 9 (STS) reached end of support on 2026-11-10. They no longer get servicing updates, so a new advisory on an `8.0.x`/`9.0.x` package could never be fixed. Because NuGet Audit fails the build ([[Policy]]), that would block every release. Keeping them also meant three versions of each `Microsoft.*` package in `Directory.Packages.props` and three test runs in CI. + +**Decision.** All packages, tests and samples target `net10.0` (current LTS, supported until 2028-11). `Directory.Packages.props` has a single version line for packages that ship with .NET (`10.0.x`). The same move was applied to all NetDevPack repos in this round. + +**Consequences.** +- Breaking change, shipped as **v11.0.0**. Consumers on .NET 8/9 stay on v10.x. +- CI installs only the SDK from `global.json`. Tests run once. +- Tests moved to `xunit.v3` on Microsoft.Testing.Platform. `global.json` opts in with `"test": { "runner": "Microsoft.Testing.Platform" }`, and `Microsoft.NET.Test.Sdk`, `xunit.runner.visualstudio` and `coverlet.collector` were removed. + +Related: [[ADR-001-drop-netstandard21]], [[Known-Issues]]. diff --git a/docs/Dependencies/Known-Issues.md b/docs/Dependencies/Known-Issues.md index 8977ca1..91d4e51 100644 --- a/docs/Dependencies/Known-Issues.md +++ b/docs/Dependencies/Known-Issues.md @@ -1,26 +1,25 @@ --- tags: [dependencies, tech-debt] -updated: 2026-10-01 +updated: 2026-11-17 --- # Known Issues / Tech Debt ## Dependencies - **IdentityServer4 4.1.2**: EOL, moderate vulnerabilities (GHSA-55p7-v223-x366, GHSA-ff4q-64jc-gx98). `NU1902` is suppressed only in `NetDevPack.Security.Jwt.IdentityServer4` and `samples/3_IdentityServer4`. See [[ADR-002-identityserver4-deprecated]]. -- **xunit v2** (2.9.3) is still in use. v3 (`xunit.v3`) is a separate migration: new package, `OutputType=Exe`, API changes. `xunit.runner.visualstudio` 3.x already supports both. -- `Microsoft.NET.Test.Sdk` 18.x. ## Code - `JwtServiceValidationHandler` extends the legacy `JwtSecurityTokenHandler` and blocks on `Task.WaitAll(jwtService.GetLastKeys())`. Better: a `JsonWebTokenHandler` + async `IssuerSigningKeyResolver`, or set the keys in `OnMessageReceived`. - Some tests use the obsolete sync `JsonWebTokenHandler.ValidateToken` (CS0618). Migrate them to `ValidateTokenAsync`. -- Many nullable warnings (CS86xx) and missing XML docs (CS1591) on public APIs (about 700 warnings in a clean build). +- Many nullable warnings (CS86xx) and missing XML docs (CS1591) on public APIs (about 450 warnings in a clean build). - `IJsonWebKeySetService` is `[Obsolete]`. Remove it in the next major. - Model file names are swapped: `Model/Key.cs` holds `KeyMaterial`, `Model/KeyMaterial.cs` holds `CryptographicKey`. - The `DataProtectionStore` fallback exception message still mentions the old `JwtSigningCredentials` package names. ## Resolved +- 2026-11-17: dropped net8.0/net9.0 ([[ADR-005-net10-only]]). Migrated xunit 2 → **xunit.v3** on Microsoft.Testing.Platform; `Microsoft.NET.Test.Sdk`, `xunit.runner.visualstudio` and `coverlet.collector` removed. Fixed the xUnit1051 warnings in `AspNetCoreTests`. - 2026-10-01: migrated FluentAssertions 8.11 (Xceed commercial license) → **AwesomeAssertions 9.6** (Apache-2.0 fork, same API, namespace `AwesomeAssertions`). Do not reintroduce FluentAssertions. - 2026-10-01: 6 `.cs` files in UTF-16 LE (`CryptoService`, `IdentityServer4KeyStore`, `IdentityServerBuilderKeysExtensions`, `EFCoreServiceExtensions`, `ISecurityKeyContext`, `KeyMaterialMap`) were converted to UTF-8 BOM + CRLF. `.editorconfig` now enforces the encoding. ## Tests -- A flaky test in `NetDevPack.Security.Jwt.Tests` on net10 failed 1 of 4 local runs (2026-10-01). It is probably a race in a store test that shares the filesystem/DataProtection folder. Not investigated yet. +- A flaky test in `NetDevPack.Security.Jwt.Tests` on net10 failed 1 of 4 local runs on net10 (2026-10-01). It is probably a race in a store test that shares the filesystem/DataProtection folder. Not investigated yet. - The local machine may not have the .NET 8 runtime. CI installs 8/9/10. diff --git a/docs/Dependencies/Policy.md b/docs/Dependencies/Policy.md index cd63c9f..68f4e9d 100644 --- a/docs/Dependencies/Policy.md +++ b/docs/Dependencies/Policy.md @@ -1,12 +1,12 @@ --- tags: [dependencies, policy] -updated: 2026-10-01 +updated: 2026-11-17 --- # Dependency Policy ## Where versions live - **`Directory.Packages.props`** (repo root) — Central Package Management (CPM). csproj files only have ``. **Never add `Version=` in a csproj.** -- `Microsoft.*` / `System.*` packages that ship with .NET are versioned **per TFM** (`ItemGroup Condition="'$(TargetFramework)' == 'net8.0'"`): net8 → 8.0.x, net9 → 9.0.x, net10 → 10.0.x. Never put a 10.x package in the net8 group. +- `Microsoft.*` / `System.*` packages that ship with .NET follow the target framework: net10 → **10.0.x**. Never move them to 11.x while the TFM is net10.0. - TFM-independent packages (IdentityModel, Swashbuckle, test libs) are in the unconditional group. - `CentralPackageTransitivePinningEnabled=true`: a `PackageVersion` also pins the **transitive** version. Used for `System.Security.Cryptography.Xml`, which comes in through DataProtection. It ends up as a direct dependency of the Core nuspec, so consumers get the patched version too. - `Directory.Build.props` (root): `LangVersion`, NuGet Audit (`NU1901-NU1904` = **errors**). @@ -18,17 +18,17 @@ cd src dotnet list NetDevPack.Security.Jwt.sln package --outdated dotnet list NetDevPack.Security.Jwt.sln package --vulnerable --include-transitive ``` -1. Bump only **patch** versions inside each TFM line (`8.0.x`, `9.0.x`, `10.0.x`). +1. Bump only **patch** versions of the .NET packages (`10.0.x`). 2. Bump TFM-independent packages freely, but read the release notes for majors. 3. `dotnet build -c Release` + `dotnet test -c Release` (see [[Build-Test]]). 4. Commit as `chore(deps): ...` (see [[Release]]). -Dependabot (`.github/dependabot.yml`) runs weekly and ignores majors for `Microsoft.*` and also ignores `IdentityServer4`. Dependabot handles the per-TFM groups poorly. If a PR changes the wrong TFM line, fix it by hand. +Dependabot (`.github/dependabot.yml`) runs weekly and ignores majors for `Microsoft.*` and also ignores `IdentityServer4`. ## Adding a new TFM (e.g. net11.0) -1. `src/Directory.Build.props` `TargetFrameworks` + every test/sample csproj. -2. Add a `net11.0` `ItemGroup` in `Directory.Packages.props` mirroring the others. -3. Add `11.0.x` to `actions/setup-dotnet` in both workflows. +1. `src/Directory.Build.props` `TargetFramework` → `TargetFrameworks` + every test/sample csproj. +2. Move the .NET packages in `Directory.Packages.props` into per-TFM `ItemGroup Condition="'$(TargetFramework)' == 'net10.0'"` groups (10.0.x / 11.0.x). +3. Make sure the SDK in `global.json` can build every TFM (CI reads it through `setup-dotnet` `global-json-file`). 4. Write an ADR in `Decisions/`. Snapshot of the 2026-10-01 update: [[Known-Issues]]. diff --git a/docs/Samples.md b/docs/Samples.md index f73add1..2b73ccd 100644 --- a/docs/Samples.md +++ b/docs/Samples.md @@ -1,10 +1,10 @@ --- tags: [samples] -updated: 2026-10-01 +updated: 2026-11-17 --- # Samples (`samples/`) -All samples are in `src/NetDevPack.Security.Jwt.sln`, target net8/9/10 and use project references (except `Api.Sample`). +All samples are in `src/NetDevPack.Security.Jwt.sln`, target net10.0 and use project references (except `Api.Sample`). | Sample | Shows | | --- | --- | diff --git a/docs/Workflows/Build-Test.md b/docs/Workflows/Build-Test.md index 8638bb6..297294a 100644 --- a/docs/Workflows/Build-Test.md +++ b/docs/Workflows/Build-Test.md @@ -1,24 +1,23 @@ --- tags: [workflow] -updated: 2026-10-01 +updated: 2026-11-17 --- # Build & Test -Prerequisites: .NET **10 SDK** plus the .NET 8 and 9 runtimes (tests run on every TFM). +Prerequisites: .NET **10 SDK** (pinned by `global.json`). Tests use **xunit.v3 on Microsoft.Testing.Platform** (MTP), enabled in `global.json`. ```bash cd src dotnet restore # fails on NU1901-NU1904 (vulnerabilities) dotnet build -c Release -dotnet test -c Release # all TFMs -dotnet test -c Release -f net10.0 # one TFM -dotnet test ../tests/NetDevPack.Security.Jwt.Tests -c Release -f net10.0 --filter "FullyQualifiedName~FileSystemStore" +dotnet test -c Release +dotnet test --project ../tests/NetDevPack.Security.Jwt.Tests -c Release --filter-class "*FileSystemStore*" dotnet list NetDevPack.Security.Jwt.sln package --vulnerable --include-transitive -dotnet pack -c Release -o ./out # 5 .nupkg + .snupkg, lib/net8.0|net9.0|net10.0 +dotnet pack -c Release -o ./out # 5 .nupkg + .snupkg, lib/net10.0 ``` - Solution: `src/NetDevPack.Security.Jwt.sln` (src + tests + samples). -- Test projects: `NetDevPack.Security.Jwt.Tests` (about 514 tests per TFM) and `NetDevPack.Security.Jwt.AspNetCoreTests`. -- A test can be flaky on net10, see [[Known-Issues]]. +- Test projects: `NetDevPack.Security.Jwt.Tests` (about 514 tests) and `NetDevPack.Security.Jwt.AspNetCoreTests`. +- A test can be flaky, see [[Known-Issues]]. -CI: `.github/workflows/pull-request.yml` runs restore, build, test and the vulnerability check on .NET 8/9/10. +CI: `.github/workflows/pull-request.yml` runs restore, build, test and the vulnerability check (IdentityServer4 is the only accepted advisory, see [[ADR-002-identityserver4-deprecated]]). diff --git a/docs/Workflows/Release.md b/docs/Workflows/Release.md index 283a75a..19b4d08 100644 --- a/docs/Workflows/Release.md +++ b/docs/Workflows/Release.md @@ -5,7 +5,7 @@ updated: 2026-10-01 # Release - Every push to `master` runs `.github/workflows/publish.yml`: build → test → **semantic-release** (v24, `.releaserc`) → when a release is published, `dotnet pack -p:PackageVersion=` → push to nuget.org (`NUGET_AUTH_TOKEN`). -- semantic-release computes the version from **Conventional Commits** since the last tag (`v9.0.4` → the next breaking change gives `v10.0.0`). It updates `CHANGELOG.md`, so **don't edit the changelog by hand**. +- semantic-release computes the version from **Conventional Commits** since the last tag (e.g. `v10.0.0` → the next breaking change gives `v11.0.0`). It updates `CHANGELOG.md`, so **don't edit the changelog by hand**. - `Version` in `src/Directory.Build.props` is only the local/default version. CI overrides it with `PackageVersion`. Keep it aligned with the next major. ## Commit messages diff --git a/global.json b/global.json new file mode 100644 index 0000000..1d364c6 --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "sdk": { + "version": "10.0.100", + "rollForward": "latestFeature" + }, + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/samples/1_AspNet.Default/AspNet.Default.csproj b/samples/1_AspNet.Default/AspNet.Default.csproj index 8b6c4a8..fa2571d 100644 --- a/samples/1_AspNet.Default/AspNet.Default.csproj +++ b/samples/1_AspNet.Default/AspNet.Default.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0;net10.0 + net10.0 enable false enable diff --git a/samples/2_AspNet.Store.EntityFramework/AspNet.Store.EntityFramework.csproj b/samples/2_AspNet.Store.EntityFramework/AspNet.Store.EntityFramework.csproj index cab17ae..45c45b4 100644 --- a/samples/2_AspNet.Store.EntityFramework/AspNet.Store.EntityFramework.csproj +++ b/samples/2_AspNet.Store.EntityFramework/AspNet.Store.EntityFramework.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0;net10.0 + net10.0 enable false enable diff --git a/samples/3_IdentityServer4/AspNet.IdentityServer4.csproj b/samples/3_IdentityServer4/AspNet.IdentityServer4.csproj index 5cd87bd..9b52768 100644 --- a/samples/3_IdentityServer4/AspNet.IdentityServer4.csproj +++ b/samples/3_IdentityServer4/AspNet.IdentityServer4.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0;net10.0 + net10.0 false $(NoWarn);NU1902 diff --git a/samples/Microservice.Sample/Api.Sample/Api.Sample.csproj b/samples/Microservice.Sample/Api.Sample/Api.Sample.csproj index 0bd719b..d702b03 100644 --- a/samples/Microservice.Sample/Api.Sample/Api.Sample.csproj +++ b/samples/Microservice.Sample/Api.Sample/Api.Sample.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0;net10.0 + net10.0 enable enable diff --git a/samples/Microservice.Sample/Identity/Identity.csproj b/samples/Microservice.Sample/Identity/Identity.csproj index 6ad20ad..7500ca8 100644 --- a/samples/Microservice.Sample/Identity/Identity.csproj +++ b/samples/Microservice.Sample/Identity/Identity.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0;net10.0 + net10.0 enable enable Linux diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 6e7dbe3..443ee8a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,11 +3,11 @@ - net8.0;net9.0;net10.0 + net10.0 enable enable - 10.0.0 + 11.0.0 brunobritodev NetDevPack en diff --git a/src/NetDevPack.Security.Jwt.AspNetCore/NetDevPack.Security.Jwt.AspNetCore.csproj b/src/NetDevPack.Security.Jwt.AspNetCore/NetDevPack.Security.Jwt.AspNetCore.csproj index d6da6b3..e2ed7c1 100644 --- a/src/NetDevPack.Security.Jwt.AspNetCore/NetDevPack.Security.Jwt.AspNetCore.csproj +++ b/src/NetDevPack.Security.Jwt.AspNetCore/NetDevPack.Security.Jwt.AspNetCore.csproj @@ -11,7 +11,7 @@ jwt;jwks;jwk;aspnetcore;rsa;ecdsa;hmac;oauth2;openid;key-rotation;security;cryptography v10.0.0: - - Targets net8.0, net9.0 and net10.0 + - Targets net10.0 only (net8.0/net9.0 were removed, both are out of support) - ASP.NET Core JWKS endpoint - JWK/JWKS management and rotation support - Compatible with OAuth2 / OpenID Connect diff --git a/src/NetDevPack.Security.Jwt.Core/NetDevPack.Security.Jwt.Core.csproj b/src/NetDevPack.Security.Jwt.Core/NetDevPack.Security.Jwt.Core.csproj index 9bfac08..a9900ad 100644 --- a/src/NetDevPack.Security.Jwt.Core/NetDevPack.Security.Jwt.Core.csproj +++ b/src/NetDevPack.Security.Jwt.Core/NetDevPack.Security.Jwt.Core.csproj @@ -9,7 +9,7 @@ jwt;jwk;jwks;signing-credentials;key-rotation;rsa;ecdsa;hmac;security;cryptography;dotnet v10.0.0: - - Targets net8.0, net9.0 and net10.0 (netstandard2.1 was removed) + - Targets net10.0 only (net8.0/net9.0 were removed, both are out of support) - Simplifies JWT usage by handling signing credentials and key rotation - Built-in JWK/JWKS management for publishing and consuming keys - Supports RSA, ECDSA and HMAC algorithms diff --git a/src/NetDevPack.Security.Jwt.Store.EntityFrameworkCore/NetDevPack.Security.Jwt.Store.EntityFrameworkCore.csproj b/src/NetDevPack.Security.Jwt.Store.EntityFrameworkCore/NetDevPack.Security.Jwt.Store.EntityFrameworkCore.csproj index 3acb780..2c54f46 100644 --- a/src/NetDevPack.Security.Jwt.Store.EntityFrameworkCore/NetDevPack.Security.Jwt.Store.EntityFrameworkCore.csproj +++ b/src/NetDevPack.Security.Jwt.Store.EntityFrameworkCore/NetDevPack.Security.Jwt.Store.EntityFrameworkCore.csproj @@ -10,7 +10,7 @@ jwt;jwks;jwk;efcore;entityframeworkcore;store;rsa;ecdsa;hmac;oauth2;openid;key-rotation;security;cryptography v10.0.0: - - Targets net8.0, net9.0 and net10.0 (netstandard2.1 / EF Core 3.1 was removed) + - Targets net10.0 only (net8.0/net9.0 were removed, both are out of support) - Entity Framework Core store for JWK/JWKS persistence - Supports automatic key rotation workflows diff --git a/src/NetDevPack.Security.Jwt.Store.FileSystem/NetDevPack.Security.Jwt.Store.FileSystem.csproj b/src/NetDevPack.Security.Jwt.Store.FileSystem/NetDevPack.Security.Jwt.Store.FileSystem.csproj index a7e74bc..890e125 100644 --- a/src/NetDevPack.Security.Jwt.Store.FileSystem/NetDevPack.Security.Jwt.Store.FileSystem.csproj +++ b/src/NetDevPack.Security.Jwt.Store.FileSystem/NetDevPack.Security.Jwt.Store.FileSystem.csproj @@ -10,7 +10,7 @@ jwt;jwks;jwk;filesystem;store;rsa;ecdsa;hmac;oauth2;openid;key-rotation;security;cryptography v10.0.0: - - Targets net8.0, net9.0 and net10.0 (netstandard2.1 was removed) + - Targets net10.0 only (net8.0/net9.0 were removed, both are out of support) - File system provider for JWK/JWKS persistence - Supports automatic key rotation workflows diff --git a/tests/NetDevPack.Security.Jwt.AspNetCoreTests/JwtTests.cs b/tests/NetDevPack.Security.Jwt.AspNetCoreTests/JwtTests.cs index cc7cb22..fc27ffc 100644 --- a/tests/NetDevPack.Security.Jwt.AspNetCoreTests/JwtTests.cs +++ b/tests/NetDevPack.Security.Jwt.AspNetCoreTests/JwtTests.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.JsonWebTokens; using Microsoft.IdentityModel.Tokens; @@ -36,11 +36,11 @@ public async Task Should_Validate_Jws() var jws = CreateJws(currentKey, customClaims); var client = _factory.CreateClient(); - var response = await client.GetAsync($"validate-jws/{jws}"); + var response = await client.GetAsync($"validate-jws/{jws}", TestContext.Current.CancellationToken); response.IsSuccessStatusCode.Should().BeTrue(); - var claims = await System.Text.Json.JsonSerializer.DeserializeAsync>(await response.Content.ReadAsStreamAsync()); + var claims = await System.Text.Json.JsonSerializer.DeserializeAsync>(await response.Content.ReadAsStreamAsync(TestContext.Current.CancellationToken), cancellationToken: TestContext.Current.CancellationToken); claims.Should().Contain(a => a.Key == customClaims.First().Type); } @@ -61,7 +61,7 @@ public async Task Should_Validate_Jws_With_A_Revoked_Key() var client = _factory.CreateClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://localhost/protected-endpoint"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", jws); - var response = await client.SendAsync(request); + var response = await client.SendAsync(request, TestContext.Current.CancellationToken); response.IsSuccessStatusCode.Should().BeTrue(); } diff --git a/tests/NetDevPack.Security.Jwt.AspNetCoreTests/NetDevPack.Security.Jwt.AspNetCoreTests.csproj b/tests/NetDevPack.Security.Jwt.AspNetCoreTests/NetDevPack.Security.Jwt.AspNetCoreTests.csproj index e7ece2e..d2baa74 100644 --- a/tests/NetDevPack.Security.Jwt.AspNetCoreTests/NetDevPack.Security.Jwt.AspNetCoreTests.csproj +++ b/tests/NetDevPack.Security.Jwt.AspNetCoreTests/NetDevPack.Security.Jwt.AspNetCoreTests.csproj @@ -1,7 +1,8 @@  - net8.0;net9.0;net10.0 + net10.0 + Exe enable enable @@ -12,16 +13,7 @@ - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + diff --git a/tests/NetDevPack.Security.Jwt.Tests/NetDevPack.Security.Jwt.Tests.csproj b/tests/NetDevPack.Security.Jwt.Tests/NetDevPack.Security.Jwt.Tests.csproj index aa5ac01..7388015 100644 --- a/tests/NetDevPack.Security.Jwt.Tests/NetDevPack.Security.Jwt.Tests.csproj +++ b/tests/NetDevPack.Security.Jwt.Tests/NetDevPack.Security.Jwt.Tests.csproj @@ -1,9 +1,9 @@  - net8.0;net9.0;net10.0 + net10.0 + Exe enable - 10.0 false true @@ -12,16 +12,7 @@ - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - +