This repository includes both the project with all the source code and tests code, as well as an executable fat-jar file, sufficient for running the program.
- Download the jar from the repository or clone the whole repository
- Navigate to the location of the .jar file
-
java -jar ./remitly-verifier-1.0.jar <path-to-JSON-policy-file>
You can use the jar file as a Java library. Add it to your project and then you can use it like this:
import remitly.verify.IncorrectPolicyFormatException;
import remitly.verify.RolePolicyVerifier;
import java.io.FileNotFoundException;
public class Main {
public static void main(String[] args) {
RolePolicyVerifier verifier = null;
try {
verifier = new RolePolicyVerifier("src/policy.json");
boolean result = verifier.verifyPolicy();
System.out.println("Policy verification result: " + result);
} catch (FileNotFoundException | IncorrectPolicyFormatException e) {
System.err.println(e.getMessage());
e.printStackTrace();
}
}
}- Java Oracle OpenJDK version 17
- Gson 2.10.1
- JUnit 5.9.0
- Maven 3
