Follow these Java coding guidelines:
- Google Java Style Guide, except braces must follow the Allman style instead of K & R style;
- Effective Java, Second Edition, by Joshua Bloch;
- Oracle Secure Coding Guidelines for Java SE.
For every new major functionality, there must be unit tests added to some unit test class that is part of the automated test suite of pdp-engine's MainTest.java. If the functionality has any impact on XACML - any Request/Response/Policy(Set) element - processing and/or change XACML standard conformance in any way, make sure you add relevant integration and/or conformance tests to the test suite run by pdp-testutils's MainTest.java.
You may run the tests as follows from your local copy of the repository:
$ mvn test
Building AuthzForce Core requires:
- JDK 17 or later;
- Apache Maven;
- an NVD API key for the OWASP Dependency-Check vulnerability scan;
- a Sonatype Guide personal access token for the OSS Index vulnerability scan.
The API key and personal access token are required only for the complete verification lifecycle. They are not required for a regular mvn package build.
Configure the NVD API key and Sonatype Guide token in your Maven ~/.m2/settings.xml:
<settings>
<servers>
<server>
<id>nvd-api</id>
<password>YOUR_NVD_API_KEY</password>
</server>
<server>
<id>sonatype-guide</id>
<password>YOUR_SONATYPE_GUIDE_TOKEN</password>
</server>
</servers>
<profiles>
<profile>
<id>dependency-check-credentials</id>
<properties>
<nvdApiServerId>nvd-api</nvdApiServerId>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dependency-check-credentials</activeProfile>
</activeProfiles>
</settings>Both credentials are stored as password; no username is required. The sonatype-guide token is used by the OSS Index analyzer configured in the parent POM. Do not commit either credential to this repository or pass it directly on the Maven command line, where it may be exposed in build logs.
From the root of the cloned repository, run a regular build with:
mvn packageThis compiles all modules, runs the tests, and creates the artifacts in each module's target directory.
To run the complete verification lifecycle, including the dependency vulnerability checks, run:
mvn verifyNo SNAPSHOT dependencies allowed on "develop" and "master" branches.
- From the develop branch, prepare a release (example using an HTTP proxy):
$ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 jgitflow:release-start
- Update the CHANGELOG according to keepachangelog.com.
1To perform the release (example using an HTTP proxy):
If, after deployment, the command does not succeed because of some issue with the branches. Fix the issue, then re-run the same command but with 'noDeploy' option set to true to avoid re-deployment:
$ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 jgitflow:release-finishMore info on jgitflow: http://jgitflow.bitbucket.org/$ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 -DnoDeploy=true jgitflow:release-finish - Connect and log in to the Maven Central Repository: https://central.sonatype.com/publishing/deployments
- Go to Deployments and select the pending Deployment
- Click the Publish button to release to Maven Central.
- Create a new Release on GitHub (copy-paste the description from previous releases and update the versions)
- If the PDP configuration XSD has changed with the new release, publish the new schema document in HTML form on https://authzforce.github.io (example for XSD version 8.1) by following the instructions in the section below.
Install FlexDoc/XML (tested with v1.12.2).
Install openjfx (e.g. on Ubuntu/Debian):
$ sudo apt install openjfx
On Linux, modify the JAVA_HOME and CLASS_PATH variables in .../flexdoc-xml-XXX/bin/linux/generator.sh:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
...
# Add JavaFX libraries to the classpath
CLASS_PATH="${FDH}/lib/xml-apis.jar:${FDH}/lib/xercesImpl.jar:${FDH}/lib/resolver.jar:${FDH}/lib/flexdoc-xml.jar:/usr/share/openjfx/lib/*"
Run FlexDoc generator from the XSD documentation directory pdp.xsd/XXX where XXX is the schema version:
$ git clone https://github.com/authzforce/authzforce.github.io.git
$ cd authzforce.github.io
$ mkdir -p pdp.xsd/7.1
$ /path/to/flexdoc-xml-XXX/bin/linux/generator.sh
In the Generator dialog, and specify:
- Template:
.../flexdoc-xml-XXX/templates/XSDDoc/FramedDoc.tpl- Params: set Generate Details / For Schemas / Exclude parameter to
xacml-core-v3-schema-wd-17.xsd;xml.xsd. OK.
- Params: set Generate Details / For Schemas / Exclude parameter to
- XML file:
https://raw.githubusercontent.com/authzforce/core/master/pdp-engine/src/main/resources/pdp.xsd- Catalog: add the
catalog.xmlfrom the repository you just git cloned.
- Catalog: add the
- Output format: HTML
Then hit Run.