Package jenkins.security
Class ResourceDomainConfiguration
- java.lang.Object
-
- hudson.model.Descriptor<GlobalConfiguration>
-
- jenkins.model.GlobalConfiguration
-
- jenkins.security.ResourceDomainConfiguration
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,OnMaster
@Extension(ordinal=199.0) @Restricted(org.kohsuke.accmod.restrictions.Beta.class) @Symbol("resourceRoot") public final class ResourceDomainConfiguration extends GlobalConfiguration
Configure the resource root URL, an alternative root URL to serve resources from to not need Content-Security-Policy headers, which mess with desired complex output.- Since:
- 2.200, unrestricted since 2.203
- See Also:
ResourceDomainFilter
,ResourceDomainRootAction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description ResourceDomainConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FormValidation
doCheckUrl(String resourceRootUrlString)
static ResourceDomainConfiguration
get()
String
getUrl()
static boolean
isResourceDomainConfigured()
Returns true if and only if a domain has been configured to serve resource URLs fromstatic boolean
isResourceRequest(javax.servlet.http.HttpServletRequest req)
Returns true if and only if this is a request to URLs under the resource root URL.void
setUrl(String url)
-
Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPage
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
doCheckUrl
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @POST public FormValidation doCheckUrl(@QueryParameter("url") String resourceRootUrlString)
-
getUrl
@CheckForNull public String getUrl()
-
setUrl
public void setUrl(@CheckForNull String url)
-
isResourceRequest
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isResourceRequest(javax.servlet.http.HttpServletRequest req)
Returns true if and only if this is a request to URLs under the resource root URL. For this to be the case, the requested host and port (from the Host HTTP request header) must match what is configured for the resource root URL.- Parameters:
req
- the request to check- Returns:
- whether the request is a resource URL request
-
isResourceDomainConfigured
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isResourceDomainConfigured()
Returns true if and only if a domain has been configured to serve resource URLs from- Returns:
- whether a domain has been configured
-
get
public static ResourceDomainConfiguration get()
-
-