Skip to content

Commit f2a9e2a

Browse files
committed
Add missing JavaDoc to new origins setters
1 parent c7f9ee3 commit f2a9e2a

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,65 @@ public static class RelyingPartyBuilder {
588588
Optional.empty();
589589
private @NonNull Optional<AttestationTrustSource> attestationTrustSource = Optional.empty();
590590

591+
/**
592+
* The allowed origins that returned authenticator responses will be compared against.
593+
*
594+
* <p>The default is the set containing only the string <code>
595+
* "https://" + {@link #getIdentity()}.getId()</code>.
596+
*
597+
* <p>If {@link RelyingPartyBuilder#allowOriginPort(boolean) allowOriginPort} and {@link
598+
* RelyingPartyBuilder#allowOriginSubdomain(boolean) allowOriginSubdomain} are both <code>false
599+
* </code> (the default), then a successful registration or authentication operation requires
600+
* {@link CollectedClientData#getOrigin()} to exactly equal one of these values.
601+
*
602+
* <p>If {@link RelyingPartyBuilder#allowOriginPort(boolean) allowOriginPort} is <code>true
603+
* </code> , then the above rule is relaxed to allow any port number in {@link
604+
* CollectedClientData#getOrigin()}, regardless of any port specified.
605+
*
606+
* <p>If {@link RelyingPartyBuilder#allowOriginSubdomain(boolean) allowOriginSubdomain} is
607+
* <code>true</code>, then the above rule is relaxed to allow any subdomain, of any depth, of
608+
* any of these values.
609+
*
610+
* <p>For either of the above relaxations to take effect, both the allowed origin and the client
611+
* data origin must be valid URLs. Origins that are not valid URLs are matched only by exact
612+
* string equality.
613+
*
614+
* @see #getIdentity()
615+
* @see #origins(Optional)
616+
*/
591617
public RelyingPartyBuilder origins(@NonNull Set<String> origins) {
592618
this.origins = origins;
593619
return this;
594620
}
595621

622+
/**
623+
* The allowed origins that returned authenticator responses will be compared against.
624+
*
625+
* <p>If set to empty, this setting reverts to the default value.
626+
*
627+
* <p>The default is the set containing only the string <code>
628+
* "https://" + {@link #getIdentity()}.getId()</code>.
629+
*
630+
* <p>If {@link RelyingPartyBuilder#allowOriginPort(boolean) allowOriginPort} and {@link
631+
* RelyingPartyBuilder#allowOriginSubdomain(boolean) allowOriginSubdomain} are both <code>false
632+
* </code> (the default), then a successful registration or authentication operation requires
633+
* {@link CollectedClientData#getOrigin()} to exactly equal one of these values.
634+
*
635+
* <p>If {@link RelyingPartyBuilder#allowOriginPort(boolean) allowOriginPort} is <code>true
636+
* </code> , then the above rule is relaxed to allow any port number in {@link
637+
* CollectedClientData#getOrigin()}, regardless of any port specified.
638+
*
639+
* <p>If {@link RelyingPartyBuilder#allowOriginSubdomain(boolean) allowOriginSubdomain} is
640+
* <code>true</code>, then the above rule is relaxed to allow any subdomain, of any depth, of
641+
* any of these values.
642+
*
643+
* <p>For either of the above relaxations to take effect, both the allowed origin and the client
644+
* data origin must be valid URLs. Origins that are not valid URLs are matched only by exact
645+
* string equality.
646+
*
647+
* @see #getIdentity()
648+
* @see #origins(Set)
649+
*/
596650
public RelyingPartyBuilder origins(@NonNull Optional<Set<String>> origins) {
597651
this.origins = origins.orElse(null);
598652
return this;

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,65 @@ public static class RelyingPartyV2Builder<C extends CredentialRecord> {
563563
Optional.empty();
564564
private @NonNull Optional<AttestationTrustSource> attestationTrustSource = Optional.empty();
565565

566+
/**
567+
* The allowed origins that returned authenticator responses will be compared against.
568+
*
569+
* <p>The default is the set containing only the string <code>
570+
* "https://" + {@link #getIdentity()}.getId()</code>.
571+
*
572+
* <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} and {@link
573+
* RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} are both <code>
574+
* false</code> (the default), then a successful registration or authentication operation
575+
* requires {@link CollectedClientData#getOrigin()} to exactly equal one of these values.
576+
*
577+
* <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} is <code>true
578+
* </code> , then the above rule is relaxed to allow any port number in {@link
579+
* CollectedClientData#getOrigin()}, regardless of any port specified.
580+
*
581+
* <p>If {@link RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} is
582+
* <code>true</code>, then the above rule is relaxed to allow any subdomain, of any depth, of
583+
* any of these values.
584+
*
585+
* <p>For either of the above relaxations to take effect, both the allowed origin and the client
586+
* data origin must be valid URLs. Origins that are not valid URLs are matched only by exact
587+
* string equality.
588+
*
589+
* @see #getIdentity()
590+
* @see #origins(Optional)
591+
*/
566592
public RelyingPartyV2Builder<C> origins(@NonNull Set<String> origins) {
567593
this.origins = origins;
568594
return this;
569595
}
570596

597+
/**
598+
* The allowed origins that returned authenticator responses will be compared against.
599+
*
600+
* <p>If set to empty, this setting reverts to the default value.
601+
*
602+
* <p>The default is the set containing only the string <code>
603+
* "https://" + {@link #getIdentity()}.getId()</code>.
604+
*
605+
* <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} and {@link
606+
* RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} are both <code>
607+
* false</code> (the default), then a successful registration or authentication operation
608+
* requires {@link CollectedClientData#getOrigin()} to exactly equal one of these values.
609+
*
610+
* <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} is <code>true
611+
* </code> , then the above rule is relaxed to allow any port number in {@link
612+
* CollectedClientData#getOrigin()}, regardless of any port specified.
613+
*
614+
* <p>If {@link RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} is
615+
* <code>true</code>, then the above rule is relaxed to allow any subdomain, of any depth, of
616+
* any of these values.
617+
*
618+
* <p>For either of the above relaxations to take effect, both the allowed origin and the client
619+
* data origin must be valid URLs. Origins that are not valid URLs are matched only by exact
620+
* string equality.
621+
*
622+
* @see #getIdentity()
623+
* @see #origins(Set)
624+
*/
571625
public RelyingPartyV2Builder<C> origins(@NonNull Optional<Set<String>> origins) {
572626
this.origins = origins.orElse(null);
573627
return this;

0 commit comments

Comments
 (0)