Class DefaultTrustedApplicationsManager
- java.lang.Object
-
- com.atlassian.confluence.security.trust.DefaultTrustedApplicationsManager
-
- All Implemented Interfaces:
KeyPairInitialiser
,TrustedApplicationsManager
,TrustedTokenFactory
,com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager
@Transactional public class DefaultTrustedApplicationsManager extends Object implements TrustedApplicationsManager, KeyPairInitialiser, TrustedTokenFactory, com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager
Manager to support trusted communications between applications
-
-
Constructor Summary
Constructors Constructor Description DefaultTrustedApplicationsManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.atlassian.security.auth.trustedapps.TrustedApplication
addTrustedApplication(com.atlassian.security.auth.trustedapps.Application in, com.atlassian.security.auth.trustedapps.RequestConditions conditions)
boolean
deleteApplication(String id)
void
deleteTrustedApplication(ConfluenceTrustedApplication trustedApplication)
Collection<ConfluenceTrustedApplication>
getAllTrustedApplications()
Return a list of all the trusted application aliases.com.atlassian.security.auth.trustedapps.Application
getApplicationCertificate(String baseUrl)
com.atlassian.security.auth.trustedapps.CurrentApplication
getCurrentApplication()
Return the public and private keys for the currently running instanceTrustedToken
getToken(String url)
ConfluenceTrustedApplication
getTrustedApplication(long id)
ConfluenceTrustedApplication
getTrustedApplicationByAlias(String alias)
ConfluenceTrustedApplication
getTrustedApplicationByName(String applicationName)
Iterable<com.atlassian.security.auth.trustedapps.TrustedApplication>
getTrustedApplications()
void
initConfluenceKey()
void
saveTrustedApplication(ConfluenceTrustedApplication trustedApplication)
void
setAsymmetricKeyFactory(AsymmetricKeyFactory asymmetricKeyFactory)
void
setCurrentApplicationIdProvider(CurrentApplicationIdProvider currentApplicationIdProvider)
void
setEncryptionProvider(com.atlassian.security.auth.trustedapps.EncryptionProvider encryptionProvider)
void
setKeyStoreDao(KeyStore keyStoreDao)
void
setTrustedApplicationDao(TrustedApplicationDao trustedApplicationDao)
-
-
-
Method Detail
-
saveTrustedApplication
public void saveTrustedApplication(ConfluenceTrustedApplication trustedApplication)
- Specified by:
saveTrustedApplication
in interfaceTrustedApplicationsManager
-
deleteTrustedApplication
public void deleteTrustedApplication(ConfluenceTrustedApplication trustedApplication)
- Specified by:
deleteTrustedApplication
in interfaceTrustedApplicationsManager
-
getTrustedApplicationByAlias
@Transactional(readOnly=true) public ConfluenceTrustedApplication getTrustedApplicationByAlias(String alias)
- Specified by:
getTrustedApplicationByAlias
in interfaceTrustedApplicationsManager
-
getToken
@Transactional(readOnly=true) public TrustedToken getToken(String url)
- Specified by:
getToken
in interfaceTrustedTokenFactory
- Parameters:
url
- the request url to get a token for.- Returns:
- A token appropriate for the current user context and request url.
-
getAllTrustedApplications
@Transactional(readOnly=true) public Collection<ConfluenceTrustedApplication> getAllTrustedApplications()
Description copied from interface:TrustedApplicationsManager
Return a list of all the trusted application aliases.- Specified by:
getAllTrustedApplications
in interfaceTrustedApplicationsManager
-
getCurrentApplication
@Transactional(readOnly=true) public com.atlassian.security.auth.trustedapps.CurrentApplication getCurrentApplication()
Return the public and private keys for the currently running instance- Specified by:
getCurrentApplication
in interfaceTrustedApplicationsManager
- Returns:
- application representing the current instance
-
initConfluenceKey
public void initConfluenceKey() throws NoSuchProviderException, NoSuchAlgorithmException
- Specified by:
initConfluenceKey
in interfaceKeyPairInitialiser
- Throws:
NoSuchProviderException
NoSuchAlgorithmException
-
setKeyStoreDao
public void setKeyStoreDao(KeyStore keyStoreDao)
-
setTrustedApplicationDao
public void setTrustedApplicationDao(TrustedApplicationDao trustedApplicationDao)
-
setAsymmetricKeyFactory
public void setAsymmetricKeyFactory(AsymmetricKeyFactory asymmetricKeyFactory)
-
setEncryptionProvider
public void setEncryptionProvider(com.atlassian.security.auth.trustedapps.EncryptionProvider encryptionProvider)
-
setCurrentApplicationIdProvider
public void setCurrentApplicationIdProvider(CurrentApplicationIdProvider currentApplicationIdProvider)
-
getTrustedApplication
@Transactional(readOnly=true) public ConfluenceTrustedApplication getTrustedApplication(long id)
- Specified by:
getTrustedApplication
in interfaceTrustedApplicationsManager
-
getTrustedApplicationByName
@Transactional(readOnly=true) public ConfluenceTrustedApplication getTrustedApplicationByName(String applicationName)
- Specified by:
getTrustedApplicationByName
in interfaceTrustedApplicationsManager
-
getApplicationCertificate
@Transactional(readOnly=true) public com.atlassian.security.auth.trustedapps.Application getApplicationCertificate(String baseUrl) throws com.atlassian.security.auth.trustedapps.ApplicationRetriever.RetrievalException
- Specified by:
getApplicationCertificate
in interfacecom.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager
- Throws:
com.atlassian.security.auth.trustedapps.ApplicationRetriever.RetrievalException
-
addTrustedApplication
public com.atlassian.security.auth.trustedapps.TrustedApplication addTrustedApplication(com.atlassian.security.auth.trustedapps.Application in, com.atlassian.security.auth.trustedapps.RequestConditions conditions)
- Specified by:
addTrustedApplication
in interfacecom.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager
-
deleteApplication
public boolean deleteApplication(String id)
- Specified by:
deleteApplication
in interfacecom.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager
-
getTrustedApplications
@Transactional(readOnly=true) public Iterable<com.atlassian.security.auth.trustedapps.TrustedApplication> getTrustedApplications()
- Specified by:
getTrustedApplications
in interfacecom.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager
-
-