Skip to content

Rename misleading WebAuthn4J credential options methods - #759

Open
jnbdz wants to merge 1 commit into
eclipse-vertx:masterfrom
SiteNetSoft:issue-698-webauthn4j-method-names
Open

Rename misleading WebAuthn4J credential options methods#759
jnbdz wants to merge 1 commit into
eclipse-vertx:masterfrom
SiteNetSoft:issue-698-webauthn4j-method-names

Conversation

@jnbdz

@jnbdz jnbdz commented Aug 12, 2026

Copy link
Copy Markdown

As reported in #698, createCredentialsOptions and getCredentialsOptions read as if they create and return a CredentialsOptions object, while they actually create PublicKeyCredentialCreationOptions (for navigator.credentials.create()) and PublicKeyCredentialRequestOptions (for navigator.credentials.get()).

This introduces createPublicKeyCredentialCreationOptions and createPublicKeyCredentialRequestOptions as the primary methods, and turns the old names into @Deprecated default 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 (and WebAuthn4JHandler in 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 createPublicKeyCredentialGetOptions for the second method; this PR uses RequestOptions to 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method names createCredentialsOptions and getCredentialsOptions are misleading

1 participant