Class AllowedResourceAliasChecker
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.AllowedResourceAliasChecker
- All Implemented Interfaces:
ContextHandler.AliasCheck, LifeCycle
- Direct Known Subclasses:
SymlinkAllowedResourceAliasChecker
public class AllowedResourceAliasChecker
extends 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 ClassesModifier and TypeClassDescriptionprivate classNested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Pathprivate final ContextHandlerprotected static final LinkOption[]private static final Loggerprotected static final LinkOption[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanCheck an aliasprotected voiddoStart()protected voiddoStop()protected ContextHandlerprotected Pathprivate static PathgetRealPath(Path path) protected voidprotected booleanprotected booleanisSameFile(Path path1, Path path2) toString()Methods inherited from class AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
Field Details
-
LOG
-
FOLLOW_LINKS
-
NO_FOLLOW_LINKS
-
_contextHandler
-
_protected
-
_listener
-
_base
-
-
Constructor Details
-
AllowedResourceAliasChecker
- Parameters:
contextHandler- the context handler to use.
-
-
Method Details
-
getContextHandler
-
initialize
protected void initialize() -
doStart
- Overrides:
doStartin classAbstractLifeCycle- Throws:
Exception
-
doStop
- Overrides:
doStopin classAbstractLifeCycle- 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
-
getRealPath
-
getPath
-
toString
- Overrides:
toStringin classAbstractLifeCycle
-