Skip to content

Commit

Permalink
Separate CredentialRepository and CredentialRepositoryV2 setters by name
Browse files Browse the repository at this point in the history
This prevents type ambiguity in the case of
`credentialRepository(null)`, for example.
  • Loading branch information
emlun committed Oct 17, 2023
1 parent c2dde38 commit 29363d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public class Step2 {
* credentialRepository} is a required parameter.
*
* @see RelyingPartyBuilder#credentialRepository(CredentialRepository)
* @see #credentialRepository(CredentialRepositoryV2)
* @see #credentialRepositoryV2(CredentialRepositoryV2)
*/
public RelyingPartyBuilder credentialRepository(CredentialRepository credentialRepository) {
return builder.credentialRepository(credentialRepository);
Expand All @@ -611,7 +611,7 @@ public RelyingPartyBuilder credentialRepository(CredentialRepository credentialR
* @see #credentialRepository(CredentialRepository)
*/
public <C extends CredentialRecord>
RelyingPartyV2.RelyingPartyV2Builder<C> credentialRepository(
RelyingPartyV2.RelyingPartyV2Builder<C> credentialRepositoryV2(
CredentialRepositoryV2<C> credentialRepository) {
return RelyingPartyV2.builder(builder.identity, credentialRepository);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ public TrustRootsResult findTrustRoots(
}
};

CredentialRepository credentialRepository = null;

RelyingParty.builder()
.identity(null)
.credentialRepository(credentialRepository)
.credentialRepository(null)
.origins(Collections.emptySet())
.appId(new AppId("https://example.com"))
.appId(Optional.of(new AppId("https://example.com")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public WebAuthnServer(
rp =
RelyingParty.builder()
.identity(rpIdentity)
.credentialRepository(this.userStorage)
.credentialRepositoryV2(this.userStorage)
.usernameRepository(this.userStorage)
.origins(origins)
.attestationConveyancePreference(Optional.of(AttestationConveyancePreference.DIRECT))
Expand Down

0 comments on commit 29363d9

Please sign in to comment.