Commit a726e530 authored by cdanger's avatar cdanger

Merge branch 'release/7.0.0'

parents c1310a5d 557a688c
......@@ -2,8 +2,22 @@
All notable changes to this project are documented in this file following the [Keep a CHANGELOG](http://keepachangelog.com) conventions.
## 7.0.0
### Changed
- Managed dependency versions:
CXF: 3.1.10 -> 3.2.1
Spring: 4.3.6 -> 4.3.12
JAX-RS (javax.ws.rs-api): 2.0.1 -> 2.1
- OWASP dependency-check maven plugin: 1.4.4.1 -> 3.0.1-
- Java class naming convention: only first letter in acronym should be uppercase, e.g. XACMLVersion -> XacmlVersion
### Added
- Xacml3JaxbHelper utility class for processing XACML 3.0 schema-defined XML documents with JAXB and schema validation
- XacmlStatusCode enum class for standard XACMl 3.0 status codes
## 6.0.1
## Fixed
### Fixed
- Path to license header file for license plugin
......
## Contributing
### Contribution Rules
1. No SNAPSHOT dependencies on "develop" and obviously "master" branches
### Releasing
1. From the develop branch, prepare a release (example using a HTTP proxy):
<pre><code>
$ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 jgitflow:release-start
</code></pre>
1. Update the CHANGELOG according to keepachangelog.com.
1. To perform the release (example using a HTTP proxy):
<pre><code>
$ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 jgitflow:release-finish
</code></pre>
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:
<pre><code>
$ mvn -Dhttps.proxyHost=proxyhostname -Dhttps.proxyPort=80 -DnoDeploy=true jgitflow:release-finish
</code></pre>
1. Connect and log in to the OSS Nexus Repository Manager: https://oss.sonatype.org/
1. Go to Staging Profiles and select the pending repository authzforce-*... you just uploaded with `jgitflow:release-finish`
1. Click the Release button to release to Maven Central.
More info on jgitflow: http://jgitflow.bitbucket.org/
......@@ -3,7 +3,7 @@
<parent>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-parent</artifactId>
<version>6.0.1</version>
<version>7.0.0</version>
</parent>
<artifactId>authzforce-ce-atom-model</artifactId>
<packaging>jar</packaging>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-parent</artifactId>
<version>6.0.1</version>
<version>7.0.0</version>
</parent>
<artifactId>authzforce-ce-pdp-ext-model</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
......
......@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-parent</artifactId>
<version>6.0.1</version>
<version>7.0.0</version>
<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>Authzforce - Parent of all AuthzForce components</description>
......@@ -23,8 +23,8 @@
<jaxb2-value-constructor.version>3.0</jaxb2-value-constructor.version>
<slf4j.version>1.7.22</slf4j.version>
<!-- This version must match the Spring version used by 'logback-ext-spring' in dependencyManagement. -->
<spring.version>4.3.6.RELEASE</spring.version>
<cxf.version>3.1.10</cxf.version>
<spring.version>4.3.12.RELEASE</spring.version>
<cxf.version>3.2.1</cxf.version>
</properties>
<url>${project.url}</url>
<inceptionYear>2012</inceptionYear>
......@@ -128,7 +128,7 @@
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<!-- Version must match version used by cxf-rt-frontend-jaxrs dependency below -->
<version>2.0.1</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
......@@ -160,31 +160,42 @@
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
<dependency>
<groupId>com.github.everit-org.json-schema</groupId>
<artifactId>org.everit.json.schema</artifactId>
<!-- This version must use the version of artifact org.json/json specified above. -->
<version>1.6.0</version>
</dependency>
<!-- /Third party dependencies -->
<!-- Common AuthZForce CE dependencies. Only child modules here (see <modules>). -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${artifactId.prefix}-xmlns-model</artifactId>
<!-- Version updated automatically by maven jgitflow:release-start -->
<version>6.0.1</version>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${artifactId.prefix}-atom-model</artifactId>
<!-- Version updated automatically by maven jgitflow:release-start -->
<version>6.0.1</version>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${artifactId.prefix}-xacml-model</artifactId>
<!-- Version updated automatically by maven jgitflow:release-start -->
<version>6.0.1</version>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${artifactId.prefix}-pdp-ext-model</artifactId>
<!-- Version updated automatically by maven jgitflow:release-start -->
<version>6.0.1</version>
<version>7.0.0</version>
</dependency>
<!-- /Common AuthZForce CE dependencies -->
</dependencies>
......@@ -238,8 +249,7 @@
<!-- Consider combining with Red Hat Victims and OSS Index. More info on Victims vs. Dependency-check: https://bugzilla.redhat.com/show_bug.cgi?id=1388712 -->
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<!-- 1.4.4.1 fixes issue in 1.4.4: https://github.com/jeremylong/DependencyCheck/issues/617 -->
<version>1.4.4.1</version>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
......
......@@ -3,11 +3,11 @@
<parent>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-parent</artifactId>
<version>6.0.1</version>
<version>7.0.0</version>
</parent>
<artifactId>authzforce-ce-xacml-model</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
<description>AuthZForce - Java model (JAXB) for OASIS XACML Core Specification. The first two (dot-separated) sequences of the artifact version refer to the version of the OASIS XACML standard from which model (XML schema) this artifact is generated (using JAXB framework). OASIS XACML schema file is included. This project also includes standard XACML identifiers as Java enums.</description>
<description>AuthzForce - Java model (JAXB) for OASIS XACML Core Specification. This project also includes the OASIS XACML schema, standard XACML identifiers as Java enums, and JAXB-related utilities.</description>
<url>${project.url}</url>
<scm>
<connection>scm:git:${git.url.base}/parent.git</connection>
......
/**
* Copyright 2012-2017 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.xacml;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import javax.xml.XMLConstants;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObjectFactory;
import org.xml.sax.SAXException;
/**
* XACML (XML) document - as defined by XACML 3.0 core specification's XML schema - processing utilities based on JAXB API
*
*/
public final class Xacml3JaxbHelper
{
private final static String[] CLASSPATH_RELATIVE_XACML_3_0_SCHEMA_LOCATIONS = { "xml.xsd", "xacml-core-v3-schema-wd-17.xsd" };
/**
* Name of Java package of XACML-3.0-schema-derived classes
*/
private static final String XACML_3_0_JAXB_PACKAGE_NAME = "oasis.names.tc.xacml._3_0.core.schema.wd_17";
/**
* XACML 3.0 schema
*/
public static final Schema XACML_3_0_SCHEMA;
static
{
final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
final Source[] schemaSources = new Source[2];
final ClassLoader classLoader = Xacml3JaxbHelper.class.getClassLoader();
for (int i = 0; i < CLASSPATH_RELATIVE_XACML_3_0_SCHEMA_LOCATIONS.length; i++)
{
final URL schemaURL = classLoader.getResource(CLASSPATH_RELATIVE_XACML_3_0_SCHEMA_LOCATIONS[i]);
if (schemaURL == null)
{
throw new RuntimeException("Invalid XML schema location on classpath (not found): " + CLASSPATH_RELATIVE_XACML_3_0_SCHEMA_LOCATIONS[i]);
}
schemaSources[i] = new StreamSource(schemaURL.toExternalForm());
}
try
{
XACML_3_0_SCHEMA = factory.newSchema(schemaSources);
}
catch (final SAXException e)
{
throw new RuntimeException("Failed to load XML schemas on classpath: " + Arrays.toString(CLASSPATH_RELATIVE_XACML_3_0_SCHEMA_LOCATIONS), e);
}
}
/**
* JAXB context for (un)marshalling from/to JAXB objects derived from XACML 3.0 schema
*/
public static final JAXBContext XACML_3_0_JAXB_CONTEXT;
static
{
try
{
XACML_3_0_JAXB_CONTEXT = JAXBContext.newInstance(XACML_3_0_JAXB_PACKAGE_NAME, Xacml3JaxbHelper.class.getClassLoader());
}
catch (final JAXBException e)
{
throw new RuntimeException("Error instantiating JAXB context for (un)marshalling from/to XACML 3.0 objects", e);
}
}
/**
* XACML 3.0 JAXB ObjectFactory
*/
public static final ObjectFactory XACML_3_0_OBJECT_FACTORY = new ObjectFactory();
/**
* Creates XACML 3.0/JAXB unmarshaller with XACML 3.0 schema validation
*
* @return unmarshaller
* @throws JAXBException
* if an error was encountered while creating the Unmarshaller object
*/
public static Unmarshaller createXacml3Unmarshaller() throws JAXBException
{
final Unmarshaller unmarshaller = XACML_3_0_JAXB_CONTEXT.createUnmarshaller();
unmarshaller.setSchema(XACML_3_0_SCHEMA);
return unmarshaller;
}
/**
* Creates XACML 3.0/JAXB marshaller with XACML 3.0 schema validation
*
* @return marshaller
* @throws JAXBException
* if an error was encountered while creating the Marshaller object
*/
public static Marshaller createXacml3Marshaller() throws JAXBException
{
final Marshaller marshaller = XACML_3_0_JAXB_CONTEXT.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_ENCODING, StandardCharsets.UTF_8.name());
marshaller.setSchema(XACML_3_0_SCHEMA);
return marshaller;
}
}
......@@ -21,7 +21,7 @@ package org.ow2.authzforce.xacml.identifiers;
* XPATH Version.
*
*/
public enum XPATHVersion
public enum XPathVersion
{
/**
* 1.0
......@@ -36,7 +36,7 @@ public enum XPATHVersion
private final String uri;
private final String versionNumber;
XPATHVersion(String uri, String versionNumber)
XPathVersion(String uri, String versionNumber)
{
this.uri = uri;
this.versionNumber = versionNumber;
......@@ -67,9 +67,9 @@ public enum XPATHVersion
* @throws IllegalArgumentException
* if uri does not match any XPath version
*/
public static XPATHVersion fromURI(String uri) throws IllegalArgumentException
public static XPathVersion fromURI(String uri) throws IllegalArgumentException
{
for (XPATHVersion c : XPATHVersion.values())
for (XPathVersion c : XPathVersion.values())
{
if (c.uri.equals(uri))
{
......
......@@ -22,10 +22,10 @@ package org.ow2.authzforce.xacml.identifiers;
/**
* XACML Version. The actual version IDs are returned by {@link XACMLAttributeCategory#ordinal()} and match the XACML version integers defined in SunXACML PolicyMetadata class.
* XACML Version. The actual version IDs are returned by {@link XacmlAttributeCategory#ordinal()} and match the XACML version integers defined in SunXACML PolicyMetadata class.
*
*/
public enum XACMLAttributeCategory
public enum XacmlAttributeCategory
{
/**
* Subject Category
......@@ -73,7 +73,7 @@ public enum XACMLAttributeCategory
private final String value;
XACMLAttributeCategory(String v) {
XacmlAttributeCategory(String v) {
value = v;
}
......@@ -88,8 +88,8 @@ public enum XACMLAttributeCategory
* @param v XACML identifier for this category
* @return XACMLCategory
*/
public static XACMLAttributeCategory fromValue(String v) {
for (XACMLAttributeCategory c : XACMLAttributeCategory.values()) {
public static XacmlAttributeCategory fromValue(String v) {
for (XacmlAttributeCategory c : XacmlAttributeCategory.values()) {
if (c.value.equals(v)) {
return c;
}
......
......@@ -21,7 +21,7 @@ package org.ow2.authzforce.xacml.identifiers;
* XACML standard attribute identifiers
*
*/
public enum XACMLAttributeId
public enum XacmlAttributeId
{
/*
......@@ -132,7 +132,7 @@ public enum XACMLAttributeId
private final String value;
XACMLAttributeId(final String v)
XacmlAttributeId(final String v)
{
value = v;
}
......@@ -154,9 +154,9 @@ public enum XACMLAttributeId
* attribute identifier
* @return enum constant for this attribute ID
*/
public static XACMLAttributeId fromValue(final String identifier)
public static XacmlAttributeId fromValue(final String identifier)
{
for (final XACMLAttributeId c : XACMLAttributeId.values())
for (final XacmlAttributeId c : XacmlAttributeId.values())
{
if (c.value.equals(identifier))
{
......
......@@ -21,7 +21,7 @@ package org.ow2.authzforce.xacml.identifiers;
* XACML Standard Datatypes
*
*/
public enum XACMLDatatypeId
public enum XacmlDatatypeId
{
// Mandatory
/**
......@@ -102,7 +102,7 @@ public enum XACMLDatatypeId
/**
* Length of {@link #XML_SCHEMA_URI_PREFIX}, used for extracting suffix from datatypes in order to create XACML function names, logging types of data, etc.
*/
public static final int XML_SCHEMA_URI_PREFIX_LENGTH = XACMLDatatypeId.XML_SCHEMA_URI_PREFIX.length();
public static final int XML_SCHEMA_URI_PREFIX_LENGTH = XacmlDatatypeId.XML_SCHEMA_URI_PREFIX.length();
private final String value;
......@@ -116,7 +116,7 @@ public enum XACMLDatatypeId
return value;
}
private XACMLDatatypeId(final String v)
private XacmlDatatypeId(final String v)
{
value = v;
}
......@@ -128,9 +128,9 @@ public enum XACMLDatatypeId
* datatype idenfifier (URI)
* @return Datatype enum
*/
public static XACMLDatatypeId fromValue(final String datatypeURI)
public static XacmlDatatypeId fromValue(final String datatypeURI)
{
for (final XACMLDatatypeId c : XACMLDatatypeId.values())
for (final XacmlDatatypeId c : XacmlDatatypeId.values())
{
if (c.value.equals(datatypeURI))
{
......
......@@ -24,7 +24,7 @@ package org.ow2.authzforce.xacml.identifiers;
* XACML node names, as defined in XACML Core Specification (declared in the same order). There may be fewer names than defined in the XACML schema. There are added progressively as needed.
*
*/
public enum XACMLNodeName
public enum XacmlNodeName
{
/**
......@@ -219,7 +219,7 @@ public enum XACMLNodeName
return value;
}
private XACMLNodeName(final String v)
private XacmlNodeName(final String v)
{
value = v;
}
......@@ -231,9 +231,9 @@ public enum XACMLNodeName
* XACML node name
* @return enum constant
*/
public static XACMLNodeName fromValue(final String nodeName)
public static XacmlNodeName fromValue(final String nodeName)
{
for (final XACMLNodeName c : XACMLNodeName.values())
for (final XacmlNodeName c : XacmlNodeName.values())
{
if (c.value.equals(nodeName))
{
......
......@@ -21,10 +21,10 @@
package org.ow2.authzforce.xacml.identifiers;
/**
* XACML Resource scopes, as defined in XACML v2.0 Multiple Resource Profile, §5. The actual value
* XACML Resource scopes, as defined in XACML v3.0 Multiple Decision Profile Version 1.0, §6.1. The actual value
*
*/
public enum XACMLResourceScope
public enum XacmlResourceScope
{
/**
......@@ -54,7 +54,7 @@ public enum XACMLResourceScope
return value;
}
private XACMLResourceScope(final String v)
private XacmlResourceScope(final String v)
{
value = v;
}
......@@ -66,9 +66,9 @@ public enum XACMLResourceScope
* resource scope identifier
* @return Resource scope enum
*/
public static XACMLResourceScope fromValue(final String scopeId)
public static XacmlResourceScope fromValue(final String scopeId)
{
for (final XACMLResourceScope c : XACMLResourceScope.values())
for (final XacmlResourceScope c : XacmlResourceScope.values())
{
if (c.value.equals(scopeId))
{
......
/**
* Copyright 2012-2017 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.xacml.identifiers;
/**
* XACML Resource scopes, as defined in XACML v3.0 Multiple Decision Profile Version 1.0, §6.1. The actual value
*
*/
public enum XacmlStatusCode
{
/**
* Standard identifier for the OK status
*/
OK("urn:oasis:names:tc:xacml:1.0:status:ok"),
/**
* Standard identifier for the Missing Attribute status
*/
MISSING_ATTRIBUTE("urn:oasis:names:tc:xacml:1.0:status:missing-attribute"),
/**
* Standard identifier for the Syntax Error status
*/
SYNTAX_ERROR("urn:oasis:names:tc:xacml:1.0:status:syntax-error"),
/**
* Standard identifier for the Processing Error status
*/
PROCESSING_ERROR("urn:oasis:names:tc:xacml:1.0:status:processing-error");
private final String value;
/**
* Get standard identifier (string), e.g. ""urn:oasis:names:tc:xacml:1.0:status:ok"" for {@link #OK}
*
* @return identifier
*/
public String value()
{
return value;
}
private XacmlStatusCode(final String v)
{
value = v;
}
/**
* Get constant from identifier
*
* @param id
* identifier
* @return status code enum
*/
public static XacmlStatusCode fromValue(final String id)
{
for (final XacmlStatusCode c : XacmlStatusCode.values())
{
if (c.value.equals(id))
{
return c;
}
}
throw new IllegalArgumentException(id);
}
}
......@@ -22,11 +22,11 @@ package org.ow2.authzforce.xacml.identifiers;
/**
* XACML Version. The actual version IDs are returned by {@link XACMLVersion#ordinal()} and match
* XACML Version. The actual version IDs are returned by {@link XacmlVersion#ordinal()} and match
* the XACML version integers defined in SunXACML PolicyMetadata class.
*
*/
public enum XACMLVersion
public enum XacmlVersion
{
/**
* XACML 1.0
......@@ -51,7 +51,7 @@ public enum XACMLVersion
private final String namespace;
XACMLVersion(String ns)
XacmlVersion(String ns)
{
namespace = ns;
}
......@@ -69,9 +69,9 @@ public enum XACMLVersion
* schema namespace of this XACML version.
* @return XACML Version enum
*/
public static XACMLVersion fromValue(String v)
public static XacmlVersion fromValue(String v)
{
for (XACMLVersion c : XACMLVersion.values())
for (XacmlVersion c : XacmlVersion.values())
{
if (c.namespace.equals(v))
{
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>org.ow2.authzforce</groupId>
<artifactId>authzforce-ce-parent</artifactId>
<version>6.0.1</version>
<version>7.0.0</version>
</parent>
<artifactId>authzforce-ce-xmlns-model</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment