private void unassertPolicy(AssertionInfoMap aim, QName q, String msg) { Collection<AssertionInfo> ais = aim.get(q); if (ais != null && !ais.isEmpty()) { for (AssertionInfo ai : ais) { ai.setNotAsserted(msg); } } }
@Override public void unassertPolicy(QName qName, String reason) { Collection<AssertionInfo> ais = aim.getAssertionInfo(qName); if (ais != null && !ais.isEmpty()) { for (AssertionInfo ai : ais) { ai.setNotAsserted(reason); } } }
private void unassertPolicy(AssertionInfoMap aim, QName q, String msg) { Collection<AssertionInfo> ais = aim.get(q); if (ais != null && !ais.isEmpty()) { for (AssertionInfo ai : ais) { ai.setNotAsserted(msg); } } }
@Override public void unassertPolicy(QName qName, String reason) { Collection<AssertionInfo> ais = aim.getAssertionInfo(qName); if (ais != null && !ais.isEmpty()) { for (AssertionInfo ai : ais) { ai.setNotAsserted(reason); } } }
@Override public void unassertPolicy(Assertion assertion, String reason) { Collection<AssertionInfo> ais = aim.getAssertionInfo(assertion.getName()); if (ais != null && !ais.isEmpty()) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason); } } } }
@Override public void unassertPolicy(Assertion assertion, String reason) { Collection<AssertionInfo> ais = aim.getAssertionInfo(assertion.getName()); if (ais != null && !ais.isEmpty()) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason); } } } }
public void handleMessage(SoapMessage message) throws Fault { boolean foundSCT = NegotiationUtils.parseSCTResult(message); AssertionInfoMap aim = message.get(AssertionInfoMap.class); // extract Assertion information if (aim != null) { Collection<AssertionInfo> ais = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.SPNEGO_CONTEXT_TOKEN); if (ais.isEmpty()) { return; } for (AssertionInfo inf : ais) { if (foundSCT) { inf.setAsserted(true); } else { inf.setNotAsserted("No SecurityContextToken token found in message."); } } } } }
protected void policyNotAsserted(AbstractToken assertion, Exception reason, SoapMessage message) { if (assertion == null) { return; } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason.getMessage()); } } } throw new PolicyException(reason); }
protected void policyNotAsserted(AbstractToken assertion, Exception reason, SoapMessage message) { if (assertion == null) { return; } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason.getMessage()); } } } throw new PolicyException(reason); }
protected void unassertPolicy(Assertion assertion, Exception reason) { if (assertion == null) { return; } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Not asserting " + assertion.getName() + ": " + reason); } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason.getMessage()); } } } if (!assertion.isOptional()) { throw new PolicyException(new Message(reason.getMessage(), LOG), reason); } }
protected void unassertPolicy(Assertion assertion, Exception reason) { if (assertion == null) { return; } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Not asserting " + assertion.getName() + ": " + reason); } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason.getMessage()); } } } if (!assertion.isOptional()) { throw new PolicyException(new Message(reason.getMessage(), LOG), reason); } }
private boolean checkRecipientTokens( AbstractTokenWrapper wrapper, AsymmetricBinding binding, AssertionInfo ai, AssertionInfoMap aim, boolean hasDerivedKeys, List<WSSecurityEngineResult> signedResults, List<WSSecurityEngineResult> encryptedResults) { PolicyUtils.assertPolicy(aim, wrapper.getName()); if (!checkDerivedKeys(wrapper, hasDerivedKeys, signedResults, encryptedResults)) { ai.setNotAsserted("Message fails the DerivedKeys requirement"); return false; } assertDerivedKeys(wrapper.getToken(), aim); return true; }
private boolean checkRecipientTokens( AbstractTokenWrapper wrapper, AsymmetricBinding binding, AssertionInfo ai, AssertionInfoMap aim, boolean hasDerivedKeys, List<WSSecurityEngineResult> signedResults, List<WSSecurityEngineResult> encryptedResults) { PolicyUtils.assertPolicy(aim, wrapper.getName()); if (!checkDerivedKeys(wrapper, hasDerivedKeys, signedResults, encryptedResults)) { ai.setNotAsserted("Message fails the DerivedKeys requirement"); return false; } assertDerivedKeys(wrapper.getToken(), aim); return true; }
/** * Validate policies. */ public void validatePolicies(PolicyValidatorParameters parameters, Collection<AssertionInfo> ais) { Element header = parameters.getSoapHeader(); for (AssertionInfo ai : ais) { RequiredParts rp = (RequiredParts)ai.getAssertion(); ai.setAsserted(true); for (Header h : rp.getHeaders()) { QName qName = new QName(h.getNamespace(), h.getName()); if (header == null || DOMUtils.getFirstChildWithName(header, qName) == null) { ai.setNotAsserted("No header element of name " + qName + " found."); } } } }
/** * Validate policies. */ public void validatePolicies(PolicyValidatorParameters parameters, Collection<AssertionInfo> ais) { Element header = parameters.getSoapHeader(); for (AssertionInfo ai : ais) { RequiredParts rp = (RequiredParts)ai.getAssertion(); ai.setAsserted(true); for (Header h : rp.getHeaders()) { QName qName = new QName(h.getNamespace(), h.getName()); if (header == null || DOMUtils.getFirstChildWithName(header, qName) == null) { ai.setNotAsserted("No header element of name " + qName + " found."); } } } }
protected void unassertPolicy(Assertion assertion, String reason) { if (assertion == null) { return; } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Not asserting " + assertion.getName() + ": " + reason); } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason); } } } if (!assertion.isOptional()) { throw new PolicyException(new Message(reason, LOG)); } }
/** * 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); } } }
/** * 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); } } }
protected void policyNotAsserted(AbstractToken assertion, String reason, SoapMessage message) { if (assertion == null) { return; } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason); } } } if (!assertion.isOptional()) { throw new PolicyException(new Message(reason, LOG)); } }
protected void policyNotAsserted(AbstractToken assertion, String reason, SoapMessage message) { if (assertion == null) { return; } AssertionInfoMap aim = message.get(AssertionInfoMap.class); Collection<AssertionInfo> ais = aim.get(assertion.getName()); if (ais != null) { for (AssertionInfo ai : ais) { if (ai.getAssertion() == assertion) { ai.setNotAsserted(reason); } } } if (!assertion.isOptional()) { throw new PolicyException(new Message(reason, LOG)); } }