This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch coheigea/saml-refactor in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
The following commit(s) were added to refs/heads/coheigea/saml-refactor by this push: new 3a3d70264 Remove SAML from WSSecurityEngineResult 3a3d70264 is described below commit 3a3d702647ae8fa5f5486ab3d6ed9973dbc2805a Author: Colm O hEigeartaigh <cohei...@apache.org> AuthorDate: Fri Nov 3 07:23:48 2023 +0000 Remove SAML from WSSecurityEngineResult --- .../java/org/apache/wss4j/dom/engine/WSSecurityEngineResult.java | 7 +++---- .../java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ws-security-dom/src/main/java/org/apache/wss4j/dom/engine/WSSecurityEngineResult.java b/ws-security-dom/src/main/java/org/apache/wss4j/dom/engine/WSSecurityEngineResult.java index 5835be269..fb446eb74 100644 --- a/ws-security-dom/src/main/java/org/apache/wss4j/dom/engine/WSSecurityEngineResult.java +++ b/ws-security-dom/src/main/java/org/apache/wss4j/dom/engine/WSSecurityEngineResult.java @@ -19,13 +19,13 @@ package org.apache.wss4j.dom.engine; -import org.apache.wss4j.saml.SamlAssertionWrapper; import org.apache.wss4j.common.token.BinarySecurity; import org.apache.wss4j.dom.WSDataRef; import org.apache.wss4j.dom.message.token.SecurityContextToken; import org.apache.wss4j.dom.message.token.SignatureConfirmation; import org.apache.wss4j.dom.message.token.Timestamp; import org.apache.wss4j.dom.message.token.UsernameToken; +import org.w3c.dom.Element; import java.security.Principal; import java.security.cert.X509Certificate; @@ -241,12 +241,11 @@ public class WSSecurityEngineResult extends java.util.HashMap<String, Object> { public WSSecurityEngineResult( int act, - SamlAssertionWrapper ass + Element token ) { put(TAG_ACTION, act); - put(TAG_SAML_ASSERTION, ass); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); - put(TAG_TOKEN_ELEMENT, ass.getElement()); + put(TAG_TOKEN_ELEMENT, token); } public WSSecurityEngineResult( diff --git a/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java b/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java index 626c76af7..2c9f61b1c 100644 --- a/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java +++ b/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java @@ -117,12 +117,13 @@ public class SAMLTokenProcessor implements Processor { data.getWsDocInfo().addTokenElement(elem); WSSecurityEngineResult result = null; if (samlAssertion.isSigned()) { - result = new WSSecurityEngineResult(WSConstants.ST_SIGNED, samlAssertion); + result = new WSSecurityEngineResult(WSConstants.ST_SIGNED, samlAssertion.getElement()); result.put(WSSecurityEngineResult.TAG_DATA_REF_URIS, dataRefs); result.put(WSSecurityEngineResult.TAG_SIGNATURE_VALUE, samlAssertion.getSignatureValue()); } else { - result = new WSSecurityEngineResult(WSConstants.ST_UNSIGNED, samlAssertion); + result = new WSSecurityEngineResult(WSConstants.ST_UNSIGNED, samlAssertion.getElement()); } + result.put(WSSecurityEngineResult.TAG_SAML_ASSERTION, samlAssertion); if (id.length() != 0) { result.put(WSSecurityEngineResult.TAG_ID, id);