use of org.apache.wss4j.policy.model.Layout in project cxf by apache.
the class LayoutPolicyValidator method validatePolicies.
/**
* Validate policies.
*/
public void validatePolicies(PolicyValidatorParameters parameters, Collection<AssertionInfo> ais) {
for (AssertionInfo ai : ais) {
Layout layout = (Layout) ai.getAssertion();
ai.setAsserted(true);
assertToken(layout, parameters.getAssertionInfoMap());
if (!validatePolicy(layout, parameters.getResults().getResults(), parameters.getSignedResults())) {
String error = "Layout does not match the requirements";
ai.setNotAsserted(error);
}
}
}
use of org.apache.wss4j.policy.model.Layout in project cxf by apache.
the class AbstractStaxBindingHandler method configureLayout.
protected void configureLayout(AssertionInfoMap aim) {
AssertionInfo ai = PolicyUtils.getFirstAssertionByLocalname(aim, SPConstants.LAYOUT);
Layout layout = null;
if (ai != null) {
layout = (Layout) ai.getAssertion();
ai.setAsserted(true);
}
if (layout != null && layout.getLayoutType() != null) {
assertPolicy(new QName(layout.getName().getNamespaceURI(), layout.getLayoutType().name()));
}
if (!timestampAdded) {
return;
}
boolean timestampLast = layout != null && layout.getLayoutType() == LayoutType.LaxTsLast;
WSSConstants.Action actionToPerform = WSSConstants.TIMESTAMP;
List<WSSConstants.Action> actionList = properties.getActions();
if (timestampLast) {
actionList.add(0, actionToPerform);
} else {
actionList.add(actionToPerform);
}
}
Aggregations