com.atlassian.confluence.security.trust
Class DefaultTrustedApplicationsManager

java.lang.Object
  extended by com.atlassian.confluence.security.trust.DefaultTrustedApplicationsManager
All Implemented Interfaces:
KeyPairInitialiser, TrustedApplicationsManager, TrustedTokenFactory, com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager

public class DefaultTrustedApplicationsManager
extends Object
implements TrustedApplicationsManager, KeyPairInitialiser, TrustedTokenFactory, com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager

Manager to support trusted communications between applications


Field Summary
protected  org.apache.log4j.Logger log
          Deprecated. since 3.1, use private logger
 
Constructor Summary
DefaultTrustedApplicationsManager()
           
 
Method Summary
 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 instance
 TrustedToken getToken()
          Deprecated. since 5.3.3 use getToken(String url) instead. A url is required for signing in the v2 or v3 protocols of Trusted Apps. v0 and v1 of the protocol which do not require the URL have been removed from Trusted Apps v3.0.2
 TrustedToken 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

@Deprecated
protected final org.apache.log4j.Logger log
Deprecated. since 3.1, use private logger
Constructor Detail

DefaultTrustedApplicationsManager

public DefaultTrustedApplicationsManager()
Method Detail

saveTrustedApplication

public void saveTrustedApplication(ConfluenceTrustedApplication trustedApplication)
Specified by:
saveTrustedApplication in interface TrustedApplicationsManager

deleteTrustedApplication

public void deleteTrustedApplication(ConfluenceTrustedApplication trustedApplication)
Specified by:
deleteTrustedApplication in interface TrustedApplicationsManager

getTrustedApplicationByAlias

public ConfluenceTrustedApplication getTrustedApplicationByAlias(String alias)
Specified by:
getTrustedApplicationByAlias in interface TrustedApplicationsManager

getToken

@Deprecated
public TrustedToken getToken()
Deprecated. since 5.3.3 use getToken(String url) instead. A url is required for signing in the v2 or v3 protocols of Trusted Apps. v0 and v1 of the protocol which do not require the URL have been removed from Trusted Apps v3.0.2

Generates a token for the currently authenticated user. Note that the token has an embedded timestamp of generation. When transmitting this token to other applications it is important to note that the receiving server may impose age limits when accepting tokens. Thus it is important to use the token as soon as possible after retrieving it.

Specified by:
getToken in interface TrustedTokenFactory
Returns:
a trusted token for the current user

getToken

public TrustedToken getToken(String url)
Specified by:
getToken in interface TrustedTokenFactory
Parameters:
url - the request url to get a token for.
Returns:
A token appropriate for the current user context and request url.

getAllTrustedApplications

public Collection<ConfluenceTrustedApplication> getAllTrustedApplications()
Description copied from interface: TrustedApplicationsManager
Return a list of all the trusted application aliases.

Specified by:
getAllTrustedApplications in interface TrustedApplicationsManager

getCurrentApplication

public com.atlassian.security.auth.trustedapps.CurrentApplication getCurrentApplication()
Return the public and private keys for the currently running instance

Specified by:
getCurrentApplication in interface TrustedApplicationsManager
Returns:
application representing the current instance

initConfluenceKey

public void initConfluenceKey()
                       throws NoSuchProviderException,
                              NoSuchAlgorithmException
Specified by:
initConfluenceKey in interface KeyPairInitialiser
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

public ConfluenceTrustedApplication getTrustedApplication(long id)
Specified by:
getTrustedApplication in interface TrustedApplicationsManager

getTrustedApplicationByName

public ConfluenceTrustedApplication getTrustedApplicationByName(String applicationName)
Specified by:
getTrustedApplicationByName in interface TrustedApplicationsManager

getApplicationCertificate

public com.atlassian.security.auth.trustedapps.Application getApplicationCertificate(String baseUrl)
                                                                              throws com.atlassian.security.auth.trustedapps.ApplicationRetriever.RetrievalException

Specified by:
getApplicationCertificate in interface com.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 interface com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager

deleteApplication

public boolean deleteApplication(String id)

Specified by:
deleteApplication in interface com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager

getTrustedApplications

public Iterable<com.atlassian.security.auth.trustedapps.TrustedApplication> getTrustedApplications()

Specified by:
getTrustedApplications in interface com.atlassian.security.auth.trustedapps.TrustedApplicationsConfigurationManager


Copyright © 2003–2015 Atlassian. All rights reserved.