[java-idp-plugin-webauthn] branch main updated: Fix tests because of JWEBAUTHN-22

Phil Smart philip.smart at jisc.ac.uk
Mon Sep 16 11:01:38 UTC 2024


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=aa9b8551845d8225616d7736b83f8e6129dbf63f

The following commit(s) were added to refs/heads/main by this push:
     new aa9b855  Fix tests because of JWEBAUTHN-22
aa9b855 is described below

commit aa9b8551845d8225616d7736b83f8e6129dbf63f
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Sep 16 12:01:35 2024 +0100

    Fix tests because of JWEBAUTHN-22
---
 .../idp/plugin/authn/webauthn/storage/CredentialRegistrationTest.java | 2 ++
 .../webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java  | 4 ++++
 .../idp/plugin/authn/webauthn/flow/AbstractWebAuthnFlowTest.java      | 1 +
 .../idp/plugin/authn/webauthn/impl/AbstractWebAuthnTest.java          | 1 +
 .../webauthn/impl/LookupRegisteredCredentialsFromUserHandleTest.java  | 2 ++
 .../plugin/authn/webauthn/impl/LookupRegisteredCredentialsTest.java   | 1 +
 .../webauthn/storage/impl/CredentialRegistrationSerializerTest.java   | 1 +
 .../storage/impl/IdPStorageServiceCredentialRespositoryTest.java      | 1 +
 8 files changed, 13 insertions(+)

diff --git a/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistrationTest.java b/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistrationTest.java
index 8b87609..5ec41e9 100644
--- a/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistrationTest.java
+++ b/webauthn-api/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/CredentialRegistrationTest.java
@@ -37,6 +37,7 @@ public class CredentialRegistrationTest {
     public void testCredentialRegistrationBuilder_NullIdentity() {
         CredentialRegistration.builder()
         .withUserIdentity(null)
+        .withUsername(null)
         .withTransports(new TreeSet<AuthenticatorTransport>())
         .withRegistrationTime(Instant.now())
         .withCredential(null).build();
@@ -50,6 +51,7 @@ public class CredentialRegistrationTest {
                 .displayName("person")
                 .id(ByteArray.fromBase64("OjdT61K6rono3rZCXCRnSQ=="))
                 .build())
+        .withUsername("test")
         .withTransports(new TreeSet<AuthenticatorTransport>())
         .withRegistrationTime(Instant.now())
         .withCredential(null).build();
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java
index 698a762..eb7244d 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java
@@ -184,6 +184,7 @@ public class YubicoWebauthnAuthenticationClientTest extends AbstractWebAuthnTest
         
         final CredentialRegistration reg =CredentialRegistration.builder()
                 .withUserIdentity(userIdentity)
+                .withUsername(USERNAME)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)
@@ -256,6 +257,7 @@ public class YubicoWebauthnAuthenticationClientTest extends AbstractWebAuthnTest
         
         final CredentialRegistration reg =CredentialRegistration.builder()
                 .withUserIdentity(userIdentity)
+                .withUsername(USERNAME)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)
@@ -300,6 +302,7 @@ public class YubicoWebauthnAuthenticationClientTest extends AbstractWebAuthnTest
         
         final CredentialRegistration reg =CredentialRegistration.builder()
                 .withUserIdentity(userIdentity)
+                .withUsername(USERNAME)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)
@@ -345,6 +348,7 @@ public class YubicoWebauthnAuthenticationClientTest extends AbstractWebAuthnTest
         
         final CredentialRegistration reg =CredentialRegistration.builder()
                 .withUserIdentity(userIdentity)
+                .withUsername(USERNAME)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/flow/AbstractWebAuthnFlowTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/flow/AbstractWebAuthnFlowTest.java
index d8c8705..82d8de2 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/flow/AbstractWebAuthnFlowTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/flow/AbstractWebAuthnFlowTest.java
@@ -239,6 +239,7 @@ public class AbstractWebAuthnFlowTest extends AbstractFlowTest {
          
          final var reg = CredentialRegistration.builder()
                  .withUserIdentity(user)
+                 .withUsername(username)
                  .withTransports(new TreeSet<AuthenticatorTransport>())
                  .withRegistrationTime(Instant.now())
                  .withCredential(credential)
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnTest.java
index 62a8e8f..56f3d88 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnTest.java
@@ -345,6 +345,7 @@ public abstract class AbstractWebAuthnTest {
          
          final var reg = CredentialRegistration.builder()
                  .withUserIdentity(user)
+                 .withUsername("jdoe")
                  .withTransports(new TreeSet<AuthenticatorTransport>())
                  .withRegistrationTime(Instant.now())
                  .withCredential(credential)
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandleTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandleTest.java
index fa5a767..6da699b 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandleTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandleTest.java
@@ -93,6 +93,7 @@ public class LookupRegisteredCredentialsFromUserHandleTest extends AbstractWebAu
         
         final CredentialRegistration reg =CredentialRegistration.builder()
                 .withUserIdentity(userIdentity)
+                .withUsername(USERNAME)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)
@@ -147,6 +148,7 @@ public class LookupRegisteredCredentialsFromUserHandleTest extends AbstractWebAu
         
         final CredentialRegistration reg =CredentialRegistration.builder()
                 .withUserIdentity(userIdentity)
+                .withUsername(USERNAME)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsTest.java
index be0c33b..c35a9c2 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsTest.java
@@ -90,6 +90,7 @@ public class LookupRegisteredCredentialsTest extends AbstractWebAuthnTest {
          
          reg = CredentialRegistration.builder()
                  .withUserIdentity(user)
+                 .withUsername("jdoe")
                  .withTransports(new TreeSet<AuthenticatorTransport>())
                  .withRegistrationTime(Instant.now())
                  .withCredential(credential)
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializerTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializerTest.java
index 0b46f10..9fa6b6a 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializerTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialRegistrationSerializerTest.java
@@ -79,6 +79,7 @@ public class CredentialRegistrationSerializerTest extends AbstractWebAuthnTest {
          
          reg = CredentialRegistration.builder()
                  .withUserIdentity(user)
+                 .withUsername("jdoe")
                  .withTransports(new TreeSet<AuthenticatorTransport>())
                  .withRegistrationTime(Instant.now())
                  .withCredential(credential)
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespositoryTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespositoryTest.java
index fa82eba..60d5ffb 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespositoryTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRespositoryTest.java
@@ -99,6 +99,7 @@ public class IdPStorageServiceCredentialRespositoryTest extends AbstractWebAuthn
         
         return CredentialRegistration.builder()
                 .withUserIdentity(user)
+                .withUsername(name)
                 .withTransports(new TreeSet<AuthenticatorTransport>())
                 .withRegistrationTime(Instant.now())
                 .withCredential(credential)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list