Class FidoMetadataServiceFactory
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.plugin.authn.webauthn.metadata.impl.FidoMetadataServiceFactory
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,FactoryBean<com.yubico.fido.metadata.FidoMetadataService>
public class FidoMetadataServiceFactory
extends AbstractIdentifiableInitializableComponent
implements FactoryBean<com.yubico.fido.metadata.FidoMetadataService>
Spring factory bean for creating a
FidoMetadataService. Only downloads or loads FIDO metadata on
creation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ResourceWhere to cache the metadata blob.A List of CRLs to check the revocation status of the metadata signature.private String[]The expected set of legal headers on the FIDO metadata blob.private final org.slf4j.LoggerClass logger.private ResourceThe File location of the metadata blob.private ResourceThe HTTPS location of the metadata blob to download.private ResourceThe file location of the trust root that verifies the downloaded metadata's signature.private booleanOnly verify the signature in the blob file from a fresh download.Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate ResourceGet where to cache the metadata blob.getCrls()Get the CRLs to use to check the revocation status of the metadata signature.private String[]Get the expected legal headers on the FIDO metadata blob.private ResourceGet the metadata blob file.private ResourceGet the URL of the metadata blob file to fetch.com.yubico.fido.metadata.FidoMetadataServiceClass<?>private ResourceGet the trust root file.booleanOnly verify the signature in the blob file from a fresh download?private Collection<CRL>loadCrls()Load CRLs from the given set of CRL resources into a collection of CRL objects.private StringloadMetadataJwt(Resource file) Load the given metadata blob file into a String.voidsetCacheFile(String file) Set where to cache the metadata blob.voidSet the CRLs to use to check the revocation status of the metadata signature.voidsetExpectedLegalHeaders(String[] headers) Set the expected legal headers on the FIDO metadata blob.voidsetMetadataBlobFile(Resource file) Set the location of the local metadata blob file.voidSet the URL of the metadata blob file to fetch.voidsetTrustRootFile(Resource file) Set the trust root file.voidsetVerifyDownloadOnly(boolean downloadOnly) Set if signatures are only verified in the blob file from a fresh download.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBean
isSingletonMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
trustRootFile
The file location of the trust root that verifies the downloaded metadata's signature. -
cacheFile
Where to cache the metadata blob. -
metadataBlobUrl
The HTTPS location of the metadata blob to download. -
metadataBlobFile
The File location of the metadata blob. If this file is specified, metadata will never be downloaded over HTTP. -
verifyDownloadOnly
private boolean verifyDownloadOnlyOnly verify the signature in the blob file from a fresh download. -
expectedLegalHeaders
The expected set of legal headers on the FIDO metadata blob. -
crls
A List of CRLs to check the revocation status of the metadata signature.
-
-
Constructor Details
-
FidoMetadataServiceFactory
public FidoMetadataServiceFactory()Constructor.
-
-
Method Details
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<com.yubico.fido.metadata.FidoMetadataService>- Throws:
Exception
-
loadCrls
Load CRLs from the given set of CRL resources into a collection of CRL objects.- Returns:
- the loaded CRL collection
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
setCacheFile
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 aFileSystemResourcetype.- Parameters:
file- The cacheFile to set.
-
getCacheFile
Get where to cache the metadata blob.- Returns:
- where to cache the metadata blob.
-
getTrustRootFile
Get the trust root file.- Returns:
- the trust root file
-
getMetadataBlobUrl
Get the URL of the metadata blob file to fetch.- Returns:
- the metadata blob file URL.
-
getMetadataBlobFile
Get the metadata blob file.- Returns:
- the metadata blob file.
-
setExpectedLegalHeaders
Set the expected legal headers on the FIDO metadata blob.- Parameters:
headers- The expected legal headers to set.
-
getExpectedLegalHeaders
Get the expected legal headers on the FIDO metadata blob.- Returns:
- the expected legal headers.
-
setCrls
Set the CRLs to use to check the revocation status of the metadata signature.- Parameters:
revocationLists- The crls to set.
-
getCrls
Get the CRLs to use to check the revocation status of the metadata signature.- Returns:
- the crls.
-
setVerifyDownloadOnly
public void setVerifyDownloadOnly(boolean downloadOnly) Set if signatures are only verified in the blob file from a fresh download.- Parameters:
downloadOnly- should we verify only newly downloaded metadata.
-
isVerifyDownloadOnly
public boolean isVerifyDownloadOnly()Only verify the signature in the blob file from a fresh download?- Returns:
- true if signatures are only verified in a new blob file download (i.e. ignored from a cache file), false if they are always verified, no matter where the blob is loaded from.
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<com.yubico.fido.metadata.FidoMetadataService>
-