Rename misleading WebAuthn4J credential options methods - #759
Open
jnbdz wants to merge 1 commit into
Open
Conversation
createCredentialsOptions and getCredentialsOptions suggest they create and return a CredentialsOptions object, while they actually create PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions respectively. Introduce createPublicKeyCredentialCreationOptions and createPublicKeyCredentialRequestOptions, keeping the old names as deprecated delegating defaults since 5.x already shipped with them. Also fix the request options javadoc which linked to the creation options dictionary of the spec. Fixes eclipse-vertx#698
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.
As reported in #698,
createCredentialsOptionsandgetCredentialsOptionsread as if they create and return aCredentialsOptionsobject, while they actually createPublicKeyCredentialCreationOptions(fornavigator.credentials.create()) andPublicKeyCredentialRequestOptions(fornavigator.credentials.get()).This introduces
createPublicKeyCredentialCreationOptionsandcreatePublicKeyCredentialRequestOptionsas the primary methods, and turns the old names into@Deprecateddefault methods that delegate — the issue proposed a hard rename while the module was pre-release, but 5.x has since shipped with the old names (andWebAuthn4JHandlerin vertx-web calls them), so a deprecation cycle seemed safer. If a hard break is preferred for the next major, the old defaults are trivial to drop.Naming note: the issue suggested
createPublicKeyCredentialGetOptionsfor the second method; this PR usesRequestOptionsto match the spec dictionary name (PublicKeyCredentialRequestOptions) and WebAuthn4J's own class name — happy to adjust if the original suggestion is preferred.Also fixes the javadoc of the request options method, which linked to the creation options dictionary of the spec, and updates docs/examples to the new names. Tests cover both the new names and the deprecated delegating aliases.
Fixes #698