public abstract class AbstractLockedDomainService extends Object implements LockedDomainService
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LOCKED_DOMAIN_FEATURE |
protected static String |
LOCKED_DOMAIN_REQUIRED_KEY |
protected static String |
PERMITTED_REFERER_DOMAINS_KEY |
protected Map<String,List<Object>> |
permittedRefererDomains |
protected Map<String,Boolean> |
required |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLockedDomainService(ContainerConfig config,
boolean enabled)
Create a LockedDomainService.
|
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getLockedDomainForGadget(Gadget gadget,
String container)
Calculate the locked domain for a particular gadget on a particular
container.
|
protected boolean |
isDomainLockingEnforced(String container)
Returns true if domain locking is enforced for every gadget by the container
|
boolean |
isEnabled()
Check whether locked domains feature is enabled on the server.
|
protected boolean |
isExcludedFromLockedDomain(Gadget gadget,
String container)
Override methods for custom behavior Allows you to override locked domain feature requests from
a gadget.
|
protected boolean |
isGadgetReqestingLocking(Gadget gadget)
Returns true if the gadget is requesting to be on a locked domain.
|
abstract boolean |
isGadgetValidForHost(String host,
Gadget gadget,
String container)
Check whether a gadget should be allowed to render on a particular
host.
|
abstract boolean |
isHostUsingLockedDomain(String host)
Check whether a host is using a locked domain.
|
boolean |
isRefererCheckEnabled() |
boolean |
isSafeForOpenProxy(String host) |
protected boolean |
isValidReferer(Gadget gadget,
String container)
Check whether the referer value in the request head is in the permitted referer domain list or not.
|
void |
setLockSecurityTokens(Boolean lockSecurityTokens)
Allows a renderer to render all gadgets that require a security token on a locked domain.
|
void |
setRefererCheckEnabled(boolean refererCheckEnabled) |
protected static final String LOCKED_DOMAIN_REQUIRED_KEY
protected static final String PERMITTED_REFERER_DOMAINS_KEY
protected static final String LOCKED_DOMAIN_FEATURE
protected AbstractLockedDomainService(ContainerConfig config, boolean enabled)
config - the container config that will be observedenabled - true if locked domains are enabled; false otherwise@Inject public void setRefererCheckEnabled(boolean refererCheckEnabled)
public abstract String getLockedDomainForGadget(Gadget gadget, String container) throws GadgetException
LockedDomainServicegetLockedDomainForGadget in interface LockedDomainServicegadget - URL of the gadgetcontainer - name of the container pageGadgetExceptionpublic boolean isEnabled()
LockedDomainServiceisEnabled in interface LockedDomainServicepublic abstract boolean isGadgetValidForHost(String host, Gadget gadget, String container)
LockedDomainServiceisGadgetValidForHost in interface LockedDomainServicehost - host name for the contentgadget - URL of the gadgetcontainer - containerpublic abstract boolean isHostUsingLockedDomain(String host)
LockedDomainServiceisHostUsingLockedDomain in interface LockedDomainServicehost - Host to inspect for locked domain suffix.public boolean isSafeForOpenProxy(String host)
isSafeForOpenProxy in interface LockedDomainServicepublic boolean isRefererCheckEnabled()
isRefererCheckEnabled in interface LockedDomainService@Inject(optional=true) public void setLockSecurityTokens(Boolean lockSecurityTokens)
lockSecurityTokens - If true, locks domains for all gadgets requiring security-token.protected boolean isDomainLockingEnforced(String container)
container - the container configuration, e.g., "default"protected boolean isExcludedFromLockedDomain(Gadget gadget, String container)
protected boolean isGadgetReqestingLocking(Gadget gadget)
setLockSecurityTokens(Boolean), this method will return true if
the gadget is explicitly or implicitly requesting locked domains; otherwise, this will return
true only if the gadget is explicitly requesting locked domains.gadget - the gadgetCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.