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
Modifier and TypeFieldDescriptionprotected MyVDConnection
protected String
protected jakarta.servlet.ServletContext
protected KeyManagerFactory
protected KeyStore
protected net.sourceforge.myvd.server.ServerCore
-
Constructor Summary
ConstructorDescriptionUnisonConfigManagerImpl
(String configXML, jakarta.servlet.ServletContext ctx, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
addReloadNotifier
(ReloadNotification notifier) Provide notifications to classes when the configuration is reloadedvoid
void
Adds a thread to the managed list of threads.void
void
Stop all threads and clear them from Unisonvoid
createAnonUser
(jakarta.servlet.http.HttpSession sharedSession) Resets the session's state to an anonymous uservoid
Finds 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.ServletContext
Returns Unison's servlet contextReturns the context path for UnisonReturns a map of custom authorization implementations and namesReturns the error pagesabstract int
Returns the open port, as seen by a client.abstract int
Returns the secure port, as seen by a client.org.apache.http.client.config.RequestConfig
Returns 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 int
Returns 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 int
Returns the secure port this service is listening onReturns the SSLContextReturns an implementation of the upgrade managervoid
initialize
(String name) Initializes a Unison configurationvoid
initializeUrls
(List<UrlHolder> holders) abstract boolean
True if all connections in plain text are to be redirected to encrypted text (HTTP/S only)void
Loads all authentication mechanisms, DO NOT CALLvoid
Loads all filter configurations, DO NOT CALLabstract void
loadKeystore
(String path, String myVdPath) abstract void
abstract jakarta.xml.bind.JAXBElement
<TremoloType> loadUnisonConfiguration
(jakarta.xml.bind.Unmarshaller unmarshaller) void
Notify listeners that the configuration is bring reloadedabstract void
void
Reloads all configuration items, clears all threadsvoid
void
removeCustomAuthorization
(String azName) void
removeResultGroup
(ResultGroupType rgtToRemove) void
setPaasRoleAttribute
(String paasRoleAttribute) When Unison is embedded, sets the name of the user attribute that will act as the roles identifier.void
setPaasUserPrinicipalAttribute
(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:ConfigManager
Returns an implementation of the upgrade manager- Specified by:
getUpgradeManager
in interfaceConfigManager
- Returns:
-
getErrorPages
Description copied from interface:ConfigManager
Returns the error pages- Specified by:
getErrorPages
in interfaceConfigManager
-
getConfigXmlPath
Description copied from interface:ConfigManager
Returns the full path to Unison's XML configuration- Specified by:
getConfigXmlPath
in interfaceConfigManager
- Specified by:
getConfigXmlPath
in interfaceUnisonConfigManager
- Returns:
-
buildHttpConfig
public void buildHttpConfig() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException- Specified by:
buildHttpConfig
in interfaceConfigManager
- Throws:
NoSuchAlgorithmException
KeyManagementException
KeyStoreException
UnrecoverableKeyException
-
getAuthMechs
Description copied from interface:ConfigManager
Returns a map of all configured authentication mechanism configurations- Specified by:
getAuthMechs
in interfaceConfigManager
- Specified by:
getAuthMechs
in interfaceUnisonConfigManager
- Returns:
-
getCfg
Description copied from interface:ConfigManager
Returns the un-marshaled XML configuration- Specified by:
getCfg
in interfaceConfigManager
- Specified by:
getCfg
in 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:ConfigManager
Initializes a Unison configuration- Specified by:
initialize
in interfaceConfigManager
- Specified by:
initialize
in interfaceUnisonConfigManager
- Parameters:
name
-- Throws:
jakarta.xml.bind.JAXBException
Exception
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
ClassNotFoundException
com.novell.ldap.LDAPException
KeyStoreException
NoSuchAlgorithmException
CertificateException
ProvisioningException
-
getNotificationsMananager
- Specified by:
getNotificationsMananager
in interfaceConfigManager
-
postInitialize
public abstract void postInitialize() -
loadKeystore
-
getAuthChains
Description copied from interface:ConfigManager
Returns a map of Authentication Chain configurations based on the name of the chain- Specified by:
getAuthChains
in interfaceConfigManager
- Specified by:
getAuthChains
in interfaceUnisonConfigManager
- Returns:
-
addApplication
- Specified by:
addApplication
in interfaceConfigManager
- Throws:
Exception
-
deleteApp
- Specified by:
deleteApp
in interfaceConfigManager
-
initializeUrls
- Specified by:
initializeUrls
in interfaceConfigManager
- Throws:
Exception
-
findURL
Description copied from interface:ConfigManager
Finds an application configuration based on a URL- Specified by:
findURL
in interfaceConfigManager
- Specified by:
findURL
in interfaceUnisonConfigManager
- Parameters:
url
-- Returns:
- Throws:
Exception
-
getResultGroup
Description copied from interface:ConfigManager
Returns a Result Group configuration based on its name- Specified by:
getResultGroup
in interfaceConfigManager
- Specified by:
getResultGroup
in interfaceUnisonConfigManager
- Parameters:
name
-- Returns:
-
getMyVD
Description copied from interface:ConfigManager
Return the internal MyVD connection, can be used for searches and authentication- Specified by:
getMyVD
in interfaceConfigManager
- Specified by:
getMyVD
in interfaceUnisonConfigManager
- Returns:
-
getSecretKey
Description copied from interface:ConfigManager
Returns a secret key from Unison's key store- Specified by:
getSecretKey
in interfaceConfigManager
- Specified by:
getSecretKey
in interfaceUnisonConfigManager
- Parameters:
alias
-- Returns:
-
getApp
Description copied from interface:ConfigManager
Returns an application configuration based on the application's name- Specified by:
getApp
in interfaceConfigManager
- Specified by:
getApp
in interfaceUnisonConfigManager
- Parameters:
name
-- Returns:
-
loadFilters
public void loadFilters()Description copied from interface:ConfigManager
Loads all filter configurations, DO NOT CALL- Specified by:
loadFilters
in interfaceConfigManager
- Specified by:
loadFilters
in interfaceUnisonConfigManager
-
loadAuthMechs
public void loadAuthMechs() throws jakarta.servlet.ServletExceptionDescription copied from interface:ConfigManager
Loads all authentication mechanisms, DO NOT CALL- Specified by:
loadAuthMechs
in interfaceConfigManager
- Specified by:
loadAuthMechs
in interfaceUnisonConfigManager
- Throws:
jakarta.servlet.ServletException
-
getAuthMech
Description copied from interface:ConfigManager
Retrieves an authentication mechanism implementation based on the URI of a request- Specified by:
getAuthMech
in interfaceConfigManager
- Specified by:
getAuthMech
in interfaceUnisonConfigManager
- Parameters:
uri
-- Returns:
-
getCertificate
Description copied from interface:ConfigManager
Retrieves a certificate from Unison's internal certificate store- Specified by:
getCertificate
in interfaceConfigManager
- Specified by:
getCertificate
in interfaceUnisonConfigManager
- Parameters:
alias
-- Returns:
-
getProvisioningEngine
Description copied from interface:ConfigManager
Retrieves the Unison provisioning subsystem- Specified by:
getProvisioningEngine
in interfaceConfigManager
- Specified by:
getProvisioningEngine
in interfaceUnisonConfigManager
- Returns:
-
reloadConfig
Description copied from interface:ConfigManager
Reloads all configuration items, clears all threads- Specified by:
reloadConfig
in interfaceConfigManager
- Specified by:
reloadConfig
in interfaceUnisonConfigManager
- Throws:
Exception
-
getPrivateKey
Description copied from interface:ConfigManager
Returns a private key from Unison's internal key store- Specified by:
getPrivateKey
in interfaceConfigManager
- Specified by:
getPrivateKey
in interfaceUnisonConfigManager
- Parameters:
alias
-- Returns:
-
getKeyStore
Description copied from interface:ConfigManager
Returns Unison's key store- Specified by:
getKeyStore
in interfaceConfigManager
- Specified by:
getKeyStore
in interfaceUnisonConfigManager
- Returns:
-
getKeyManagerFactory
Description copied from interface:ConfigManager
Returns Unison's Key Management Factory- Specified by:
getKeyManagerFactory
in interfaceConfigManager
- Specified by:
getKeyManagerFactory
in interfaceUnisonConfigManager
- Returns:
-
addThread
Description copied from interface:ConfigManager
Adds a thread to the managed list of threads. Useful for "clean up" processes- Specified by:
addThread
in interfaceConfigManager
- Specified by:
addThread
in interfaceUnisonConfigManager
- Parameters:
r
-
-
clearThreads
public void clearThreads()Description copied from interface:ConfigManager
Stop all threads and clear them from Unison- Specified by:
clearThreads
in interfaceConfigManager
- Specified by:
clearThreads
in interfaceUnisonConfigManager
-
addReloadNotifier
Description copied from interface:ConfigManager
Provide notifications to classes when the configuration is reloaded- Specified by:
addReloadNotifier
in interfaceConfigManager
- Specified by:
addReloadNotifier
in interfaceUnisonConfigManager
- Parameters:
notifier
-
-
notifyReload
public void notifyReload()Description copied from interface:ConfigManager
Notify listeners that the configuration is bring reloaded- Specified by:
notifyReload
in interfaceConfigManager
- Specified by:
notifyReload
in interfaceUnisonConfigManager
-
isForceToSSL
public abstract boolean isForceToSSL()Description copied from interface:ConfigManager
True if all connections in plain text are to be redirected to encrypted text (HTTP/S only)- Specified by:
isForceToSSL
in interfaceConfigManager
- Specified by:
isForceToSSL
in interfaceUnisonConfigManager
- Returns:
-
getOpenPort
public abstract int getOpenPort()Description copied from interface:ConfigManager
Returns the open port this service is listening on- Specified by:
getOpenPort
in interfaceConfigManager
- Specified by:
getOpenPort
in interfaceUnisonConfigManager
- Returns:
-
getSecurePort
public abstract int getSecurePort()Description copied from interface:ConfigManager
Returns the secure port this service is listening on- Specified by:
getSecurePort
in interfaceConfigManager
- Specified by:
getSecurePort
in interfaceUnisonConfigManager
- Returns:
-
getExternalOpenPort
public abstract int getExternalOpenPort()Description copied from interface:ConfigManager
Returns 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:
getExternalOpenPort
in interfaceConfigManager
- Specified by:
getExternalOpenPort
in interfaceUnisonConfigManager
- Returns:
-
getExternalSecurePort
public abstract int getExternalSecurePort()Description copied from interface:ConfigManager
Returns 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:
getExternalSecurePort
in interfaceConfigManager
- Specified by:
getExternalSecurePort
in interfaceUnisonConfigManager
- Returns:
-
createAnonUser
public void createAnonUser(jakarta.servlet.http.HttpSession sharedSession) Description copied from interface:ConfigManager
Resets the session's state to an anonymous user- Specified by:
createAnonUser
in interfaceConfigManager
- Specified by:
createAnonUser
in interfaceUnisonConfigManager
- Parameters:
sharedSession
-
-
getAuthPath
Description copied from interface:ConfigManager
Returns the path to Unison's "auth" directory. If Unison is embedded this directory can be at different levels- Specified by:
getAuthPath
in interfaceConfigManager
- Specified by:
getAuthPath
in interfaceUnisonConfigManager
- Returns:
-
getAuthFormsPath
Description copied from interface:ConfigManager
Returns where Unison stores JSP pages for authentication (typically /auth/forms). If Unison is embedded this path may change.- Specified by:
getAuthFormsPath
in interfaceConfigManager
- Specified by:
getAuthFormsPath
in interfaceUnisonConfigManager
- Returns:
-
getAuthIdPPath
Description copied from interface:ConfigManager
Returns the path where Unison identity providers are configured. Typicaly /auth/idp however this may change if Unison is embedded.- Specified by:
getAuthIdPPath
in interfaceConfigManager
- Specified by:
getAuthIdPPath
in interfaceUnisonConfigManager
- Returns:
-
getPaasUserPrinicipalAttribute
Description copied from interface:ConfigManager
When Unison is embedded, returns the name of the user attribute that will act as the user identifier.- Specified by:
getPaasUserPrinicipalAttribute
in interfaceConfigManager
- Specified by:
getPaasUserPrinicipalAttribute
in interfaceUnisonConfigManager
- Returns:
-
setPaasUserPrinicipalAttribute
Description copied from interface:ConfigManager
When Unison is embedded, sets the name of the user attribute that will act as the user identifier.- Specified by:
setPaasUserPrinicipalAttribute
in interfaceConfigManager
- Specified by:
setPaasUserPrinicipalAttribute
in interfaceUnisonConfigManager
-
getPaasRoleAttribute
Description copied from interface:ConfigManager
When Unison is embedded, returns the name of the user attribute that will act as the roles identifier.- Specified by:
getPaasRoleAttribute
in interfaceConfigManager
- Specified by:
getPaasRoleAttribute
in interfaceUnisonConfigManager
- Returns:
-
setPaasRoleAttribute
Description copied from interface:ConfigManager
When Unison is embedded, sets the name of the user attribute that will act as the roles identifier.- Specified by:
setPaasRoleAttribute
in interfaceConfigManager
- Specified by:
setPaasRoleAttribute
in interfaceUnisonConfigManager
-
getContextPath
Description copied from interface:ConfigManager
Returns the context path for Unison- Specified by:
getContextPath
in interfaceConfigManager
- Specified by:
getContextPath
in interfaceUnisonConfigManager
- Returns:
-
getContext
public jakarta.servlet.ServletContext getContext()Description copied from interface:ConfigManager
Returns Unison's servlet context- Specified by:
getContext
in interfaceConfigManager
- Specified by:
getContext
in interfaceUnisonConfigManager
- Returns:
-
getAuthManager
- Specified by:
getAuthManager
in interfaceConfigManager
-
getGlobalHttpClientConfig
public org.apache.http.client.config.RequestConfig getGlobalHttpClientConfig()Description copied from interface:ConfigManager
Returns the global htto client configuration- Specified by:
getGlobalHttpClientConfig
in interfaceConfigManager
- Returns:
-
getHttpClientSocketRegistry
public org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> getHttpClientSocketRegistry()Description copied from interface:ConfigManager
Returns the protocol registry for the http client- Specified by:
getHttpClientSocketRegistry
in interfaceConfigManager
- Returns:
-
loadMyVD
-
getCustomAuthorizations
Description copied from interface:ConfigManager
Returns a map of custom authorization implementations and names- Specified by:
getCustomAuthorizations
in interfaceConfigManager
- Returns:
-
getSSLContext
Description copied from interface:ConfigManager
Returns the SSLContext- Specified by:
getSSLContext
in interfaceConfigManager
- Returns:
-
addResultGroup
- Specified by:
addResultGroup
in interfaceConfigManager
-
removeResultGroup
- Specified by:
removeResultGroup
in interfaceConfigManager
-
addCustomerAuthorization
- Specified by:
addCustomerAuthorization
in interfaceConfigManager
-
removeCustomAuthorization
- Specified by:
removeCustomAuthorization
in interfaceConfigManager
-
getAuthFailMechanism
- Specified by:
getAuthFailMechanism
in interfaceConfigManager
-
addAuthenticationMechanism
- Specified by:
addAuthenticationMechanism
in interfaceConfigManager
-
removeAuthenticationMechanism
- Specified by:
removeAuthenticationMechanism
in interfaceConfigManager
-
getAuthFailChain
- Specified by:
getAuthFailChain
in interfaceConfigManager
-