Skip to content

feat!: target .NET 10 and update dependencies - #30

Merged
brunobritodev merged 7 commits into
masterfrom
feat/net10
Nov 18, 2026
Merged

brunobritodev merged 7 commits into
masterfrom
feat/net10

Conversation

@brunobritodev

@brunobritodev brunobritodev commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Modernizes NetDevPack.Identity for .NET 10 (LTS). .NET 8 reached end of support on 2026-11-10.

Breaking change (release 9.0.0)

  • Targets net10.0 only. Consumers on .NET 8 stay on 8.x.
  • Depends on NetDevPack.Security.Jwt 10, up from 8.2.2. The NetDevPack.Identity public API did not change.

Security

  • The library had high severity transitive advisories: System.Security.Cryptography.Xml and Pkcs 8.0.0.
  • NetDevPack.Security.Jwt 10.0.0, the version on nuget.org, still pulls System.Security.Cryptography.Xml/Pkcs 10.0.12, which also have high severity advisories.
  • Both are pinned to 10.0.15 through Central Package Management transitive pinning. The pins end up in the nuspec, so consumers get the patched versions too. Remove them after moving to NetDevPack.Security.Jwt 11 (feat!: target .NET 10 only Security.Jwt#81).

Dependencies

  • Central Package Management (Directory.Packages.props). NuGet Audit with NU1901-NU1904 as errors. Added global.json, .editorconfig and Dependabot.
  • Microsoft.* 10.0.15, System.IdentityModel.Tokens.Jwt 8.23.0.
  • Sample: Swashbuckle 7.0.0 → 10.3.1. Microsoft.OpenApi 2 changed the security requirement API, so SwaggerConfig was updated. The sample stays on NetDevPack 8.0.2 until NetDevPack 9 (feat!: target .NET 10 and update dependencies NetDevPack#65) is published.

Tests (new)

The repository had no tests. The new tests/NetDevPack.Identity.Tests project uses xunit.v3 on Microsoft.Testing.Platform, AwesomeAssertions and EF Core InMemory. It covers:

  • The access token is signed with the current JWKS key and carries typ=at+jwt plus the sub, email, role and user claims. UserResponse is filled in.
  • The user can be looked up by id, username or email.
  • Building a token without a user identifier throws.
  • One-time refresh tokens: only the latest one is accepted, and the previous one is rejected with "Refresh Token already used".
  • A malformed refresh token is rejected.

CI

  • actions/checkout@v7 and actions/setup-dotnet@v6, with the SDK taken from global.json.
  • The publish workflow did not restore, build or test before releasing. It now does all three.
  • The PR workflow checks for vulnerable packages.
  • semantic-release action v4 (semantic-release 24). Pack and push run only when a new release is published.

Package metadata

  • RepositoryUrl and PackageProjectUrl pointed to EduardoPires/NetDevPack. They now point to this repository (NetDevPack/Security.Identity).
  • Removed the duplicated Authors. The README is now packed.
  • Removed LangVersion 10.0; the repo uses latest.
  • The CopyHook target is skipped on CI.

Test plan

  • dotnet build -c Release: 0 errors. The remaining warnings already existed: obsolete SecretKey/JwtBuilder usage and the sync JsonWebTokenHandler.ValidateToken.
  • dotnet test -c Release: 5/5 passed
  • dotnet list package --vulnerable --include-transitive: no vulnerable packages
  • dotnet pack: a single net10.0 group, with README and correct repository metadata

- Target net10.0 only (drop net8.0; remove dead net7.0 conditions)
- NetDevPack.Security.Jwt.AspNetCore 8.2.2 -> 10.0.0, Microsoft.* 10.0.15,
  System.IdentityModel.Tokens.Jwt 8.23.0; pin patched
  System.Security.Cryptography.Xml/Pkcs 10.0.15 (high severity advisories)
- Central Package Management, NuGet Audit as errors, global.json, .editorconfig, dependabot
- Sample: Swashbuckle 7 -> 10.3.1 (Microsoft.OpenApi 2 security requirement API)
- Add NetDevPack.Identity.Tests (xunit.v3 + AwesomeAssertions): access token
  claims and signature, user lookup by id/username/email, one-time refresh tokens
- CI: actions/checkout v7, setup-dotnet v6; publish now restores, builds and
  tests before releasing; vulnerable package check; pack/push only on new release
- Package metadata: repository/project URL pointed to EduardoPires/NetDevPack,
  duplicated Authors, README now packed; LangVersion follows the SDK

BREAKING CHANGE: the package now targets .NET 10 only and depends on
NetDevPack.Security.Jwt 10. Stay on 8.x for .NET 8.
Same fix as #31 (8.x): signed rt+jwt tokens only, last JWKS keys or SecretKey, same issuer logic as creation, deleted users rejected, lockout check fixed (IsLockedOutAsync), async validation. Adds RefreshTokenSecurityTests.
Same JwksIntegrationTests as #31: /jwks publishes public keys only, a third party validates the access token with the published JWKS, refresh tokens are signed with the JWKS key. Test parallelization disabled (static in-memory key store).
Brings 8.0.1 and the trusted publishing workflow; the publish workflow keeps the .NET 10 version from this branch with NuGet/login added.
@brunobritodev
brunobritodev merged commit 9af62e2 into master Nov 18, 2026
2 checks passed
@brunobritodev
brunobritodev deleted the feat/net10 branch November 18, 2026 01:08
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2026
## [9.0.0](v8.0.1...v9.0.0) (2026-11-18)

### ⚠ BREAKING CHANGES

* the package now targets .NET 10 only and depends on
NetDevPack.Security.Jwt 10. Stay on 8.x for .NET 8.

* fix: point package URLs to Security.Identity

* ci: use conventionalcommits release preset

* fix: validate refresh token signature and type

### Features

* target .NET 10 and update dependencies ([#30](#30)) ([9af62e2](9af62e2)), closes [#31](#31) [#31](#31)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 9.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant