Commit 9e906899 authored by Cyril Dangerville's avatar Cyril Dangerville

* Removed aspectj stuff from POM

* Fixed issues raised by PMD plugin
parent 41d96e92
......@@ -9,3 +9,4 @@
/.settings/org.eclipse.wst.common.project.facet.core.xml
/.settings/org.sonar.ide.eclipse.core.prefs
*.log
/.pmd
......@@ -65,8 +65,8 @@
<version>9.6.0-5</version>
</dependency>
<!-- Authzforce dependencies -->
<!-- xml-ns-model and xacml-model dependencies are declared here only to work around maven-jaxb2-plugin bug: cannot resolve
episodes from indirect dependencies with useDependenciesAsEpisodes option. -->
<!-- xml-ns-model and xacml-model dependencies are declared here only to work around maven-jaxb2-plugin
bug: cannot resolve episodes from indirect dependencies with useDependenciesAsEpisodes option. -->
<dependency>
<groupId>com.thalesgroup.authzforce</groupId>
<artifactId>authzforce-xml-ns-model</artifactId>
......@@ -115,19 +115,20 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- TO BE UNCOMMENTED BEFORE RELEASE TO CHECK POSSIBLE BUGS -->
<!-- <plugin> -->
<!-- <groupId>org.codehaus.mojo</groupId> -->
<!-- <artifactId>findbugs-maven-plugin</artifactId> -->
<!-- <version>3.0.1</version> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <phase>verify</phase> -->
<!-- <goals> -->
<!-- <goal>check</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
<plugin>
<!-- Apache license Headers -->
<groupId>com.mycila</groupId>
......@@ -164,8 +165,6 @@
<include>src/main/java/com/thalesgroup/authzforce/core/**</include>
<!-- Include test files also -->
<include>src/test/java/**</include>
<!-- Include aspectj files also -->
<include>src/main/aspect/**</include>
</includes>
</configuration>
<goals>
......@@ -213,8 +212,8 @@
<extension>true</extension>
<useDependenciesAsEpisodes>true</useDependenciesAsEpisodes>
<strict>false</strict>
<catalog>src/main/jaxb/catalog.xml</catalog>
<removeOldOutput>true</removeOldOutput>
<catalog>src/main/jaxb/catalog.xml</catalog>
<bindingDirectory>src/main/jaxb</bindingDirectory>
<bindingIncludes>
<include>bindings.xjb</include>
......
......@@ -63,7 +63,6 @@ import com.thalesgroup.authzforce.core.attr.DateAttributeValue;
import com.thalesgroup.authzforce.core.attr.DateTimeAttributeValue;
import com.thalesgroup.authzforce.core.attr.TimeAttributeValue;
import com.thalesgroup.authzforce.core.eval.Bag;
import com.thalesgroup.authzforce.core.eval.Bags;
import com.thalesgroup.authzforce.core.eval.DecisionResult;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
......@@ -328,11 +327,11 @@ public class PDP implements Closeable
final Map<AttributeGUID, Bag<?>> pdpIssuedAttributes = new HashMap<>();
// current datetime
final DateTimeAttributeValue currentDateTimeValue = new DateTimeAttributeValue(new GregorianCalendar());
pdpIssuedAttributes.put(ENVIRONMENT_CURRENT_DATETIME_ATTRIBUTE_GUID, Bags.singleton(DatatypeConstants.DATETIME.BAG_TYPE, currentDateTimeValue));
pdpIssuedAttributes.put(ENVIRONMENT_CURRENT_DATETIME_ATTRIBUTE_GUID, Bag.singleton(DatatypeConstants.DATETIME.BAG_TYPE, currentDateTimeValue));
// current date
pdpIssuedAttributes.put(ENVIRONMENT_CURRENT_DATE_ATTRIBUTE_GUID, Bags.singleton(DatatypeConstants.DATE.BAG_TYPE, DateAttributeValue.getInstance((XMLGregorianCalendar) currentDateTimeValue.getUnderlyingValue().clone())));
pdpIssuedAttributes.put(ENVIRONMENT_CURRENT_DATE_ATTRIBUTE_GUID, Bag.singleton(DatatypeConstants.DATE.BAG_TYPE, DateAttributeValue.getInstance((XMLGregorianCalendar) currentDateTimeValue.getUnderlyingValue().clone())));
// current time
pdpIssuedAttributes.put(ENVIRONMENT_CURRENT_TIME_ATTRIBUTE_GUID, Bags.singleton(DatatypeConstants.TIME.BAG_TYPE, TimeAttributeValue.getInstance((XMLGregorianCalendar) currentDateTimeValue.getUnderlyingValue().clone())));
pdpIssuedAttributes.put(ENVIRONMENT_CURRENT_TIME_ATTRIBUTE_GUID, Bag.singleton(DatatypeConstants.TIME.BAG_TYPE, TimeAttributeValue.getInstance((XMLGregorianCalendar) currentDateTimeValue.getUnderlyingValue().clone())));
// evaluate the individual decision requests with the extra common attributes set previously
final List<Result> results = individualReqEvaluator.evaluate(individualDecisionRequests, pdpIssuedAttributes);
......
......@@ -41,6 +41,8 @@ import java.util.regex.Pattern;
import com.thalesgroup.authzforce.core.attr.AttributeValue;
import com.thalesgroup.authzforce.core.attr.SimpleAttributeValue;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
/**
* Represents the DNSName datatype introduced in XACML 2.0. All objects of this class are immutable
......@@ -251,7 +253,7 @@ public class DNSNameAttributeValue extends SimpleAttributeValue<String, DNSNameA
}
@Override
public DNSNameAttributeValue one()
public DNSNameAttributeValue evaluate(EvaluationContext context) throws IndeterminateEvaluationException
{
return this;
}
......
......@@ -41,6 +41,8 @@ import javax.xml.ws.Holder;
import com.google.common.net.InetAddresses;
import com.thalesgroup.authzforce.core.attr.AttributeValue;
import com.thalesgroup.authzforce.core.attr.SimpleAttributeValue;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
/**
* Represents the IPAddress datatype introduced in XACML 2.0. All objects of this class are
......@@ -164,7 +166,7 @@ public class IPAddressAttributeValue extends SimpleAttributeValue<String, IPAddr
address = InetAddresses.forString(val.substring(1, endIndex));
// see if there's anything left in the string
if (endIndex != (len - 1))
if (endIndex != len - 1)
{
// if there's a mask, it's also an IPv6 address
if (val.charAt(endIndex + 1) == '/')
......@@ -178,7 +180,7 @@ public class IPAddressAttributeValue extends SimpleAttributeValue<String, IPAddr
}
// finally, see if there's a port range, if we're not finished
if ((endIndex != (len - 1)) && (val.charAt(endIndex + 1) == ':'))
if (endIndex != len - 1 && val.charAt(endIndex + 1) == ':')
{
range = PortRange.getInstance(val.substring(endIndex + 2, len));
} else
......@@ -320,7 +322,7 @@ public class IPAddressAttributeValue extends SimpleAttributeValue<String, IPAddr
}
@Override
public IPAddressAttributeValue one()
public IPAddressAttributeValue evaluate(EvaluationContext context) throws IndeterminateEvaluationException
{
return this;
}
......
......@@ -96,8 +96,10 @@ class PortRange
int upperBound = UNBOUND;
// first off, make sure there's actually content here
if ((value.length() == 0) || (value.equals("-")))
if (value.length() == 0 || value.equals("-"))
{
return new PortRange();
}
// there's content, so figure where the '-' is, if at all
int dashPos = value.indexOf('-');
......@@ -117,7 +119,7 @@ class PortRange
int len = value.length();
// ... and see if there is a second port number
if (dashPos != (len - 1))
if (dashPos != len - 1)
{
// the dash wasn't at the end, so there's an upper-bound
upperBound = Integer.parseInt(value.substring(dashPos + 1, len));
......@@ -158,7 +160,7 @@ class PortRange
*/
public boolean isLowerBounded()
{
return (lowerBound != UNBOUND);
return lowerBound != UNBOUND;
}
/**
......@@ -168,7 +170,7 @@ class PortRange
*/
public boolean isUpperBounded()
{
return (upperBound != UNBOUND);
return upperBound != UNBOUND;
}
/**
......@@ -178,7 +180,7 @@ class PortRange
*/
public boolean isSinglePort()
{
return ((lowerBound == upperBound) && (lowerBound != UNBOUND));
return lowerBound == upperBound && lowerBound != UNBOUND;
}
/**
......@@ -189,7 +191,7 @@ class PortRange
*/
public boolean isUnbound()
{
return ((lowerBound == UNBOUND) && (upperBound == UNBOUND));
return lowerBound == UNBOUND && upperBound == UNBOUND;
}
private int hashCode = 0;
......@@ -218,7 +220,9 @@ class PortRange
public boolean equals(Object o)
{
if (!(o instanceof PortRange))
{
return false;
}
final PortRange other = (PortRange) o;
return lowerBound == other.lowerBound && upperBound == other.upperBound;
......
......@@ -42,11 +42,10 @@ import com.sun.xacml.finder.AttributeFinder;
import com.thalesgroup.authzforce.core.XACMLBindingUtils;
import com.thalesgroup.authzforce.core.attr.AttributeGUID;
import com.thalesgroup.authzforce.core.attr.AttributeValue;
import com.thalesgroup.authzforce.core.eval.BagDatatype;
import com.thalesgroup.authzforce.core.eval.Bag;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.Expression;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
import com.thalesgroup.authzforce.core.eval.Bag;
/**
* AttributeDesignator
......@@ -83,7 +82,7 @@ public class AttributeDesignator<AV extends AttributeValue<AV>> extends Attribut
private final AttributeGUID attrGUID;
private final AttributeFinder attrFinder;
// private final Class<T> returnType;
private final BagDatatype<AV> returnType;
private final Bag.Datatype<AV> returnType;
private final IndeterminateEvaluationException missingAttributeForUnknownReasonException;
private final IndeterminateEvaluationException missingAttributeBecauseNullContextException;
......@@ -172,7 +171,7 @@ public class AttributeDesignator<AV extends AttributeValue<AV>> extends Attribut
* Attribute Finder responsible for finding the attribute designated by this in a
* given evaluation context at runtime
*/
public AttributeDesignator(AttributeDesignatorType attrDesignator, BagDatatype<AV> resultDatatype, AttributeFinder attrFinder)
public AttributeDesignator(AttributeDesignatorType attrDesignator, Bag.Datatype<AV> resultDatatype, AttributeFinder attrFinder)
{
final String categoryURI = attrDesignator.getCategory();
if (categoryURI == null)
......
......@@ -36,7 +36,7 @@ package com.sun.xacml.attr.xacmlv3;
import java.io.Serializable;
import java.util.ArrayDeque;
import java.util.Collections;
import java.util.Queue;
import java.util.Deque;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
......@@ -62,8 +62,6 @@ import com.thalesgroup.authzforce.core.attr.AttributeValue;
import com.thalesgroup.authzforce.core.attr.DatatypeConstants;
import com.thalesgroup.authzforce.core.attr.XPathAttributeValue;
import com.thalesgroup.authzforce.core.eval.Bag;
import com.thalesgroup.authzforce.core.eval.BagDatatype;
import com.thalesgroup.authzforce.core.eval.Bags;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.Expression;
import com.thalesgroup.authzforce.core.eval.Expression.Utils.XPathEvaluator;
......@@ -191,7 +189,7 @@ public class AttributeSelector<AV extends AttributeValue<AV>> extends AttributeS
private final AttributeSelectorId id;
private final BagDatatype<AV> returnType;
private final Bag.Datatype<AV> returnType;
private final IndeterminateEvaluationException missingAttributeForUnknownReasonException;
private final IndeterminateEvaluationException missingAttributeBecauseNullContextException;
......@@ -426,7 +424,7 @@ public class AttributeSelector<AV extends AttributeValue<AV>> extends AttributeS
throw new IndeterminateEvaluationException(missingContextSelectorAttributeExceptionMessage, Status.STATUS_MISSING_ATTRIBUTE, bag.getReasonWhyEmpty());
}
final String contextSelectorPath = bag.one().getUnderlyingValue();
final String contextSelectorPath = bag.getSingleValue().getUnderlyingValue();
try
{
contextNode = xpathCompiler.evaluateSingle(contextSelectorPath, contentNode);
......@@ -457,8 +455,9 @@ public class AttributeSelector<AV extends AttributeValue<AV>> extends AttributeS
throw new IndeterminateEvaluationException(this.xpathEvalExceptionMessage, Status.STATUS_SYNTAX_ERROR, e);
}
// preserve order of results
final Queue<AV> resultBag = new ArrayDeque<>();
// The values in a bag are not ordered (§7.3.2 of XACML core spec) but may contain
// duplicates
final Deque<AV> resultBag = new ArrayDeque<>();
int xpathEvalResultItemIndex = 0;
for (final XdmItem xpathEvalResultItem : xpathEvalResult)
{
......@@ -498,7 +497,7 @@ public class AttributeSelector<AV extends AttributeValue<AV>> extends AttributeS
xpathEvalResultItemIndex++;
}
final Bag<AV> result = Bags.getInstance(returnType, resultBag);
final Bag<AV> result = Bag.getInstance(returnType, resultBag);
context.putAttributeSelectorResultIfAbsent(id, result);
validateResult(result);
return result;
......@@ -539,7 +538,7 @@ public class AttributeSelector<AV extends AttributeValue<AV>> extends AttributeS
* empty).
* </p>
*/
final Bag<AV> result = Bags.empty(returnType, e);
final Bag<AV> result = Bag.empty(returnType, e);
context.putAttributeSelectorResultIfAbsent(id, result);
validateResult(result);
return result;
......
......@@ -55,7 +55,7 @@ import com.thalesgroup.authzforce.core.func.FunctionCall;
* @param <RETURN_T>
* return type of this function, i.e. single-valued V or bag of Vs
*/
public abstract class Function<RETURN_T extends Expression.Value<?, RETURN_T>> extends FunctionType implements Expression<RETURN_T>, PdpExtension
public abstract class Function<RETURN_T extends Expression.Value<RETURN_T>> extends FunctionType implements Expression<RETURN_T>, PdpExtension
{
// cached hashcode result
private int hashCode = 0;
......@@ -121,7 +121,7 @@ public abstract class Function<RETURN_T extends Expression.Value<?, RETURN_T>> e
}
@Override
public final RETURN_T evaluate(EvaluationContext context) throws IndeterminateEvaluationException
public final RETURN_T evaluate(EvaluationContext context) throws IndeterminateEvaluationException // NOPMD by Cyril DANGERVILLE on 10/12/15 11:19 PM
{
// Expression#evaluate()
/*
......
......@@ -33,6 +33,7 @@
*/
package com.sun.xacml.cond;
import java.util.Deque;
import java.util.List;
import com.thalesgroup.authzforce.core.attr.BooleanAttributeValue;
......@@ -71,12 +72,12 @@ public class NotFunction extends FirstOrderFunction<BooleanAttributeValue>
@Override
protected FirstOrderFunctionCall<BooleanAttributeValue> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes) throws IllegalArgumentException
{
return new EagerSinglePrimitiveTypeEval<BooleanAttributeValue, BooleanAttributeValue>(signature, BooleanAttributeValue[].class, argExpressions, remainingArgTypes)
return new EagerSinglePrimitiveTypeEval<BooleanAttributeValue, BooleanAttributeValue>(signature, DatatypeConstants.BOOLEAN.TYPE, argExpressions, remainingArgTypes)
{
@Override
protected BooleanAttributeValue evaluate(BooleanAttributeValue[] args) throws IndeterminateEvaluationException
protected BooleanAttributeValue evaluate(Deque<BooleanAttributeValue> args) throws IndeterminateEvaluationException
{
return eval(args[0]);
return eval(args.getFirst());
}
};
......
......@@ -33,6 +33,7 @@
*/
package com.sun.xacml.cond;
import java.util.Deque;
import java.util.List;
import java.util.Locale;
......@@ -91,12 +92,12 @@ public abstract class StringNormalizeFunction extends FirstOrderFunction<StringA
@Override
protected final FirstOrderFunctionCall<StringAttributeValue> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes) throws IllegalArgumentException
{
return new EagerSinglePrimitiveTypeEval<StringAttributeValue, StringAttributeValue>(signature, StringAttributeValue[].class, argExpressions, remainingArgTypes)
return new EagerSinglePrimitiveTypeEval<StringAttributeValue, StringAttributeValue>(signature, DatatypeConstants.STRING.TYPE, argExpressions, remainingArgTypes)
{
@Override
protected StringAttributeValue evaluate(StringAttributeValue[] args) throws IndeterminateEvaluationException
protected StringAttributeValue evaluate(Deque<StringAttributeValue> args) throws IndeterminateEvaluationException
{
return eval(args[0]);
return eval(args.getFirst());
}
};
......
......@@ -34,6 +34,7 @@
package com.sun.xacml.cond;
import java.util.Calendar;
import java.util.Deque;
import java.util.List;
import java.util.TimeZone;
......@@ -192,13 +193,17 @@ public class TimeInRangeFunction extends FirstOrderFunction<BooleanAttributeValu
@Override
protected FirstOrderFunctionCall<BooleanAttributeValue> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes) throws IllegalArgumentException
{
return new EagerSinglePrimitiveTypeEval<BooleanAttributeValue, TimeAttributeValue>(signature, TimeAttributeValue[].class, argExpressions, remainingArgTypes)
return new EagerSinglePrimitiveTypeEval<BooleanAttributeValue, TimeAttributeValue>(signature, DatatypeConstants.TIME.TYPE, argExpressions, remainingArgTypes)
{
@Override
protected BooleanAttributeValue evaluate(TimeAttributeValue[] args) throws IndeterminateEvaluationException
protected BooleanAttributeValue evaluate(Deque<TimeAttributeValue> args) throws IndeterminateEvaluationException
{
return BooleanAttributeValue.valueOf(eval(args[0], args[1], args[2]));
/*
* args.poll() returns the first element and remove it from the stack, so that next
* poll() returns the next element (and removes it from the stack), etc.
*/
return BooleanAttributeValue.valueOf(eval(args.poll(), args.poll(), args.poll()));
}
};
}
......
......@@ -33,7 +33,6 @@
*/
package com.sun.xacml.ctx;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
......@@ -199,12 +198,12 @@ public class Status extends oasis.names.tc.xacml._3_0.core.schema.wd_17.Status
*
* @param args
*/
public static void main(String[] args)
{
final String[] codes = { "XXX", "YYY", "ZZZ" };
final List<String> codeList = Arrays.asList(codes);
final Status status = new Status(codeList, "OK", null);
System.out.println(status);
}
// public static void main(String[] args)
// {
// final String[] codes = { "XXX", "YYY", "ZZZ" };
// final List<String> codeList = Arrays.asList(codes);
// final Status status = new Status(codeList, "OK", null);
// System.out.println(status);
// }
}
......@@ -36,10 +36,9 @@ package com.sun.xacml.finder;
import com.sun.xacml.attr.xacmlv3.AttributeDesignator;
import com.thalesgroup.authzforce.core.attr.AttributeGUID;
import com.thalesgroup.authzforce.core.attr.AttributeValue;
import com.thalesgroup.authzforce.core.eval.BagDatatype;
import com.thalesgroup.authzforce.core.eval.Bag;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
import com.thalesgroup.authzforce.core.eval.Bag;
/**
* AttributeFinder used to resolve {@link AttributeDesignator}s.
......@@ -69,6 +68,6 @@ public interface AttributeFinder
* @throws IndeterminateEvaluationException
* if any error finding attribute value
*/
<AV extends AttributeValue<AV>> Bag<AV> findAttribute(AttributeGUID attributeGUID, EvaluationContext context, BagDatatype<AV> resultDatatype) throws IndeterminateEvaluationException;
<AV extends AttributeValue<AV>> Bag<AV> findAttribute(AttributeGUID attributeGUID, EvaluationContext context, Bag.Datatype<AV> resultDatatype) throws IndeterminateEvaluationException;
}
......@@ -44,7 +44,6 @@ import com.thalesgroup.authzforce.core.attr.AttributeGUID;
import com.thalesgroup.authzforce.core.attr.AttributeValue;
import com.thalesgroup.authzforce.core.attr.DatatypeFactoryRegistry;
import com.thalesgroup.authzforce.core.eval.Bag;
import com.thalesgroup.authzforce.core.eval.BagDatatype;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
......@@ -70,10 +69,8 @@ public abstract class AttributeFinderModule implements Closeable
* created module's job of finding its own supported attribute values based on other attributes
* in the evaluation context.
*
* @param <CONF_U>
* module configuration type (JAXB-generated)
*/
public static interface DependencyAwareFactory<CONF_U>
public interface DependencyAwareFactory
{
/**
......@@ -133,7 +130,7 @@ public abstract class AttributeFinderModule implements Closeable
* @return a factory aware of dependencies (required attributes) possibly inferred from
* input {@code conf}
*/
public abstract DependencyAwareFactory<CONF_T> parseDependencies(CONF_T conf);
public abstract DependencyAwareFactory parseDependencies(CONF_T conf);
}
protected static final UnsupportedOperationException UNSUPPORTED_ATTRIBUTE_CATEGORY_EXCEPTION = new UnsupportedOperationException("Unsupported attribute category");
......@@ -216,5 +213,5 @@ public abstract class AttributeFinderModule implements Closeable
* @throws IndeterminateEvaluationException
* if some error occurs, esp. error retrieving the attribute values
*/
public abstract <AV extends AttributeValue<AV>> Bag<AV> findAttribute(AttributeGUID attributeGUID, EvaluationContext context, BagDatatype<AV> returnDatatype) throws IndeterminateEvaluationException;
public abstract <AV extends AttributeValue<AV>> Bag<AV> findAttribute(AttributeGUID attributeGUID, EvaluationContext context, Bag.Datatype<AV> returnDatatype) throws IndeterminateEvaluationException;
}
......@@ -20,6 +20,7 @@ package com.thalesgroup.authzforce.core;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Deque;
import java.util.List;
import javax.xml.bind.JAXBElement;
......@@ -43,7 +44,7 @@ import com.thalesgroup.authzforce.core.func.FunctionCall;
* @param <V>
* evaluation's return type
*/
public class Apply<V extends Expression.Value<?, V>> extends ApplyType implements Expression<V>
public final class Apply<V extends Expression.Value<V>> extends ApplyType implements Expression<V>
{
private final FunctionCall<V> functionCall;
......@@ -61,7 +62,7 @@ public class Apply<V extends Expression.Value<?, V>> extends ApplyType implement
* @see oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType#setFunctionId(java.lang.String)
*/
@Override
public final void setFunctionId(String value)
public void setFunctionId(String value)
{
// Make it read-only to avoid being de-synchronized with functionCall field derived from it
throw UNSUPPORTED_FUNCTION_ID_CHANGE_EXCEPTION;
......@@ -92,7 +93,7 @@ public class Apply<V extends Expression.Value<?, V>> extends ApplyType implement
* for this function; or if all {@code xprs} are static but calling the function
* statically (with these static arguments) failed
*/
public static Apply<?> getInstance(ApplyType xacmlApply, XPathCompiler xPathCompiler, Expression.Factory expFactory, List<String> longestVarRefChain) throws ParsingException
public static Apply<?> getInstance(ApplyType xacmlApply, XPathCompiler xPathCompiler, Expression.Factory expFactory, Deque<String> longestVarRefChain) throws ParsingException
{
if (xacmlApply == null)
{
......
......@@ -41,7 +41,7 @@ public interface DecisionCache extends Closeable
* @param <CONF_T>
* type of extension configuration (initialization parameters)
*/
public static abstract class Factory<CONF_T extends AbstractDecisionCache> extends JaxbBoundPdpExtension<CONF_T>
abstract class Factory<CONF_T extends AbstractDecisionCache> extends JaxbBoundPdpExtension<CONF_T>
{
/**
......
......@@ -93,7 +93,7 @@ public final class DefaultRequestFilter extends RequestFilter
}
@Override
public final List<IndividualDecisionRequest> filter(Request jaxbRequest) throws IndeterminateEvaluationException
public List<IndividualDecisionRequest> filter(Request jaxbRequest) throws IndeterminateEvaluationException
{
// MultiRequests element not supported (optional XACML feature)
if (jaxbRequest.getMultiRequests() != null)
......
......@@ -78,7 +78,7 @@ public final class MultiDecisionRequestFilter extends RequestFilter
}
@Override
public final List<IndividualDecisionRequest> filter(Request request) throws IndeterminateEvaluationException
public List<IndividualDecisionRequest> filter(Request request) throws IndeterminateEvaluationException
{
/*
* No support for MultiRequests (§2.4 of Multiple Decision Profile). We only support §2.3
......
......@@ -275,7 +275,7 @@ public class PdpConfigurationParser
for (final AbstractAttributeFinder jaxbAttrFinder : pdpJaxbConf.getAttributeFinders())
{
final AttributeFinderModule.Factory<AbstractAttributeFinder> attrFinderModBuilder = PdpExtensionLoader.getJaxbBoundExtension(AttributeFinderModule.Factory.class, jaxbAttrFinder.getClass());
final AttributeFinderModule.DependencyAwareFactory<AbstractAttributeFinder> depAwareAttrFinderModBuilder = attrFinderModBuilder.parseDependencies(jaxbAttrFinder);
final AttributeFinderModule.DependencyAwareFactory depAwareAttrFinderModBuilder = attrFinderModBuilder.parseDependencies(jaxbAttrFinder);
final Set<AttributeDesignatorType> requiredAttrs = depAwareAttrFinderModBuilder.getDependencies();
final Map<AttributeGUID, AttributeFinderModule> requiredAttrFinderModsByAttrId = new HashMap<>();
if (requiredAttrs != null)
......@@ -409,4 +409,5 @@ public class PdpConfigurationParser
return false;
}
}
......@@ -72,7 +72,7 @@ public abstract class RequestFilter
* Factory of RequestFilters
*
*/
public static interface Factory extends PdpExtension
public interface Factory extends PdpExtension
{
/**
* Create instance of RequestFilter
......@@ -101,7 +101,7 @@ public abstract class RequestFilter
RequestFilter getInstance(DatatypeFactoryRegistry datatypeFactoryRegistry, boolean requireContentForXPath, JAXBContext attributesContentJaxbCtx, Processor xmlProcessor);
}
protected static interface XACMLAttributesParser
protected interface XACMLAttributesParser
{
/**
......@@ -395,7 +395,7 @@ public abstract class RequestFilter
}
}
protected static AttributeGUID RESOURCE_SCOPE_ATTRIBUTE_GUID = new AttributeGUID(XACMLCategory.XACML_3_0_RESOURCE_CATEGORY_RESOURCE.value(), null, XACMLAttributeId.XACML_RESOURCE_SCOPE.value());
protected static final AttributeGUID RESOURCE_SCOPE_ATTRIBUTE_GUID = new AttributeGUID(XACMLCategory.XACML_3_0_RESOURCE_CATEGORY_RESOURCE.value(), null, XACMLAttributeId.XACML_RESOURCE_SCOPE.value());
protected static final IndeterminateEvaluationException UNSUPPORTED_MULTIPLE_SCOPE_EXCEPTION = new IndeterminateEvaluationException("Unsupported resource scope. Expected scope: none or " + XACMLResourceScope.IMMEDIATE.value()
+ ". (Profile 'urn:oasis:names:tc:xacml:3.0:profile:multiple:scope' not supported.)", Status.STATUS_SYNTAX_ERROR);
......
......@@ -153,7 +153,7 @@ public class SchemaHandler
}
} catch (IOException e)
{
// ignore
LOGGER.warn("Error resolving resource needed by org.apache.xml.resolver.CatalogResolver for OASIS CatalogManager with URL: {}", e);
}
}
return s;
......@@ -182,13 +182,13 @@ public class SchemaHandler
}
} catch (URISyntaxException e)
{
// just process as is
LOGGER.warn("Error resolving XML catalog URL ({}) to a file", catalogURL, e);
}
}
if (catalog == null)
{
LOGGER.warn("Catalog found at {} but no org.apache.xml.resolver.CatalogManager was found." + " Check the classpatch for an xmlresolver jar.", catalogURL);
LOGGER.warn("Catalog found at {} but no org.apache.xml.resolver.CatalogManager was found. Check the classpatch for an xmlresolver jar.", catalogURL);
} else
{
catalog.parseCatalog(catalogURL);
......
......@@ -20,6 +20,9 @@ package com.thalesgroup.authzforce.core.attr;
import net.sf.saxon.lib.StandardURIChecker;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
/**
* Represent the URI value that this class represents
* <p>
......@@ -98,7 +101,7 @@ public class AnyURIAttributeValue extends SimpleAttributeValue<String, AnyURIAtt
}
@Override
public AnyURIAttributeValue one()
public AnyURIAttributeValue evaluate(EvaluationContext context) throws IndeterminateEvaluationException
{
return this;
}
......
......@@ -19,7 +19,6 @@
package com.thalesgroup.authzforce.core.attr;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -37,11 +36,7 @@ import org.w3c.dom.Element;
import com.thalesgroup.authzforce.core.PdpExtension;
import com.thalesgroup.authzforce.core.XACMLBindingUtils;
import com.thalesgroup.authzforce.core.eval.Bag;
import com.thalesgroup.authzforce.core.eval.BagDatatype;
import com.thalesgroup.authzforce.core.eval.Bags;
import com.thalesgroup.authzforce.core.eval.EvaluationContext;
import com.thalesgroup.authzforce.core.eval.Expression.Value;
import com.thalesgroup.authzforce.core.eval.IndeterminateEvaluationException;
/**