Skip to content

Commit 29363d9

Browse files
committed
Separate CredentialRepository and CredentialRepositoryV2 setters by name
This prevents type ambiguity in the case of `credentialRepository(null)`, for example.
1 parent c2dde38 commit 29363d9

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ public class Step2 {
598598
* credentialRepository} is a required parameter.
599599
*
600600
* @see RelyingPartyBuilder#credentialRepository(CredentialRepository)
601-
* @see #credentialRepository(CredentialRepositoryV2)
601+
* @see #credentialRepositoryV2(CredentialRepositoryV2)
602602
*/
603603
public RelyingPartyBuilder credentialRepository(CredentialRepository credentialRepository) {
604604
return builder.credentialRepository(credentialRepository);
@@ -611,7 +611,7 @@ public RelyingPartyBuilder credentialRepository(CredentialRepository credentialR
611611
* @see #credentialRepository(CredentialRepository)
612612
*/
613613
public <C extends CredentialRecord>
614-
RelyingPartyV2.RelyingPartyV2Builder<C> credentialRepository(
614+
RelyingPartyV2.RelyingPartyV2Builder<C> credentialRepositoryV2(
615615
CredentialRepositoryV2<C> credentialRepository) {
616616
return RelyingPartyV2.builder(builder.identity, credentialRepository);
617617
}

webauthn-server-core/src/test/java/com/yubico/webauthn/RelyingPartyTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ public TrustRootsResult findTrustRoots(
6464
}
6565
};
6666

67-
CredentialRepository credentialRepository = null;
68-
6967
RelyingParty.builder()
7068
.identity(null)
71-
.credentialRepository(credentialRepository)
69+
.credentialRepository(null)
7270
.origins(Collections.emptySet())
7371
.appId(new AppId("https://example.com"))
7472
.appId(Optional.of(new AppId("https://example.com")))

webauthn-server-demo/src/main/java/demo/webauthn/WebAuthnServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public WebAuthnServer(
191191
rp =
192192
RelyingParty.builder()
193193
.identity(rpIdentity)
194-
.credentialRepository(this.userStorage)
194+
.credentialRepositoryV2(this.userStorage)
195195
.usernameRepository(this.userStorage)
196196
.origins(origins)
197197
.attestationConveyancePreference(Optional.of(AttestationConveyancePreference.DIRECT))

0 commit comments

Comments
 (0)