public class

ConsumerConfigurationServlet

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.ConsumerConfigurationServlet

Class Overview

Servlet to configure Trusted Applications in the role as consumer (a.k.a. outbound requests to a remote host).

Renders the the outbound trusted apps configuration screen, which contains a checkbox to enable/disable trusted requests into the remote application.

When the user enables trusted apps for the Applink at hand, this servlet will first redirect to the Trusted Apps Reciprocal Servlet on the peer which will download the certificate from us and store it locally, or delete our certificate if we sent the action=disable parameter. It will then redirect the browser back to us here, indicating whether or not it was able to perform the requested action by adding result=[success|failure] to the URL's query parameters. If successful, we will set the flag in AuthenticationConfigurationManager to indicate that Trusted Apps is enabled for outbound requests (or remove the check if the action was to disable). Alternatively, if the peer reported failure, we will not make any local state changes, but render an appropriate error.

Registered under:
  • /plugins/servlet/applinks/auth/conf/trusted/outbound-ual/{application_id}
  • /plugins/servlet/applinks/auth/conf/trusted/outbound-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
ConsumerConfigurationServlet(I18nResolver i18nResolver, TemplateRenderer templateRenderer, AdminUIAuthenticator adminUIAuthenticator, WebResourceManager webResourceManager, AuthenticationConfigurationManager configurationManager, ApplicationLinkService applicationLinkService, MessageFactory messageFactory, TrustedApplicationsManager trustedApplicationsManager, TrustedApplicationsConfigurationManager trustedAppsManager, InternalHostApplication hostApplication, TrustConfigurator trustConfigurator, BatchedJSONi18NBuilderFactory batchedJSONi18NBuilderFactory, LoginUriProvider loginUriProvider, DocumentationLinker documentationLinker, WebSudoManager webSudoManager, XsrfTokenAccessor xsrfTokenAccessor, XsrfTokenValidator xsrfTokenValidator)
Protected Methods
void doGet(HttpServletRequest request, HttpServletResponse response)
void doPost(HttpServletRequest request, HttpServletResponse response)
Posted to by the form for outbound Trusted Applications with legacy (non-UAL) peers.
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 ConsumerConfigurationServlet (I18nResolver i18nResolver, TemplateRenderer templateRenderer, AdminUIAuthenticator adminUIAuthenticator, WebResourceManager webResourceManager, AuthenticationConfigurationManager configurationManager, ApplicationLinkService applicationLinkService, MessageFactory messageFactory, TrustedApplicationsManager trustedApplicationsManager, TrustedApplicationsConfigurationManager trustedAppsManager, 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)

Throws
ServletException
IOException

protected void doPost (HttpServletRequest request, HttpServletResponse response)

Posted to by the form for outbound Trusted Applications with legacy (non-UAL) peers.

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