Commit b0c5299f authored by cdanger's avatar cdanger

- Fixed current year in license headers

- fixed javadoc
parent 3bd88442
......@@ -124,14 +124,14 @@
<id>format-sources-license</id>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
<goal>update</goal>
</goals>
</execution>
<execution>
<id>format-test-sources-license</id>
<phase>process-test-sources</phase>
<goals>
<goal>format</goal>
<goal>update</goal>
</goals>
</execution>
</executions>
......
......@@ -27,7 +27,6 @@ import org.ow2.authzforce.core.pdp.api.func.FirstOrderFunctionCall;
import org.ow2.authzforce.core.pdp.api.func.Function;
import org.ow2.authzforce.core.pdp.api.func.FunctionSet;
import org.ow2.authzforce.core.pdp.api.func.FunctionSignature;
import org.ow2.authzforce.core.pdp.api.func.NonEqualTypeMatchFunction;
import org.ow2.authzforce.core.pdp.api.func.RegexpMatchFunctionHelper;
import org.ow2.authzforce.core.pdp.api.value.AnyURIValue;
import org.ow2.authzforce.core.pdp.api.value.Base64BinaryValue;
......@@ -47,10 +46,11 @@ import org.ow2.authzforce.core.pdp.api.value.X500NameValue;
import org.ow2.authzforce.core.pdp.api.value.YearMonthDurationValue;
/**
* Standard match functions taking parameters of same/equal type, i.e. standard (A.3.1) Equality predicates and special match function x500Name-match
* Standard match functions taking parameters of same/equal type, i.e. standard (A.3.1) Equality predicates, special match function x500Name-match,
* string-starts-with/contains/ends-with.
* <p>
* Note that there are no such functions as ipAddress-equal and dnsName-equal functions in the XACML core specification. Regexp-match alternatives should be used intead. More info:
* https://lists.oasis-open.org/archives/xacml-comment/200411/msg00002.html
* Note that there are no such functions as ipAddress-equal and dnsName-equal functions in the XACML core specification. Regexp-match alternatives should be
* used intead. More info: https://lists.oasis-open.org/archives/xacml-comment/200411/msg00002.html
*
* @version $Id: $
*/
......@@ -175,7 +175,7 @@ public final class StandardEqualTypeMatchFunctions
};
/**
* string-starts-with function matcher. For other *-starts-with functions, see {@link NonEqualTypeMatchFunction} class.
* string-starts-with function matcher. For other *-starts-with functions, see {@link org.ow2.authzforce.core.pdp.api.func.NonEqualTypeMatchFunction} class.
*/
private static final Matcher<StringValue> STRING_STARTS_WITH_MATCHER = new Matcher<StringValue>()
{
......@@ -246,8 +246,8 @@ public final class StandardEqualTypeMatchFunctions
{
final FirstOrderFunctionCall<BooleanValue> compiledRegexFuncCall = regexFuncHelper.getCompiledRegexMatchCall(argExpressions, remainingArgTypes);
/*
* compiledRegexFuncCall == null means no optimization using a pre-compiled regex could be done; in this case, use super.newCall() as usual, which will call match() down below, compiling
* the regex on-the-fly for each evaluation.
* compiledRegexFuncCall == null means no optimization using a pre-compiled regex could be done; in this case, use super.newCall() as usual, which
* will call match() down below, compiling the regex on-the-fly for each evaluation.
*/
return compiledRegexFuncCall == null ? super.getInstance(argExpressions, remainingArgTypes) : compiledRegexFuncCall;
}
......@@ -269,7 +269,7 @@ public final class StandardEqualTypeMatchFunctions
* Function set
*/
public static final FunctionSet SET = new BaseFunctionSet(FunctionSet.DEFAULT_ID_NAMESPACE + "equal-type-match",
//
//
new EqualTypeMatchFunction<>(NAME_STRING_EQUAL, StandardDatatypes.STRING_FACTORY.getDatatype(), new EqualMatcher<StringValue>()),
//
new EqualTypeMatchFunction<>(NAME_BOOLEAN_EQUAL, StandardDatatypes.BOOLEAN_FACTORY.getDatatype(), new EqualMatcher<BooleanValue>()),
......
......@@ -21,14 +21,12 @@ import org.ow2.authzforce.core.pdp.api.func.FirstOrderBagFunctions;
import org.ow2.authzforce.core.pdp.api.func.Function;
import org.ow2.authzforce.core.pdp.api.func.FunctionSet;
import org.ow2.authzforce.core.pdp.api.func.HigherOrderBagFunction;
import org.ow2.authzforce.core.pdp.api.value.AttributeValue;
import org.ow2.authzforce.core.pdp.api.value.DatatypeFactory;
import org.ow2.authzforce.core.pdp.api.value.SimpleValue;
import org.ow2.authzforce.core.pdp.api.value.StandardDatatypes;
/**
* Standard first-order bag functions, as opposed to the higher-order bag functions (see {@link HigherOrderBagFunction}); standard first-order bag functions are the Bag functions of section A.3.10,
* and the Set functions of A.3.11 of the XACML spec.
* Standard first-order bag functions, as opposed to the higher-order bag functions (see {@link HigherOrderBagFunction}); standard first-order bag functions are
* the Bag functions of section A.3.10, and the Set functions of A.3.11 of the XACML spec.
*
* @version $Id: $
*/
......@@ -39,17 +37,12 @@ public final class StandardFirstOrderBagFunctions
// empty private constructor to prevent instantiation
}
private static <AV extends AttributeValue> Set<Function<?>> getFunctions(DatatypeFactory<AV> typeFactory)
{
return FirstOrderBagFunctions.getFunctions(typeFactory.getDatatype().getFuncIdPrefix(), typeFactory.getDatatype(), typeFactory.getBagDatatype(), typeFactory.getArrayClass());
}
private static Set<Function<?>> getFunctions()
{
final Set<Function<?>> mutableSet = new HashSet<>();
for (final SimpleValue.Factory<? extends SimpleValue<? extends Object>> typeFactory : StandardDatatypes.MANDATORY_DATATYPE_SET)
{
mutableSet.addAll(getFunctions(typeFactory));
mutableSet.addAll(FirstOrderBagFunctions.getFunctions(typeFactory));
}
return mutableSet;
......
......@@ -16,12 +16,13 @@ package org.ow2.authzforce.core.test.custom;
import org.ow2.authzforce.core.pdp.api.func.EqualTypeMatchFunction;
/**
* Implements the dnsName-value-equal function from <i>XACML Data Loss Prevention / Network Access Control (DLP/NAC) Profile Version 1.0<i>. Edited by John Tolbert, Richard Hill, Crystal Hayes, David
* Brossard, Hal Lockhart, and Steven Legg. 16 February 2015. OASIS Committee Specification 01. http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/cs01/xacml-3.0-dlp-nac-v1.0-cs01.html. Latest
* version: http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/xacml-3.0-dlp-nac-v1.0.html.
* Implements the dnsName-value-equal function from <i>XACML Data Loss Prevention / Network Access Control (DLP/NAC) Profile Version 1.0<i>. Edited by John
* Tolbert, Richard Hill, Crystal Hayes, David Brossard, Hal Lockhart, and Steven Legg. 16 February 2015. OASIS Committee Specification 01.
* http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/cs01/xacml-3.0-dlp-nac-v1.0-cs01.html. Latest version:
* http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/xacml-3.0-dlp-nac-v1.0.html.
* <p>
* Used here for testing Authzforce function extension mechanism, i.e. plugging a custom function into the PDP engine.
* */
*/
public class TestDNSNameValueEqualFunction extends EqualTypeMatchFunction<TestDNSNameWithPortValue>
{
/**
......@@ -29,10 +30,6 @@ public class TestDNSNameValueEqualFunction extends EqualTypeMatchFunction<TestDN
*/
public static final String ID = "urn:oasis:names:tc:xacml:3.0:function:dnsName-value-equal";
/**
* x500Name-match function matcher
*
*/
private static final Matcher<TestDNSNameWithPortValue> MATCHER = new Matcher<TestDNSNameWithPortValue>()
{
@Override
......
......@@ -24,11 +24,13 @@ import org.ow2.authzforce.core.pdp.api.func.Function;
import org.ow2.authzforce.core.pdp.api.value.SimpleValue;
/**
* Represents the dnsName-value datatype <i>XACML Data Loss Prevention / Network Access Control (DLP/NAC) Profile Version 1.0<i>. Edited by John Tolbert, Richard Hill, Crystal Hayes, David Brossard,
* Hal Lockhart, and Steven Legg. 16 February 2015. OASIS Committee Specification 01. http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/cs01/xacml-3.0-dlp-nac-v1.0-cs01.html. Latest version:
* http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/xacml-3.0-dlp-nac-v1.0.html..
* Represents the dnsName-value datatype <i>XACML Data Loss Prevention / Network Access Control (DLP/NAC) Profile Version 1.0<i>. Edited by John Tolbert,
* Richard Hill, Crystal Hayes, David Brossard, Hal Lockhart, and Steven Legg. 16 February 2015. OASIS Committee Specification 01.
* http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/cs01/xacml-3.0-dlp-nac-v1.0-cs01.html. Latest version:
* http://docs.oasis-open.org/xacml/xacml-3.0-dlp-nac/v1.0/xacml-3.0-dlp-nac-v1.0.html.
* <p>
* It is basically the same as XACML Core dnsName datatype except that the hostname may use a wildcard as left-most subdomain, and the part after ':' is limited to a port number only.
* It is basically the same as XACML Core dnsName datatype except that the hostname may use a wildcard as left-most subdomain, and the part after ':' is limited
* to a port number only.
* <p>
* Used here for testing Authzforce datatype extension mechanism, i.e. plugging a custom simple datatype into the PDP engine.
*
......@@ -84,8 +86,8 @@ public final class TestDNSNameWithPortValue extends SimpleValue<String>
}
/*
* These fields are not actually needed in the XACML core specification since no function uses them, but it might be useful for new XACML profile or custom functions dealing with network access
* control for instance.
* These fields are not actually needed in the XACML core specification since no function uses them, but it might be useful for new XACML profile or custom
* functions dealing with network access control for instance.
*/
// the required hostname
private final transient String hostname;
......@@ -96,7 +98,8 @@ public final class TestDNSNameWithPortValue extends SimpleValue<String>
/**
* Private helper that tests whether the given string is valid.
*
* TODO: find out whether it's better to use DomainValidator from Apache commons-validator instead, but first make sure this issue is fixed: https://issues.apache.org/jira/browse/VALIDATOR-366
* TODO: find out whether it's better to use DomainValidator from Apache commons-validator instead, but first make sure this issue is fixed:
* https://issues.apache.org/jira/browse/VALIDATOR-366
*/
private static boolean isValidHostName(String hostname)
{
......@@ -189,7 +192,8 @@ public final class TestDNSNameWithPortValue extends SimpleValue<String>
*
* @see java.lang.Object#equals(java.lang.Object)
*
* We override the equals because for hostname, we can use equalsIgnoreCase() instead of equals() to compare, and PortRange.equals() for the portRange attribute (more optimal than String equals)
* We override the equals because for hostname, we can use equalsIgnoreCase() instead of equals() to compare, and PortRange.equals() for the portRange
* attribute (more optimal than String equals)
*/
/** {@inheritDoc} */
@Override
......
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