@@ -42,6 +42,8 @@ public interface CredentialRepository {
42
42
*
43
43
* <p>After a successful registration ceremony, the {@link RegistrationResult#getKeyId()} method
44
44
* returns a value suitable for inclusion in this set.
45
+ *
46
+ * <p>Implementations of this method MUST NOT return null.
45
47
*/
46
48
Set <PublicKeyCredentialDescriptor > getCredentialIdsForUsername (String username );
47
49
@@ -51,6 +53,8 @@ public interface CredentialRepository {
51
53
*
52
54
* <p>Used to look up the user handle based on the username, for authentication ceremonies where
53
55
* the username is already given.
56
+ *
57
+ * <p>Implementations of this method MUST NOT return null.
54
58
*/
55
59
Optional <ByteArray > getUserHandleForUsername (String username );
56
60
@@ -60,6 +64,8 @@ public interface CredentialRepository {
60
64
*
61
65
* <p>Used to look up the username based on the user handle, for username-less authentication
62
66
* ceremonies.
67
+ *
68
+ * <p>Implementations of this method MUST NOT return null.
63
69
*/
64
70
Optional <String > getUsernameForUserHandle (ByteArray userHandle );
65
71
@@ -69,6 +75,8 @@ public interface CredentialRepository {
69
75
*
70
76
* <p>The returned {@link RegisteredCredential} is not expected to be long-lived. It may be read
71
77
* directly from a database or assembled from other components.
78
+ *
79
+ * <p>Implementations of this method MUST NOT return null.
72
80
*/
73
81
Optional <RegisteredCredential > lookup (ByteArray credentialId , ByteArray userHandle );
74
82
@@ -79,6 +87,8 @@ public interface CredentialRepository {
79
87
* <p>This is used to refuse registration of duplicate credential IDs. Therefore, under normal
80
88
* circumstances this method should only return zero or one credential (this is an expected
81
89
* consequence, not an interface requirement).
90
+ *
91
+ * <p>Implementations of this method MUST NOT return null.
82
92
*/
83
93
Set <RegisteredCredential > lookupAll (ByteArray credentialId );
84
94
}
0 commit comments