[java-idp-plugin-webauthn] branch main updated: Update javadoc and set default accelerator type to QUERY
Phil Smart
philip.smart at jisc.ac.uk
Thu Jul 31 09:42:45 UTC 2025
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=de40920e881f59bb7c2451c1a77070935f5fe80e
The following commit(s) were added to refs/heads/main by this push:
new de40920 Update javadoc and set default accelerator type to QUERY
de40920 is described below
commit de40920e881f59bb7c2451c1a77070935f5fe80e
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Jul 31 10:42:43 2025 +0100
Update javadoc and set default accelerator type to QUERY
- I'm not going to advertise the READALL variant much, but I will keep
it given that it can work if a need arises.
---
.../IdPStorageServiceCredentialRepository.java | 2 ++
...BasedIdPStorageServiceCredentialRepository.java | 24 +++++++++++++++-------
.../META-INF/net.shibboleth.idp/postconfig.xml | 2 +-
.../authn/webauthn/conf/authn/webauthn.properties | 2 +-
4 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRepository.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRepository.java
index f77ef15..f574a42 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRepository.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/IdPStorageServiceCredentialRepository.java
@@ -280,6 +280,7 @@ public class IdPStorageServiceCredentialRepository extends AbstractIdentifiableI
@Nullable protected String getUsernameFromUserHandleCache(@Nonnull final ByteArray userHandle) {
checkComponentActive();
+ log.trace("Getting username for userHandle '{}' from cache", userHandle.getBase64Url());
final String usernameMapping = userHandleMappingCacheService.getIfPresent(userHandle);
if (usernameMapping != null) {
@@ -341,6 +342,7 @@ public class IdPStorageServiceCredentialRepository extends AbstractIdentifiableI
@Nullable protected String getUsernameFromCredentialIdCache(@Nonnull final ByteArray credentialId) {
checkComponentActive();
+ log.trace("Getting username for credentialId '{}' from cache", credentialId.getBase64Url());
final String usernameMapping = credentialIdMappingCacheService.getIfPresent(credentialId);
if (usernameMapping != null) {
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/StrategyBasedIdPStorageServiceCredentialRepository.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/StrategyBasedIdPStorageServiceCredentialRepository.java
index 62ad320..c33b988 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/StrategyBasedIdPStorageServiceCredentialRepository.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/StrategyBasedIdPStorageServiceCredentialRepository.java
@@ -54,14 +54,14 @@ public class StrategyBasedIdPStorageServiceCredentialRepository extends IdPStora
/**
* The strategy used to lookup credentials by userHandle. Returned is a List of storage records, where each
- * storage record can contain a number of credentials for a given user.
+ * storage record can contain a number of unique credentials for a given user.
*/
@NonnullAfterInit private
BiFunction<String, ByteArray, List<StorageRecord<Set<CredentialRecord>>>> credentialByUserHandleLookupStrategy;
/**
* The strategy used to lookup credentials by credentialId. Returned is a List of storage records, where each
- * storage record can contain a number of credentials for a given user.
+ * storage record can contain a number of unique credentials for a given user.
*/
@NonnullAfterInit private
BiFunction<String, ByteArray, List<StorageRecord<Set<CredentialRecord>>>> credentialByCredentialIdLookupStrategy;
@@ -115,9 +115,14 @@ public class StrategyBasedIdPStorageServiceCredentialRepository extends IdPStora
"credentialIdLookupStrategy can not be null");
}
- /** {@inheritDoc} */
+ /** {@inheritDoc}
+ *
+ * <p>The lookup strategy is responsible for returning the set of registrations by userHandle. The set of
+ * credentials returned by the lookup strategy are further checked to ensure they are sound —
+ * the credentials are a match to the userHandle given.</p>
+ */
@Override
- protected Collection<CredentialRecord> getRegistrationsByUserHandle(final ByteArray userHandle) {
+ @Nonnull protected Collection<CredentialRecord> getRegistrationsByUserHandle(final ByteArray userHandle) {
checkComponentActive();
final Lock readLock = getLock().readLock();
try {
@@ -161,9 +166,14 @@ public class StrategyBasedIdPStorageServiceCredentialRepository extends IdPStora
}
- /** {@inheritDoc} */
+ /** {@inheritDoc}
+ *
+ * <p>The lookup strategy is responsible for returning the set of registrations by credentialId. The set of
+ * credentials returned by the lookup strategy are further checked to ensure they are sound —
+ * the credentials are a match to the credentialId given.</p>
+ */
@Override
- @Nonnull public Set<CredentialRecord> getRegistrationsByCredentialId(final ByteArray credentialId) {
+ @Nonnull protected Set<CredentialRecord> getRegistrationsByCredentialId(final ByteArray credentialId) {
checkComponentActive();
final Lock readLock = getLock().readLock();
try {
@@ -198,7 +208,7 @@ public class StrategyBasedIdPStorageServiceCredentialRepository extends IdPStora
.collect(CollectionSupport.nonnullCollector(Collectors.toUnmodifiableSet()))
.get();
- log.info("{}: Found '{}' matching credentials for credential '{}'", getId(),
+ log.info("{}: Found '{}' matching credentials for credentialId '{}'", getId(),
matchingCredentials.size(), credentialIdB64);
if (!matchingCredentials.isEmpty()) {
return matchingCredentials.stream()
diff --git a/webauthn-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/webauthn-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index 3fe77f2..ec72373 100644
--- a/webauthn-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/webauthn-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -97,7 +97,7 @@
<bean id="shibboleth.authn.WebAuthn.DefaultCredentialRepository" scope="singleton"
class="net.shibboleth.idp.plugin.authn.webauthn.storage.impl.StorageServiceCredentialRepositoryFactory"
p:storageService-ref="#{'%{idp.authn.webauthn.StorageService:shibboleth.StorageService}'.trim()}"
- p:defaultAcceleratorType="%{idp.authn.webauthn.StorageService.jdbcAccelerator.defaultType:READALL}"
+ p:defaultAcceleratorType="%{idp.authn.webauthn.StorageService.jdbcAccelerator.defaultType:QUERY}"
p:credentialByUserHandleLookupStrategy="#{getObject('%{idp.authn.webauthn.StorageService.jdbcAccelerator.credentialByUserHandleLookupStrategy:}')}"
p:credentialByCredentialIdLookupStrategy="#{getObject('%{idp.authn.webauthn.StorageService.jdbcAccelerator.credentialByCredentialIdLookupStrategy:}')}"
p:jdbcAccelerator="#{getObject('%{idp.authn.webauthn.StorageService.jdbcAccelerator:WebAuthnJDBCAccelerator}')}"
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties
index c436cd7..4c87ac6 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties
@@ -36,7 +36,7 @@ idp.authn.webauthn.supportedPrincipals = \
#idp.authn.webauthn.StorageService.cache.expireAfterAccess = PT60M
# The JDBC credential repository accelerator to use, only to be enabled if you are using a JDBC storage service with a compatible RDMS datasource
#idp.authn.webauthn.StorageService.jdbcAccelerator = WebAuthnJDBCAccelerator
-#idp.authn.webauthn.StorageService.jdbcAccelerator.defaultType = READALL
+#idp.authn.webauthn.StorageService.jdbcAccelerator.defaultType = QUERY
# Which type of flow is supported? Usernameless (true) or passwordless (false)
#idp.authn.webauthn.usernameless.enabled = false
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list