@Extension @Symbol(value="reverseProxy") public class ReverseProxySetupMonitor extends AdministrativeMonitor
Have the JavaScript make an AJAX call, to which we respond with 302 redirect. If the reverse proxy
is done correctly, this will be handled by web methods, but otherwise we'll report that as an error.
Unfortunately, XmlHttpRequest
doesn't expose properties that allow the client-side JavaScript
to learn the details of the failure, so we have to make do with limited information.
ExtensionPoint.LegacyInstancesAreScopedToHudson
id
Constructor and Description |
---|
ReverseProxySetupMonitor() |
Modifier and Type | Method and Description |
---|---|
org.kohsuke.stapler.HttpResponse |
doAct(String no)
Depending on whether the user said "yes" or "no", send him to the right place.
|
org.kohsuke.stapler.HttpResponse |
doTest(org.kohsuke.stapler.StaplerRequest request,
boolean testWithContext) |
String |
getDisplayName() |
Permission |
getRequiredPermission()
Required permission to view this admin monitor.
|
void |
getTestForReverseProxySetup(String rest) |
boolean |
isActivated()
Returns true if this monitor is activated and
wants to produce a warning message.
|
all, disable, doDisable, getSearchUrl, getTarget, getUrl, isEnabled, isSecurity
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
public boolean isActivated()
AdministrativeMonitor
This method is called from the HTML rendering thread, so it should run efficiently.
isActivated
in class AdministrativeMonitor
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.235") public org.kohsuke.stapler.HttpResponse doTest(org.kohsuke.stapler.StaplerRequest request, @QueryParameter boolean testWithContext)
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.235") @StaplerDispatchable public void getTestForReverseProxySetup(String rest)
public Permission getRequiredPermission()
AdministrativeMonitor
Jenkins.ADMINISTER
, but Jenkins.SYSTEM_READ
is also supported.
Changing this permission check to return Jenkins.SYSTEM_READ
will make the active
administrative monitor appear on manage.jelly
and on the globally visible
AdministrativeMonitorsDecorator
to users without Administer permission.
AdministrativeMonitor.doDisable(StaplerRequest, StaplerResponse)
will still always require Administer permission.
Implementers need to ensure that doAct
and other web methods perform necessary permission checks:
Users with System Read permissions are expected to be limited to read-only access.
Form UI elements that change system state, e.g. toggling a feature on or off, need to be hidden from users
lacking Administer permission.
getRequiredPermission
in class AdministrativeMonitor
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.235") public org.kohsuke.stapler.HttpResponse doAct(@QueryParameter String no) throws IOException
IOException
public String getDisplayName()
getDisplayName
in interface ModelObject
getDisplayName
in class AdministrativeMonitor
Copyright © 2004–2021. All rights reserved.