Package net.shibboleth.spring.http
Class HTTPResourceFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<HTTPResource>
net.shibboleth.spring.http.HTTPResourceFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<HTTPResource>,InitializingBean
Factory bean for simple use cases that auto-configure PKIX or key pinning for
an
HTTPResource.- Since:
- 3.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringBacking file path.The resources to be turned into certificates.private org.apache.hc.client5.http.classic.HttpClientHTTP Client used to pull the resource.private HttpClientContextHandlerOptional handler to pre- and post-process context.The resources to be turned into keys.private org.slf4j.LoggerClass logger.private URLURL to the Resource.private booleanUse a PKIX trust engine.private IntegerPKIX verify depth.Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HTTPResourceprotected List<X509Certificate>Get the configured certificates in their native form.protected List<Credential>Get the configured keys and certificates lumped together as credentials.Class<?>voidsetBackingResource(String resource) Set the backing resource.voidsetCertificates(List<Resource> certs) Set the resources which we will convert into certificates.voidsetHttpClient(org.apache.hc.client5.http.classic.HttpClient client) Set theHttpClientinstance.voidSet a handler to manipulate theHttpClientContext.voidsetPublicKeys(List<Resource> keys) Set the resources which we will convert into certificates.voidSet the URL.voidsetUsePKIX(boolean flag) Set whether to use a PKIX trust engine.voidsetVerifyDepth(Integer depth) Set the verify depth.Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
backingResource
Backing file path. -
httpClient
@Nullable private org.apache.hc.client5.http.classic.HttpClient httpClientHTTP Client used to pull the resource. -
resourceURL
URL to the Resource. -
httpClientContextHandler
Optional handler to pre- and post-process context. -
keyResources
The resources to be turned into keys. -
certificateResources
The resources to be turned into certificates. -
usePKIX
private boolean usePKIXUse a PKIX trust engine. -
verifyDepth
PKIX verify depth.
-
-
Constructor Details
-
HTTPResourceFactoryBean
public HTTPResourceFactoryBean()Constructor.
-
-
Method Details
-
setURL
Set the URL.- Parameters:
url- the URL
-
setBackingResource
Set the backing resource.- Parameters:
resource- the backing resource
-
setHttpClient
public void setHttpClient(@Nullable org.apache.hc.client5.http.classic.HttpClient client) Set theHttpClientinstance.- Parameters:
client- client instance
-
setPublicKeys
Set the resources which we will convert into certificates.- Parameters:
keys- the resources
-
setCertificates
Set the resources which we will convert into certificates.- Parameters:
certs- the resources
-
setUsePKIX
public void setUsePKIX(boolean flag) Set whether to use a PKIX trust engine.- Parameters:
flag- flag to set
-
setVerifyDepth
Set the verify depth.- Parameters:
depth- value to set
-
getCredentials
Get the configured keys and certificates lumped together as credentials.- Returns:
- the certificates null
-
getCertificates
Get the configured certificates in their native form.- Returns:
- the certificates
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<HTTPResource>- Specified by:
getObjectTypein classAbstractFactoryBean<HTTPResource>
-
createInstance
- Specified by:
createInstancein classAbstractFactoryBean<HTTPResource>- Throws:
Exception
-