Commit ba52aac0 authored by cdanger's avatar cdanger

- Updated licence headers for 2018

- Fixed #9 (github) and added unit tests
parent 5c7fb4be
......@@ -76,12 +76,16 @@ Java (JRE) 8 or later.
## Usage
### Getting started
#### CLI
Get the latest executable jar from Maven Central: groupId/artifactId = `org.ow2.authzforce`/`authzforce-ce-core-pdp-cli`.
Get the latest executable jar from Maven Central: groupId/artifactId = `org.ow2.authzforce`/`authzforce-ce-core-pdp-cli` and make sure you are allowed to run it (it is a fully executable JAR), e.g. with command:
```
$ chmod a+x authzforce-ce-core-pdp-cli-10.0.0.jar
```
Copy the content of [that folder](pdp-cli/src/test/resources/conformance/xacml-3.0-core/mandatory) to the same directory, and run the executable as follows:
```
$ ./authzforce-ce-core-pdp-cli-10.0.0.jar pdp.xml request.xml
$ ./authzforce-ce-core-pdp-cli-10.0.0.jar pdp.xml IIA001/Request.xml
```
* `pdp.xml`: PDP configuration file, that defines the location(s) of XACML policy(ies), among other PDP engine parameters; this content of this file is a XML document compliant with the PDP configuration [XML schema](pdp-engine/src/main/resources/pdp.xsd), so you can read the documentation of every configuration parameter in that schema file;
......@@ -89,7 +93,7 @@ $ ./authzforce-ce-core-pdp-cli-10.0.0.jar pdp.xml request.xml
If you want to test the JSON Profile of XACML 3.0, run it with extra option `-t XACML_JSON`:
```
$ ./authzforce-ce-core-pdp-cli-10.0.0.jar -t XACML_JSON pdp.xml request.json
$ ./authzforce-ce-core-pdp-cli-10.0.0.jar -t XACML_JSON pdp.xml IIA001/Request.json
```
* `request.json`: XACML request in XACML 3.0/JSON (Profile) format.
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ow2.authzforce.core.pdp.cli.test;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.ow2.authzforce.core.pdp.cli.PdpCommandLineCallable;
import picocli.CommandLine;
public class CliTest
{
private static final String TEST_DATA_DIR = "src/test/resources/conformance/xacml-3.0-core/mandatory";
@Test
public void test()
{
/*
* Should throw IllegalArgumentException for invalid pdp config, not NPE (because of relative path with no
* parent path which used to cause NPE when trying to get the parent directory path)
*/
CommandLine.call(new PdpCommandLineCallable(), System.out, TEST_DATA_DIR + "/pdp.xml",
TEST_DATA_DIR + "/IIA001/Request.xml");
}
/**
* Non-regression test for https://github.com/authzforce/core/issues/9
*/
@Test
public void IssueGH9()
{
/*
* Should throw IllegalArgumentException for invalid pdp config, not NPE (because of relative path with no
* parent path which used to cause NPE when trying to get the parent directory path)
*/
try
{
CommandLine.call(new PdpCommandLineCallable(), System.out, "pom.xml",
TEST_DATA_DIR + "/IIA001/Request.xml");
}
catch (final CommandLine.ExecutionException e)
{
assertTrue(e.getCause().getClass() == IllegalArgumentException.class);
}
}
}
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.
*
* This file is part of AuthzForce CE.
*
......
/**
* Copyright 2012-2017 Thales Services SAS.
* Copyright 2012-2018 Thales Services SAS.