[java-idp-plugin-webauthn] branch main updated: JWEBAUTHN-21 - IdP does not start with a non-existing fido metadata cache file

Phil Smart philip.smart at jisc.ac.uk
Mon Sep 16 15:50:37 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=e04f34b523206e5fdd7f95aab7d6501b1b1325ae

The following commit(s) were added to refs/heads/main by this push:
     new e04f34b  JWEBAUTHN-21 - IdP does not start with a non-existing fido metadata cache file
e04f34b is described below

commit e04f34b523206e5fdd7f95aab7d6501b1b1325ae
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Sep 16 16:50:34 2024 +0100

    JWEBAUTHN-21 - IdP does not start with a non-existing fido metadata
    cache file
    
     - Restrict the metadata cache file to be a FileSystemResource type
    
    https://shibboleth.atlassian.net/browse/JWEBAUTHN-21
---
 .../authn/webauthn/metadata/FidoMetadataServiceFactory.java   | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java
index d746e3c..e8fbf34 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/metadata/FidoMetadataServiceFactory.java
@@ -33,6 +33,7 @@ import org.opensaml.security.x509.X509Support;
 import org.slf4j.Logger;
 import org.springframework.beans.FatalBeanException;
 import org.springframework.beans.factory.FactoryBean;
+import org.springframework.core.io.FileSystemResource;
 import org.springframework.util.FileCopyUtils;
 
 import com.yubico.fido.metadata.FidoMetadataDownloader;
@@ -46,6 +47,7 @@ import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.shared.resource.Resource;
+import net.shibboleth.shared.spring.resource.ResourceHelper;
 
 
 /**
@@ -180,13 +182,16 @@ public class FidoMetadataServiceFactory extends AbstractIdentifiableInitializabl
     }
     
     /**
-     * Set where to cache the metadata blob. 
+     * Set where to cache the metadata blob. As the cachefile does not need to exist before the metadata is downloaded,
+     * we restrict the file to be a {@link FileSystemResource} type.
      * 
      * @param file The cacheFile to set.
      */
-    public synchronized void setCacheFile(@Nullable final Resource file) {
+    public synchronized void setCacheFile(@Nullable final String file) {
         checkSetterPreconditions();
-        cacheFile = file;
+        if (file != null) {
+            cacheFile = ResourceHelper.of(new FileSystemResource(file));
+        }
     }
     
     /**

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


More information about the commits mailing list