Skip to content

feat!: target .NET 10 and migrate to Fido2 4 - #5

Merged
brunobritodev merged 3 commits into
mainfrom
feat/net10
Nov 18, 2026
Merged

brunobritodev merged 3 commits into
mainfrom
feat/net10

Conversation

@brunobritodev

Copy link
Copy Markdown
Member

Summary

Moves the store to .NET 10 (LTS) and Fido2 4.3.3. .NET 8 and .NET 9 reached end of support on 2026-11-10. Fido2 4 also removes the vulnerable System.IdentityModel.Tokens.Jwt / Microsoft.IdentityModel.JsonWebTokens 6.17 (GHSA-59j7-ghrg-fj52).

Breaking changes (release 4.0.0)

  • Targets net10.0 only. Users on .NET 8/9 or Fido2 3 stay on 3.x.
  • Fido2NetLib.Development.StoredCredential no longer exists in Fido2 4. The store now has its own NetDevPack.Fido2.EntityFramework.Store.Model.StoredCredential.
    • It keeps the 3.x property names (UserId, Descriptor, PublicKey, UserHandle, SignatureCounter, CredType, RegDate, AaGuid). Most code only needs using NetDevPack.Fido2.EntityFramework.Store.Model; instead of using Fido2NetLib.Development;.
    • New IsBackupEligible / IsBackedUp properties.
    • New StoredCredential.FromRegisteredCredential(RegisteredPublicKeyCredential). It also keeps transports, which the old demo dropped.
  • IFido2Store.GetCredentialByPublicKeyIdAsync returns StoredCredential?.
  • IFido2Store.UpdateCounter(byte[] credentialId, uint counter, bool? isBackedUp = null) can also store the Backup State flag (VerifyAssertionResult.IsBackedUp). Existing source calls still compile.

Database schema (additive only)

StoredCredentialDetail gets two columns. Nothing is renamed or removed:

Column Type Existing rows
IsBackupEligible bool, not null false
IsBackedUp bool, not null false (refreshed on next login when UpdateCounter(..., result.IsBackedUp) is used)

Consumers run dotnet ef migrations add Fido2StoreV4 (the migration is AddColumn<bool>(..., defaultValue: false)). The README has the steps and the SQL Server equivalent. A test reads a row in the 3.x format to make sure it still loads: transports as enum names, no backup flags, null Type.

Library changes

  • Transports parsing accepts enum names (Usb) and WebAuthn values (usb, smart-card). It ignores unknown values instead of throwing.
  • UpdateCounter uses SaveChangesAsync.
  • InternalsVisibleTo for the test project.
  • Package metadata:
    • icon file (PackageIconUrl is deprecated) and README in the package
    • snupkg symbols, RepositoryBranch=main
    • XML docs (CS1591 suppressed)

Demo

  • Migrated to the Fido2 4 API:
    • MakeNewCredentialParams, MakeAssertionParams, RequestNewCredentialParams and GetAssertionOptionsParams.
    • ResidentKey replaces RequireResidentKey.
    • Credentials are looked up by RawId.
    • Failed assertions are handled through Fido2VerificationException.
  • Fido2 4 options no longer have status/errorMessage. The JS now checks status === "error", which only the controller's own error payload sets.
  • Removed Microsoft.VisualStudio.Web.CodeGeneration.Design, the source of vulnerable NuGet.* and System.Security.Cryptography.Pkcs 9.0.4. Microsoft.* packages updated to 10.0.15.
  • Still uses NetDevPack 8.0.2, because 9.0.0 (feat!: target .NET 10 and update dependencies NetDevPack#65) is not published yet. Bump it after that release.
  • Dockerfile: base images moved from 6.0 to 10.0. The build context is the repo root (docker build -f demo/Fido2.Passwordless/Dockerfile .). The old context could not resolve ../../src.

Build, tests, CI

  • Build setup:
    • Central Package Management.
    • NuGet Audit with NU1901-NU1904 as errors.
    • global.json with the SDK 10 + Microsoft.Testing.Platform runner.
    • .editorconfig and Dependabot.
  • New test project (xunit.v3 + AwesomeAssertions). It runs IFido2Store against SQLite in-memory, so the real SQL translation of byte[] comparisons is exercised. It covers:
    • store/get
    • missing credential
    • counter and backup state updates
    • listing by user, user id, user handle and credential id
    • removal
    • reading 3.x rows
  • Workflows:
    • actions/checkout@v7 and actions/setup-dotnet@v6, with the SDK taken from global.json.
    • Release build and tests. The publish workflow did not run tests before.
    • The PR workflow checks for vulnerable packages.
    • semantic-release 24. Pack and push run only when a new release is published, with --skip-duplicate and symbols pushed.
  • CopyHook resolves paths from the project directory and is skipped on CI.

Test plan

  • dotnet build -c Release: 0 errors. Warnings are the existing nullable annotations in the demo and in StoredCredentialDetail.
  • dotnet test: 7/7 passed
  • dotnet list package --vulnerable --include-transitive: no vulnerable packages (library, demo and tests)
  • dotnet pack: single net10.0 group (Fido2 4.3.3, Microsoft.EntityFrameworkCore 10.0.15), icon and README included
  • Manual WebAuthn run of the demo with a real authenticator (passwordless and usernameless). Not run in CI.

- Target net10.0 only (library and demo); drop net8.0/net9.0 (end of support 2026-11-10)
- Fido2 / Fido2.AspNet 3.0.1 -> 4.3.3; removes vulnerable System.IdentityModel.Tokens.Jwt 6.17 (GHSA-59j7-ghrg-fj52)
- New StoredCredential model (Fido2 4 no longer ships Fido2NetLib.Development.StoredCredential), same property names as 3.x,
  plus IsBackupEligible/IsBackedUp and StoredCredential.FromRegisteredCredential(RegisteredPublicKeyCredential)
- StoredCredentialDetail: new IsBackupEligible and IsBackedUp columns (additive, default false)
- IFido2Store.UpdateCounter accepts the Backup State flag; GetCredentialByPublicKeyIdAsync returns StoredCredential?
- Transports parsing accepts enum names and WebAuthn values and ignores unknown values
- Demo: Fido2 4 *Params API, assertion failures via Fido2VerificationException, error payload for the JS client,
  remove Microsoft.VisualStudio.Web.CodeGeneration.Design (vulnerable NuGet.* / Pkcs), Microsoft.* 10.0.15,
  Docker build context is the repository root
- Central Package Management, NuGet Audit as errors, global.json (Microsoft.Testing.Platform), .editorconfig, dependabot
- Tests: new xunit.v3 + AwesomeAssertions project running the store on SQLite in-memory
- CI: actions/checkout v7, setup-dotnet v6, Release build/test, vulnerable package check, semantic-release 24,
  pack/push only on release, symbols pushed, package icon and README
- CopyHook resolves paths from the project directory and is skipped on CI

BREAKING CHANGE: targets .NET 10 and Fido2 4 only. Fido2NetLib.Development.StoredCredential was replaced by
NetDevPack.Fido2.EntityFramework.Store.Model.StoredCredential. IFido2Store.UpdateCounter has a new optional
isBackedUp parameter and GetCredentialByPublicKeyIdAsync returns a nullable value. The StoredCredentialDetail
table gets two new non-nullable bool columns (IsBackupEligible, IsBackedUp) with default false: add an EF Core
migration; no existing column is renamed or removed.
nuget.org API keys expire and the org key already did, which made the
last releases fail with 403. Publish with NuGet/login (OIDC) instead:
the job gets a short-lived key from the trusted publishing policy for
this repository and workflow file.

Also adds a workflow_dispatch input to publish an existing release tag
again, since re-running the job skips the push once the release exists.
@brunobritodev

Copy link
Copy Markdown
Member Author

Added NuGet trusted publishing (OIDC) to the publish workflow, since the org API key expired. Same change as NetDevPack/NetDevPack#71: NuGet/login@v1 + id-token: write, plus a workflow_dispatch input to publish an existing release tag again.

@brunobritodev
brunobritodev merged commit d920813 into main Nov 18, 2026
1 check passed
@brunobritodev
brunobritodev deleted the feat/net10 branch November 18, 2026 02:10
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2026
## [4.0.0](v3.0.0...v4.0.0) (2026-11-18)

### ⚠ BREAKING CHANGES

* targets .NET 10 and Fido2 4 only. Fido2NetLib.Development.StoredCredential was replaced by
NetDevPack.Fido2.EntityFramework.Store.Model.StoredCredential. IFido2Store.UpdateCounter has a new optional
isBackedUp parameter and GetCredentialByPublicKeyIdAsync returns a nullable value. The StoredCredentialDetail
table gets two new non-nullable bool columns (IsBackupEligible, IsBackedUp) with default false: add an EF Core
migration; no existing column is renamed or removed.

* ci: use conventionalcommits release preset

* ci: publish to NuGet with trusted publishing

nuget.org API keys expire and the org key already did, which made the
last releases fail with 403. Publish with NuGet/login (OIDC) instead:
the job gets a short-lived key from the trusted publishing policy for
this repository and workflow file.

Also adds a workflow_dispatch input to publish an existing release tag
again, since re-running the job skips the push once the release exists.

### Features

* target .NET 10 and migrate to Fido2 4 ([#5](#5)) ([d920813](d920813))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 4.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