public class SimplePDP extends Object
As of the 2.0 release, this has been moved into the new support tree of the codebase. It has also been updated to use several of the new finder modules provided in the support tree codebase, so that static and dynamic references are supported, policies can be loaded from URLs, top-level policies are wrapped in a policy set when more than one applies, etc.
If you don't use a configuration file, then the default modules can all optionally support schema validation. To turn this on, provide the filename of the schema file in the property "com.sun.xacml.PolicySchema". You can also turn this on if you use a configuration file and it includes the modules provided in the support package.
Constructor and Description |
---|
SimplePDP()
Default constructor.
|
SimplePDP(String[] policies)
Constructor that takes an array of filenames and URLs, each of which
points to an XACML policy, and sets up a
PDP with access
to these policies only. |
Modifier and Type | Method and Description |
---|---|
ResponseCtx |
evaluate(String requestFile)
Evaluates the given request and returns the Response that the PDP
will hand back to the PEP.
|
static void |
main(String[] args)
Main-line driver for this sample code.
|
public SimplePDP() throws Exception
SimplePDP
with a
PDP
based on the configuration defined by the runtime
property com.sun.xcaml.PDPConfigFile.Exception
public SimplePDP(String[] policies) throws Exception
PDP
with access
to these policies only. These policies may be accessed based on
context matching or by reference (based on their policy identifiers).
The PDP
is also setup to support dynamic URL references.policies
- an arry of filenames and URLs that specify policiesException
public ResponseCtx evaluate(String requestFile) throws IOException, ParsingException
requestFile
- the name of a file that contains a RequestIOException
- if there is a problem accessing the fileParsingException
- if the Request is invalidpublic static void main(String[] args) throws Exception
args
- the input arguments to the class. They are either the
flag "-config" followed by a request file, or a request
file followed by one or more policy files. In the case
that the configuration flag is used, the configuration
file must be specified in the standard java property,
com.sun.xacml.PDPConfigFile.Exception
Copyright © 2023 JBoss by Red Hat. All rights reserved.