|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.security.XProcSecurityManager
public class XProcSecurityManager
This class is used to implement security management to protect your system
against possible threats from running third party XProc pipelines or while
developing new XProc pipeline. For a detailed description on how security management
in MorganaXProc
works and how you can customize it, see the documentation.
Nested Class Summary | |
---|---|
static class |
XProcSecurityManager.Operations
This enumeration lists the individual operation for which security controls will be performed. |
static class |
XProcSecurityManager.Strategies
The basic security strategies implemented by XProcSecurityManager |
Field Summary | |
---|---|
static XProcSecurityManager.Operations[] |
ALL_HTTP_OPERATIONS
A convenience definition: An array with all defined http-operations. |
static XProcSecurityManager.Operations[] |
ALL_OPERATIONS
A convenience definition: An array with all defined operations. |
Constructor Summary | |
---|---|
XProcSecurityManager(XProcSecurityManager.Strategies strategy)
Constructs a new XProcSecurityManager with the given strategy. |
Method Summary | |
---|---|
void |
addSecurityControl(XProcSecurityManager.Operations[] operations,
java.lang.String resourcePath,
boolean allowed)
Adds security control for a list of operations to this XProcSecurityManager . |
void |
addSecurityControl(XProcSecurityManager.Operations operation,
java.lang.String resourcePath,
boolean allowed)
Adds a new security control to this XProcSecurityManager . |
boolean |
checkJavaLoadAllowed()
Returns whether an XProc pipeline is allowed to load a step implementation via "java" attribute or not. |
XProcSecurityManager |
copy()
Return a deep copy of this XProcSecurityManager so that changes to one of
them does not affect the other. |
static java.lang.String |
correctURI(java.lang.String uri)
Corrects the uri given with the string for file-scheme to the standard form of "file:///" |
void |
doSecurityControl(XProcSecurityManager.Operations operation,
java.lang.String resourcePath)
Performs a security control for the given operation and the given resourcePath . |
java.util.List<nu.xom.Element> |
getSecurityControls()
Return a list of xom elements each of them containing one security control set to the security manager. |
XProcSecurityManager.Strategies |
getStrategy()
Return the strategy currently used by the XProcSecurityManager |
static XProcSecurityManager.Operations |
makeOperationFromMethod(java.lang.String op)
Returns the operation for this string representation |
void |
setJavaLoadAllowed(boolean value)
Controls whether a XProc pipeline is allowed to load a step via the "java" attribute. |
void |
setSecurityControl(nu.xom.Element e)
Sets the security controls in this XProcSecurityManager via a
xom element. |
void |
setSecurityControl(nu.xom.Elements elements)
Sets the security controls in this XProcSecurityManager via a list of
xom elements. |
void |
setSecurityControl(java.util.List<nu.xom.Element> elements)
Sets the security controls in this XProcSecurityManager via a list of
xom elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final XProcSecurityManager.Operations[] ALL_OPERATIONS
public static final XProcSecurityManager.Operations[] ALL_HTTP_OPERATIONS
Constructor Detail |
---|
public XProcSecurityManager(XProcSecurityManager.Strategies strategy)
XProcSecurityManager
with the given strategy. If strategy is null, an
authorian strategy is used. By default java loading of steps in XProc pipeline is not allowed.
strategy
- the basic strategy to use in this XProcSecurityManager
.Method Detail |
---|
public final XProcSecurityManager copy()
XProcSecurityManager
so that changes to one of
them does not affect the other.
XProcSecurityManager
.public void setJavaLoadAllowed(boolean value)
value
- true
to allow step loading, false
to forbid it.public XProcSecurityManager.Strategies getStrategy()
XProcSecurityManager
public java.util.List<nu.xom.Element> getSecurityControls()
public void setSecurityControl(nu.xom.Elements elements) throws XProcSecurityException
XProcSecurityManager
via a list of
xom elements. See the documentation for this method.
elements
- the security controls to add to this XProcSecurityManager
.
XProcSecurityException
- if elements
does not contain proper security rules.public void setSecurityControl(java.util.List<nu.xom.Element> elements) throws XProcSecurityException
XProcSecurityManager
via a list of
xom elements. See the documentation for this method.
elements
- the security controls to add to this XProcSecurityManager
.
XProcSecurityException
- if elements
does not contain proper security rules.public void setSecurityControl(nu.xom.Element e) throws XProcSecurityException
XProcSecurityManager
via a
xom element. See the documentation for this method.
e
- the security control to add to this SecurityManager
XProcSecurityException
public void addSecurityControl(XProcSecurityManager.Operations operation, java.lang.String resourcePath, boolean allowed)
XProcSecurityManager
. Ignored if operation
or resourcePath
is null.
operation
- the operation for which the control applies.resourcePath
- the path (fragment) for which the control applies.allowed
- true
if the operation is allowed, otherwise false
.public void addSecurityControl(XProcSecurityManager.Operations[] operations, java.lang.String resourcePath, boolean allowed)
XProcSecurityManager
. Ignored if
operations
is null or resourcePath
is null.
operations
- an array with the operations for which the control applies.resourcePath
- the path (fragment) for which the control applies.allowed
- true
if the operation is allowed, otherwise false
.public final boolean checkJavaLoadAllowed()
true
if java load is allowed.public final void doSecurityControl(XProcSecurityManager.Operations operation, java.lang.String resourcePath) throws XProcSecurityException
operation
and the given resourcePath
. If
the operation is not allowed for the path, an XProcSecurityException
is thrown. An
XProcSecurityException
is also thrown, if operation
or resourcePath
is null.
operation
- the operation to check for.resourcePath
- the path (fragment) to check for.
XProcSecurityException
- if the operation is forbidden on this path, or if operation
or
resourcePath
is null.public static XProcSecurityManager.Operations makeOperationFromMethod(java.lang.String op)
op
- a string representation of an operation.
op
is null or not found.public static java.lang.String correctURI(java.lang.String uri)
uri
- a string
uri
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |