public class

ProviderConfigurationServlet

extends AbstractAuthServlet
java.lang.Object
   ↳ javax.servlet.GenericServlet
     ↳ javax.servlet.http.HttpServlet
       ↳ com.atlassian.applinks.ui.AbstractApplinksServlet
         ↳ com.atlassian.applinks.ui.AbstractAppLinksAdminOnlyServlet
           ↳ com.atlassian.applinks.core.auth.AbstractAuthServlet
             ↳ com.atlassian.applinks.core.auth.trusted.ProviderConfigurationServlet

Class Overview

Servlet to configure Trusted Applications in the role as provider (a.k.a. inbound requests from a remote host).

This servlet has two faces. The first is as the counterpart servlet for ConsumerConfigurationServlet. When the latter is used to enable incoming Trusted Apps requests, it will first redirect the browser to this servlet (running on the peer) which will attempt to register the caller as a trusted application in the Trusted Application's plugin by downloading the certificate from the caller.

If this servlet is successful in performing the requested action (either installing or removing te Trusted Apps certificate for the peer), it will redirect the browser back to the ConsumerConfigurationServlet running on the peer, passing along the result=[success|failure] query parameter. This redirection is done using the callback URL parameter that the caller (ConsumerConfigurationServlet) passed in the URL string.

Registered under: /plugins/servlet/applinks/auth/conf/trusted/inbound-ual/{application_id}?action=[ENABLE|DISABLE]&callback=http://full/url

The second task of this servlet is to locally configure Trusted Applications as a service provider for a non-UAL peer. In this scenario the servlet behaves like the old Trusted Applications configuration servlets that take a URL and download and install the peer's public key. In this mode will the servlet actually render output, while the former mode will always end in a redirect to the peer.

Registered under: /plugins/servlet/applinks/auth/conf/trusted/inbound-non-ual/{application_id}

Summary

Constants
String TRUSTED_APPS_INCOMING_ID
String VM_TEMPLATE
[Expand]
Inherited Constants
From class com.atlassian.applinks.ui.AbstractApplinksServlet
From interface com.atlassian.applinks.ui.XsrfProtectedServlet
Fields
protected final AuthenticationConfigurationManager configurationManager
protected final TrustConfigurator trustConfigurator
protected final TrustedApplicationsManager trustedApplicationsManager
protected final TrustedApplicationsConfigurationManager trustedAppsManager
[Expand]
Inherited Fields
From class com.atlassian.applinks.core.auth.AbstractAuthServlet
From class com.atlassian.applinks.ui.AbstractAppLinksAdminOnlyServlet
From class com.atlassian.applinks.ui.AbstractApplinksServlet
Public Constructors
ProviderConfigurationServlet(I18nResolver i18nResolver, TemplateRenderer templateRenderer, AdminUIAuthenticator adminUIAuthenticator, WebResourceManager webResourceManager, ApplicationLinkService applicationLinkService, MessageFactory messageFactory, TrustedApplicationsConfigurationManager trustedAppsManager, AuthenticationConfigurationManager configurationManager, TrustedApplicationsManager trustedApplicationsManager, InternalHostApplication hostApplication, TrustConfigurator trustConfigurator, BatchedJSONi18NBuilderFactory batchedJSONi18NBuilderFactory, LoginUriProvider loginUriProvider, DocumentationLinker documentationLinker, WebSudoManager webSudoManager, XsrfTokenAccessor xsrfTokenAccessor, XsrfTokenValidator xsrfTokenValidator)
Protected Methods
void doGet(HttpServletRequest request, HttpServletResponse response)
Unfortunately we have to support GET, because this servlet is invoked from a 302 redirect.
void doPost(HttpServletRequest request, HttpServletResponse response)
Posted to from the local inbound form to enable/disable inbound TA.
Action getAction(HttpServletRequest request)
List<String> getRequiredWebResources()
Implement this method to get one of more Plugin Web Resources included in the rendered page.
boolean peerHasUAL(HttpServletRequest request)
void render(HttpServletRequest request, HttpServletResponse response, String consumer, String consumerAppType, String provider, String providerAppType, boolean enabled, Map<StringObject> renderContext)
[Expand]
Inherited Methods
From class com.atlassian.applinks.core.auth.AbstractAuthServlet
From class com.atlassian.applinks.ui.AbstractAppLinksAdminOnlyServlet
From class com.atlassian.applinks.ui.AbstractApplinksServlet
From class javax.servlet.http.HttpServlet
From class javax.servlet.GenericServlet
From class java.lang.Object
From interface javax.servlet.Servlet
From interface javax.servlet.ServletConfig

Constants

public static final String TRUSTED_APPS_INCOMING_ID

Constant Value: "trustedapps.incoming.applicationId"

protected static final String VM_TEMPLATE

Constant Value: "auth/trusted/config.vm"

Fields

protected final AuthenticationConfigurationManager configurationManager

protected final TrustConfigurator trustConfigurator

protected final TrustedApplicationsManager trustedApplicationsManager

protected final TrustedApplicationsConfigurationManager trustedAppsManager

Public Constructors

public ProviderConfigurationServlet (I18nResolver i18nResolver, TemplateRenderer templateRenderer, AdminUIAuthenticator adminUIAuthenticator, WebResourceManager webResourceManager, ApplicationLinkService applicationLinkService, MessageFactory messageFactory, TrustedApplicationsConfigurationManager trustedAppsManager, AuthenticationConfigurationManager configurationManager, TrustedApplicationsManager trustedApplicationsManager, InternalHostApplication hostApplication, TrustConfigurator trustConfigurator, BatchedJSONi18NBuilderFactory batchedJSONi18NBuilderFactory, LoginUriProvider loginUriProvider, DocumentationLinker documentationLinker, WebSudoManager webSudoManager, XsrfTokenAccessor xsrfTokenAccessor, XsrfTokenValidator xsrfTokenValidator)

Protected Methods

protected void doGet (HttpServletRequest request, HttpServletResponse response)

Unfortunately we have to support GET, because this servlet is invoked from a 302 redirect.

Throws
ServletException
IOException

protected void doPost (HttpServletRequest request, HttpServletResponse response)

Posted to from the local inbound form to enable/disable inbound TA. This will also redirect to the peer to enable reciprocal outbound trust.

Throws
ServletException
IOException

protected Action getAction (HttpServletRequest request)

protected List<String> getRequiredWebResources ()

Implement this method to get one of more Plugin Web Resources included in the rendered page. Must not return null.

Returns
  • a list of web resource keys (e.g. "com.atlassian.applinks.applinks-plugin:basic-js")

protected boolean peerHasUAL (HttpServletRequest request)

protected void render (HttpServletRequest request, HttpServletResponse response, String consumer, String consumerAppType, String provider, String providerAppType, boolean enabled, Map<StringObject> renderContext)

Throws
IOException