Skip to content

Commit de52b06

Browse files
committed
Clarify some parameter javadocs
1 parent 6eb339a commit de52b06

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Fixes:
6464
base64url encoded.
6565
* Javadoc for `TokenBindingStatus.PRESENT` incorrectly referenced its own
6666
(private) `id` member instead of `TokenBindingInfo.id`.
67+
* Improved JavaDoc for `StartRegistrationOptions.authenticatorSelection`
68+
* Improved JavaDoc for `RelyingParty.appid`
69+
* Make the `RelyingParty.validateSignatureCounter` JavaDoc also cover the
70+
success case where stored and received signature count are both zero.
6771

6872

6973
== Version 1.10.1 ==

webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ public class RelyingParty {
143143
* The extension input to set for the <code>appid</code> extension when initiating authentication
144144
* operations.
145145
*
146+
* <p>You do not need this extension if you have not previously supported U2F. Its purpose is to
147+
* make already-registered U2F credentials forward-compatible with the WebAuthn API. It is not
148+
* needed for new registrations, even of U2F authenticators.
149+
*
150+
* <p>You do not need this extension if you have not previously supported U2F. Its purpose is to
151+
* make already-registered U2F credentials forward-compatible with the WebAuthn API. It is not
152+
* needed for new registrations, even of U2F authenticators.
153+
*
146154
* <p>If this member is set, {@link #startAssertion(StartAssertionOptions) startAssertion} will
147155
* automatically set the <code>appid</code> extension input, and {@link
148156
* #finishAssertion(FinishAssertionOptions) finishAssertion} will adjust its verification logic to
@@ -327,9 +335,9 @@ public class RelyingParty {
327335

328336
/**
329337
* If <code>true</code>, {@link #finishAssertion(FinishAssertionOptions) finishAssertion} will
330-
* fail if the {@link AuthenticatorData#getSignatureCounter() signature counter value} in the
331-
* response is not strictly greater than the {@link RegisteredCredential#getSignatureCount()
332-
* stored signature counter value}.
338+
* succeed only if the {@link AuthenticatorData#getSignatureCounter() signature counter value} in
339+
* the response is strictly greater than the {@link RegisteredCredential#getSignatureCount()
340+
* stored signature counter value}, or if both counters are exactly zero.
333341
*
334342
* <p>The default is <code>true</code>.
335343
*/
@@ -558,6 +566,14 @@ public RelyingPartyBuilder credentialRepository(CredentialRepository credentialR
558566
* The extension input to set for the <code>appid</code> extension when initiating
559567
* authentication operations.
560568
*
569+
* <p>You do not need this extension if you have not previously supported U2F. Its purpose is to
570+
* make already-registered U2F credentials forward-compatible with the WebAuthn API. It is not
571+
* needed for new registrations, even of U2F authenticators.
572+
*
573+
* <p>You do not need this extension if you have not previously supported U2F. Its purpose is to
574+
* make already-registered U2F credentials forward-compatible with the WebAuthn API. It is not
575+
* needed for new registrations, even of U2F authenticators.
576+
*
561577
* <p>If this member is set, {@link #startAssertion(StartAssertionOptions) startAssertion} will
562578
* automatically set the <code>appid</code> extension input, and {@link
563579
* #finishAssertion(FinishAssertionOptions) finishAssertion} will adjust its verification logic
@@ -579,6 +595,14 @@ public RelyingPartyBuilder appId(@NonNull Optional<AppId> appId) {
579595
* The extension input to set for the <code>appid</code> extension when initiating
580596
* authentication operations.
581597
*
598+
* <p>You do not need this extension if you have not previously supported U2F. Its purpose is to
599+
* make already-registered U2F credentials forward-compatible with the WebAuthn API. It is not
600+
* needed for new registrations, even of U2F authenticators.
601+
*
602+
* <p>You do not need this extension if you have not previously supported U2F. Its purpose is to
603+
* make already-registered U2F credentials forward-compatible with the WebAuthn API. It is not
604+
* needed for new registrations, even of U2F authenticators.
605+
*
582606
* <p>If this member is set, {@link #startAssertion(StartAssertionOptions) startAssertion} will
583607
* automatically set the <code>appid</code> extension input, and {@link
584608
* #finishAssertion(FinishAssertionOptions) finishAssertion} will adjust its verification logic

webauthn-server-core/src/main/java/com/yubico/webauthn/StartRegistrationOptions.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public class StartRegistrationOptions {
4242
@NonNull private final UserIdentity user;
4343

4444
/**
45-
* Constraints on what kind of authenticator the user is allowed to use to create the credential.
45+
* Constraints on what kind of authenticator the user is allowed to use to create the credential,
46+
* and on features that authenticator must or should support.
4647
*/
4748
private final AuthenticatorSelectionCriteria authenticatorSelection;
4849

@@ -64,7 +65,8 @@ public class StartRegistrationOptions {
6465
private final Long timeout;
6566

6667
/**
67-
* Constraints on what kind of authenticator the user is allowed to use to create the credential.
68+
* Constraints on what kind of authenticator the user is allowed to use to create the credential,
69+
* and on features that authenticator must or should support.
6870
*/
6971
public Optional<AuthenticatorSelectionCriteria> getAuthenticatorSelection() {
7072
return Optional.ofNullable(authenticatorSelection);
@@ -107,7 +109,7 @@ public StartRegistrationOptionsBuilder user(UserIdentity user) {
107109

108110
/**
109111
* Constraints on what kind of authenticator the user is allowed to use to create the
110-
* credential.
112+
* credential, and on features that authenticator must or should support.
111113
*/
112114
public StartRegistrationOptionsBuilder authenticatorSelection(
113115
@NonNull Optional<AuthenticatorSelectionCriteria> authenticatorSelection) {
@@ -116,7 +118,7 @@ public StartRegistrationOptionsBuilder authenticatorSelection(
116118

117119
/**
118120
* Constraints on what kind of authenticator the user is allowed to use to create the
119-
* credential.
121+
* credential, and on features that authenticator must or should support.
120122
*/
121123
public StartRegistrationOptionsBuilder authenticatorSelection(
122124
AuthenticatorSelectionCriteria authenticatorSelection) {

0 commit comments

Comments
 (0)