Add Name parameter to UserPasskeyInfo constructor#65815
Open
BloodShop wants to merge 2 commits intodotnet:mainfrom
Open
Add Name parameter to UserPasskeyInfo constructor#65815BloodShop wants to merge 2 commits intodotnet:mainfrom
BloodShop wants to merge 2 commits intodotnet:mainfrom
Conversation
UserPasskeyInfo exposes a Name property but the constructor doesn't accept it, forcing callers to use an object initializer to set it. Every other property is covered by the constructor, so the omission feels unintentional. This adds a new constructor overload that accepts an optional 'string? name' parameter. The existing constructor is preserved (it delegates to the new one with name: null) so there's no binary or source breaking change. Changes: - New constructor overload on UserPasskeyInfo with trailing 'name' parameter - Existing constructor chains into the new one - PublicAPI.Unshipped.txt updated - Unit tests for both constructors Fixes dotnet#65774
Contributor
|
Thanks for your PR, @@BloodShop. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Author
|
@dotnet-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UserPasskeyInfoexposes aNameproperty but the constructor doesn't accept it — it's the only property left out. Callers have to fall back to an object initializer:This adds a constructor overload so
Namecan be set inline with everything else.What changed
UserPasskeyInfogets a second constructor with an additional trailingstring? nameparameter. The original constructor delegates to it withname: null, so nothing breaks — existing call sites compile and behave exactly as before.UserPasskeyInfo.cs..., byte[] clientDataJson, string? name): this(..., name: null)PublicAPI.Unshipped.txtUserPasskeyInfoTest.cs(new file)NamenullleavesNameunsetNamenullUsage
Breaking changes
None. The existing constructor signature is untouched and remains in
PublicAPI.Shipped.txt. The new overload is additive only.Fixes #65774