java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.AllowedResourceAliasChecker
- All Implemented Interfaces:
ContextHandler.AliasCheck,org.eclipse.jetty.util.component.LifeCycle
- Direct Known Subclasses:
SymlinkAllowedResourceAliasChecker
public class AllowedResourceAliasChecker
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements ContextHandler.AliasCheck
This will approve any alias to anything inside of the ContextHandlers resource base which
is not protected by a protected target as defined by ContextHandler.getProtectedTargets() at start.
Aliases approved by this may still be able to bypass SecurityConstraints, so this class would need to be extended to enforce any additional security constraints that are required.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Pathprotected static final LinkOption[]protected static final LinkOption[]Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPING -
Constructor Summary
ConstructorsConstructorDescriptionAllowedResourceAliasChecker(ContextHandler contextHandler) AllowedResourceAliasChecker(ContextHandler contextHandler, Supplier<org.eclipse.jetty.util.resource.Resource> resourceBaseSupplier) AllowedResourceAliasChecker(ContextHandler contextHandler, org.eclipse.jetty.util.resource.Resource baseResource) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanCheck an aliasprotected voiddoStart()protected voiddoStop()protected ContextHandlerprotected PathgetPath(org.eclipse.jetty.util.resource.Resource resource) protected voidprotected booleanprotected booleanisSameFile(Path path1, Path path2) toString()Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addEventListener, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop
-
Field Details
-
FOLLOW_LINKS
-
NO_FOLLOW_LINKS
-
_base
-
-
Constructor Details
-
AllowedResourceAliasChecker
- Parameters:
contextHandler- the context handler to use.
-
AllowedResourceAliasChecker
public AllowedResourceAliasChecker(ContextHandler contextHandler, org.eclipse.jetty.util.resource.Resource baseResource) -
AllowedResourceAliasChecker
public AllowedResourceAliasChecker(ContextHandler contextHandler, Supplier<org.eclipse.jetty.util.resource.Resource> resourceBaseSupplier)
-
-
Method Details
-
getContextHandler
-
initialize
protected void initialize() -
doStart
- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
check
Description copied from interface:ContextHandler.AliasCheckCheck an alias- Specified by:
checkin interfaceContextHandler.AliasCheck- Parameters:
pathInContext- The path the aliased resource was created forresource- The aliased resourced- Returns:
- True if the resource is OK to be served.
-
check
-
isAllowed
-
isSameFile
-
getPath
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-