Class UnisonConfigManagerImpl
java.lang.Object
com.tremolosecurity.config.util.UnisonConfigManagerImpl
- All Implemented Interfaces:
ConfigManager,UnisonConfigManager
- Direct Known Subclasses:
OpenUnisonConfigManager
public abstract class UnisonConfigManagerImpl
extends Object
implements ConfigManager, UnisonConfigManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MyVDConnectionprotected Stringprotected jakarta.servlet.ServletContextprotected KeyManagerFactoryprotected KeyStoreprotected net.sourceforge.myvd.server.ServerCore -
Constructor Summary
ConstructorsConstructorDescriptionUnisonConfigManagerImpl(String configXML, jakarta.servlet.ServletContext ctx, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddReloadNotifier(ReloadNotification notifier) Provide notifications to classes when the configuration is reloadedvoidvoidAdds a thread to the managed list of threads.voidvoidStop all threads and clear them from UnisonvoidcreateAnonUser(jakarta.servlet.http.HttpSession sharedSession) Resets the session's state to an anonymous uservoidFinds an application configuration based on a URLReturns an application configuration based on the application's nameReturns a map of Authentication Chain configurations based on the name of the chainReturns where Unison stores JSP pages for authentication (typically /auth/forms).Returns the path where Unison identity providers are configured.getAuthMech(String uri) Retrieves an authentication mechanism implementation based on the URI of a requestReturns a map of all configured authentication mechanism configurationsReturns the path to Unison's "auth" directory.getCertificate(String alias) Retrieves a certificate from Unison's internal certificate storegetCfg()Returns the un-marshaled XML configurationReturns the full path to Unison's XML configurationjakarta.servlet.ServletContextReturns Unison's servlet contextReturns the context path for UnisonReturns a map of custom authorization implementations and namesReturns the error pagesabstract intReturns the open port, as seen by a client.abstract intReturns the secure port, as seen by a client.org.apache.http.client.config.RequestConfigReturns the global htto client configurationorg.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> Returns the protocol registry for the http clientReturns Unison's Key Management FactoryReturns Unison's key storegetMyVD()Return the internal MyVD connection, can be used for searches and authenticationabstract intReturns the open port this service is listening onWhen Unison is embedded, returns the name of the user attribute that will act as the roles identifier.When Unison is embedded, returns the name of the user attribute that will act as the user identifier.getPrivateKey(String alias) Returns a private key from Unison's internal key storeRetrieves the Unison provisioning subsystemgetResultGroup(String name) Returns a Result Group configuration based on its namegetSecretKey(String alias) Returns a secret key from Unison's key storeabstract intReturns the secure port this service is listening onReturns the SSLContextReturns an implementation of the upgrade managervoidinitialize(String name) Initializes a Unison configurationvoidinitializeUrls(List<UrlHolder> holders) abstract booleanTrue if all connections in plain text are to be redirected to encrypted text (HTTP/S only)voidLoads all authentication mechanisms, DO NOT CALLvoidLoads all filter configurations, DO NOT CALLabstract voidloadKeystore(String path, String myVdPath) abstract voidabstract jakarta.xml.bind.JAXBElement<TremoloType> loadUnisonConfiguration(jakarta.xml.bind.Unmarshaller unmarshaller) voidNotify listeners that the configuration is bring reloadedabstract voidvoidReloads all configuration items, clears all threadsvoidvoidremoveCustomAuthorization(String azName) voidremoveResultGroup(ResultGroupType rgtToRemove) voidsetPaasRoleAttribute(String paasRoleAttribute) When Unison is embedded, sets the name of the user attribute that will act as the roles identifier.voidsetPaasUserPrinicipalAttribute(String paasUserPrinicipalAttribute) When Unison is embedded, sets the name of the user attribute that will act as the user identifier.
-
Field Details
-
myvd
protected net.sourceforge.myvd.server.ServerCore myvd -
con
-
ks
-
kmf
-
configXML
-
ctx
protected jakarta.servlet.ServletContext ctx
-
-
Constructor Details
-
UnisonConfigManagerImpl
-
-
Method Details
-
getUpgradeManager
Description copied from interface:ConfigManagerReturns an implementation of the upgrade manager- Specified by:
getUpgradeManagerin interfaceConfigManager- Returns:
-
getErrorPages
Description copied from interface:ConfigManagerReturns the error pages- Specified by:
getErrorPagesin interfaceConfigManager
-
getConfigXmlPath
Description copied from interface:ConfigManagerReturns the full path to Unison's XML configuration- Specified by:
getConfigXmlPathin interfaceConfigManager- Specified by:
getConfigXmlPathin interfaceUnisonConfigManager- Returns:
-
buildHttpConfig
public void buildHttpConfig() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException- Specified by:
buildHttpConfigin interfaceConfigManager- Throws:
NoSuchAlgorithmExceptionKeyManagementExceptionKeyStoreExceptionUnrecoverableKeyException
-
getAuthMechs
Description copied from interface:ConfigManagerReturns a map of all configured authentication mechanism configurations- Specified by:
getAuthMechsin interfaceConfigManager- Specified by:
getAuthMechsin interfaceUnisonConfigManager- Returns:
-
getCfg
Description copied from interface:ConfigManagerReturns the un-marshaled XML configuration- Specified by:
getCfgin interfaceConfigManager- Specified by:
getCfgin interfaceUnisonConfigManager- Returns:
-
loadUnisonConfiguration
public abstract jakarta.xml.bind.JAXBElement<TremoloType> loadUnisonConfiguration(jakarta.xml.bind.Unmarshaller unmarshaller) throws Exception - Throws:
Exception
-
initialize
public void initialize(String name) throws jakarta.xml.bind.JAXBException, Exception, IOException, FileNotFoundException, InstantiationException, IllegalAccessException, ClassNotFoundException, com.novell.ldap.LDAPException, KeyStoreException, NoSuchAlgorithmException, CertificateException, ProvisioningException Description copied from interface:ConfigManagerInitializes a Unison configuration- Specified by:
initializein interfaceConfigManager- Specified by:
initializein interfaceUnisonConfigManager- Parameters:
name-- Throws:
jakarta.xml.bind.JAXBExceptionExceptionIOExceptionFileNotFoundExceptionInstantiationExceptionIllegalAccessExceptionClassNotFoundExceptioncom.novell.ldap.LDAPExceptionKeyStoreExceptionNoSuchAlgorithmExceptionCertificateExceptionProvisioningException
-
getNotificationsMananager
- Specified by:
getNotificationsMananagerin interfaceConfigManager
-
postInitialize
public abstract void postInitialize() -
loadKeystore
-
getAuthChains
Description copied from interface:ConfigManagerReturns a map of Authentication Chain configurations based on the name of the chain- Specified by:
getAuthChainsin interfaceConfigManager- Specified by:
getAuthChainsin interfaceUnisonConfigManager- Returns:
-
addApplication
- Specified by:
addApplicationin interfaceConfigManager- Throws:
Exception
-
deleteApp
- Specified by:
deleteAppin interfaceConfigManager
-
initializeUrls
- Specified by:
initializeUrlsin interfaceConfigManager- Throws:
Exception
-
findURL
Description copied from interface:ConfigManagerFinds an application configuration based on a URL- Specified by:
findURLin interfaceConfigManager- Specified by:
findURLin interfaceUnisonConfigManager- Parameters:
url-- Returns:
- Throws:
Exception
-
getResultGroup
Description copied from interface:ConfigManagerReturns a Result Group configuration based on its name- Specified by:
getResultGroupin interfaceConfigManager- Specified by:
getResultGroupin interfaceUnisonConfigManager- Parameters:
name-- Returns:
-
getMyVD
Description copied from interface:ConfigManagerReturn the internal MyVD connection, can be used for searches and authentication- Specified by:
getMyVDin interfaceConfigManager- Specified by:
getMyVDin interfaceUnisonConfigManager- Returns:
-
getSecretKey
Description copied from interface:ConfigManagerReturns a secret key from Unison's key store- Specified by:
getSecretKeyin interfaceConfigManager- Specified by:
getSecretKeyin interfaceUnisonConfigManager- Parameters:
alias-- Returns:
-
getApp
Description copied from interface:ConfigManagerReturns an application configuration based on the application's name- Specified by:
getAppin interfaceConfigManager- Specified by:
getAppin interfaceUnisonConfigManager- Parameters:
name-- Returns:
-
loadFilters
public void loadFilters()Description copied from interface:ConfigManagerLoads all filter configurations, DO NOT CALL- Specified by:
loadFiltersin interfaceConfigManager- Specified by:
loadFiltersin interfaceUnisonConfigManager
-
loadAuthMechs
public void loadAuthMechs() throws jakarta.servlet.ServletExceptionDescription copied from interface:ConfigManagerLoads all authentication mechanisms, DO NOT CALL- Specified by:
loadAuthMechsin interfaceConfigManager- Specified by:
loadAuthMechsin interfaceUnisonConfigManager- Throws:
jakarta.servlet.ServletException
-
getAuthMech
Description copied from interface:ConfigManagerRetrieves an authentication mechanism implementation based on the URI of a request- Specified by:
getAuthMechin interfaceConfigManager- Specified by:
getAuthMechin interfaceUnisonConfigManager- Parameters:
uri-- Returns:
-
getCertificate
Description copied from interface:ConfigManagerRetrieves a certificate from Unison's internal certificate store- Specified by:
getCertificatein interfaceConfigManager- Specified by:
getCertificatein interfaceUnisonConfigManager- Parameters:
alias-- Returns:
-
getProvisioningEngine
Description copied from interface:ConfigManagerRetrieves the Unison provisioning subsystem- Specified by:
getProvisioningEnginein interfaceConfigManager- Specified by:
getProvisioningEnginein interfaceUnisonConfigManager- Returns:
-
reloadConfig
Description copied from interface:ConfigManagerReloads all configuration items, clears all threads- Specified by:
reloadConfigin interfaceConfigManager- Specified by:
reloadConfigin interfaceUnisonConfigManager- Throws:
Exception
-
getPrivateKey
Description copied from interface:ConfigManagerReturns a private key from Unison's internal key store- Specified by:
getPrivateKeyin interfaceConfigManager- Specified by:
getPrivateKeyin interfaceUnisonConfigManager- Parameters:
alias-- Returns:
-
getKeyStore
Description copied from interface:ConfigManagerReturns Unison's key store- Specified by:
getKeyStorein interfaceConfigManager- Specified by:
getKeyStorein interfaceUnisonConfigManager- Returns:
-
getKeyManagerFactory
Description copied from interface:ConfigManagerReturns Unison's Key Management Factory- Specified by:
getKeyManagerFactoryin interfaceConfigManager- Specified by:
getKeyManagerFactoryin interfaceUnisonConfigManager- Returns:
-
addThread
Description copied from interface:ConfigManagerAdds a thread to the managed list of threads. Useful for "clean up" processes- Specified by:
addThreadin interfaceConfigManager- Specified by:
addThreadin interfaceUnisonConfigManager- Parameters:
r-
-
clearThreads
public void clearThreads()Description copied from interface:ConfigManagerStop all threads and clear them from Unison- Specified by:
clearThreadsin interfaceConfigManager- Specified by:
clearThreadsin interfaceUnisonConfigManager
-
addReloadNotifier
Description copied from interface:ConfigManagerProvide notifications to classes when the configuration is reloaded- Specified by:
addReloadNotifierin interfaceConfigManager- Specified by:
addReloadNotifierin interfaceUnisonConfigManager- Parameters:
notifier-
-
notifyReload
public void notifyReload()Description copied from interface:ConfigManagerNotify listeners that the configuration is bring reloaded- Specified by:
notifyReloadin interfaceConfigManager- Specified by:
notifyReloadin interfaceUnisonConfigManager
-
isForceToSSL
public abstract boolean isForceToSSL()Description copied from interface:ConfigManagerTrue if all connections in plain text are to be redirected to encrypted text (HTTP/S only)- Specified by:
isForceToSSLin interfaceConfigManager- Specified by:
isForceToSSLin interfaceUnisonConfigManager- Returns:
-
getOpenPort
public abstract int getOpenPort()Description copied from interface:ConfigManagerReturns the open port this service is listening on- Specified by:
getOpenPortin interfaceConfigManager- Specified by:
getOpenPortin interfaceUnisonConfigManager- Returns:
-
getSecurePort
public abstract int getSecurePort()Description copied from interface:ConfigManagerReturns the secure port this service is listening on- Specified by:
getSecurePortin interfaceConfigManager- Specified by:
getSecurePortin interfaceUnisonConfigManager- Returns:
-
getExternalOpenPort
public abstract int getExternalOpenPort()Description copied from interface:ConfigManagerReturns the open port, as seen by a client. For instance if Unison is running on port 8080 but there is a firewall port forwarding from port 80 this would return 80- Specified by:
getExternalOpenPortin interfaceConfigManager- Specified by:
getExternalOpenPortin interfaceUnisonConfigManager- Returns:
-
getExternalSecurePort
public abstract int getExternalSecurePort()Description copied from interface:ConfigManagerReturns the secure port, as seen by a client. For instance if Unison is running on port 8443 but there is a firewall port forwarding from port 443 this would return 443- Specified by:
getExternalSecurePortin interfaceConfigManager- Specified by:
getExternalSecurePortin interfaceUnisonConfigManager- Returns:
-
createAnonUser
public void createAnonUser(jakarta.servlet.http.HttpSession sharedSession) Description copied from interface:ConfigManagerResets the session's state to an anonymous user- Specified by:
createAnonUserin interfaceConfigManager- Specified by:
createAnonUserin interfaceUnisonConfigManager- Parameters:
sharedSession-
-
getAuthPath
Description copied from interface:ConfigManagerReturns the path to Unison's "auth" directory. If Unison is embedded this directory can be at different levels- Specified by:
getAuthPathin interfaceConfigManager- Specified by:
getAuthPathin interfaceUnisonConfigManager- Returns:
-
getAuthFormsPath
Description copied from interface:ConfigManagerReturns where Unison stores JSP pages for authentication (typically /auth/forms). If Unison is embedded this path may change.- Specified by:
getAuthFormsPathin interfaceConfigManager- Specified by:
getAuthFormsPathin interfaceUnisonConfigManager- Returns:
-
getAuthIdPPath
Description copied from interface:ConfigManagerReturns the path where Unison identity providers are configured. Typicaly /auth/idp however this may change if Unison is embedded.- Specified by:
getAuthIdPPathin interfaceConfigManager- Specified by:
getAuthIdPPathin interfaceUnisonConfigManager- Returns:
-
getPaasUserPrinicipalAttribute
Description copied from interface:ConfigManagerWhen Unison is embedded, returns the name of the user attribute that will act as the user identifier.- Specified by:
getPaasUserPrinicipalAttributein interfaceConfigManager- Specified by:
getPaasUserPrinicipalAttributein interfaceUnisonConfigManager- Returns:
-
setPaasUserPrinicipalAttribute
Description copied from interface:ConfigManagerWhen Unison is embedded, sets the name of the user attribute that will act as the user identifier.- Specified by:
setPaasUserPrinicipalAttributein interfaceConfigManager- Specified by:
setPaasUserPrinicipalAttributein interfaceUnisonConfigManager
-
getPaasRoleAttribute
Description copied from interface:ConfigManagerWhen Unison is embedded, returns the name of the user attribute that will act as the roles identifier.- Specified by:
getPaasRoleAttributein interfaceConfigManager- Specified by:
getPaasRoleAttributein interfaceUnisonConfigManager- Returns:
-
setPaasRoleAttribute
Description copied from interface:ConfigManagerWhen Unison is embedded, sets the name of the user attribute that will act as the roles identifier.- Specified by:
setPaasRoleAttributein interfaceConfigManager- Specified by:
setPaasRoleAttributein interfaceUnisonConfigManager
-
getContextPath
Description copied from interface:ConfigManagerReturns the context path for Unison- Specified by:
getContextPathin interfaceConfigManager- Specified by:
getContextPathin interfaceUnisonConfigManager- Returns:
-
getContext
public jakarta.servlet.ServletContext getContext()Description copied from interface:ConfigManagerReturns Unison's servlet context- Specified by:
getContextin interfaceConfigManager- Specified by:
getContextin interfaceUnisonConfigManager- Returns:
-
getAuthManager
- Specified by:
getAuthManagerin interfaceConfigManager
-
getGlobalHttpClientConfig
public org.apache.http.client.config.RequestConfig getGlobalHttpClientConfig()Description copied from interface:ConfigManagerReturns the global htto client configuration- Specified by:
getGlobalHttpClientConfigin interfaceConfigManager- Returns:
-
getHttpClientSocketRegistry
public org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> getHttpClientSocketRegistry()Description copied from interface:ConfigManagerReturns the protocol registry for the http client- Specified by:
getHttpClientSocketRegistryin interfaceConfigManager- Returns:
-
loadMyVD
-
getCustomAuthorizations
Description copied from interface:ConfigManagerReturns a map of custom authorization implementations and names- Specified by:
getCustomAuthorizationsin interfaceConfigManager- Returns:
-
getSSLContext
Description copied from interface:ConfigManagerReturns the SSLContext- Specified by:
getSSLContextin interfaceConfigManager- Returns:
-
addResultGroup
- Specified by:
addResultGroupin interfaceConfigManager
-
removeResultGroup
- Specified by:
removeResultGroupin interfaceConfigManager
-
addCustomerAuthorization
- Specified by:
addCustomerAuthorizationin interfaceConfigManager
-
removeCustomAuthorization
- Specified by:
removeCustomAuthorizationin interfaceConfigManager
-
getAuthFailMechanism
- Specified by:
getAuthFailMechanismin interfaceConfigManager
-
addAuthenticationMechanism
- Specified by:
addAuthenticationMechanismin interfaceConfigManager
-
removeAuthenticationMechanism
- Specified by:
removeAuthenticationMechanismin interfaceConfigManager
-
getAuthFailChain
- Specified by:
getAuthFailChainin interfaceConfigManager
-