You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/08/04 19:35:11 UTC
[11/12] cxf git commit: Fix static references to appropraite class
Fix static references to appropraite class
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a5dd7fa0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a5dd7fa0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a5dd7fa0
Branch: refs/heads/master
Commit: a5dd7fa02b73852f250c8d87b10c7fc1a6e1f4a6
Parents: 903ef61
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Aug 4 14:32:13 2017 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Aug 4 14:32:13 2017 -0400
----------------------------------------------------------------------
.../wss4j/AbstractWSS4JInterceptor.java | 15 +-
.../wss4j/PolicyBasedWSS4JInInterceptor.java | 32 +--
.../wss4j/PolicyBasedWSS4JOutInterceptor.java | 4 +-
.../ws/security/wss4j/WSS4JInInterceptor.java | 13 +-
.../ws/security/wss4j/WSS4JOutInterceptor.java | 13 +-
.../security/wss4j/WSS4JStaxInInterceptor.java | 7 +-
.../policyhandlers/AbstractBindingBuilder.java | 3 +-
.../wss4j/AbstractPolicySecurityTest.java | 15 +-
.../wss4j/CryptoCoverageCheckerTest.java | 16 +-
.../DOMToStaxEncryptionIdentifierTest.java | 52 ++---
.../security/wss4j/DOMToStaxRoundTripTest.java | 136 ++++++-------
.../wss4j/DOMToStaxSignatureIdentifierTest.java | 52 ++---
.../wss4j/DefaultCryptoCoverageCheckerTest.java | 14 +-
.../cxf/ws/security/wss4j/RoundTripTest.java | 36 ++--
.../security/wss4j/SecurityActionTokenTest.java | 13 +-
.../wss4j/SignatureConfirmationTest.java | 19 +-
.../StaxToDOMEncryptionIdentifierTest.java | 34 ++--
.../security/wss4j/StaxToDOMRoundTripTest.java | 201 +++++++++----------
.../wss4j/StaxToDOMSignatureIdentifierTest.java | 36 ++--
.../wss4j/UserNameTokenAuthorizationTest.java | 56 +++---
.../ws/security/wss4j/WSS4JFaultCodeTest.java | 36 ++--
.../cxf/ws/security/wss4j/WSS4JInOutTest.java | 123 ++++++------
.../security/wss4j/WSS4JOutInterceptorTest.java | 54 ++---
.../security/wss4j/saml/DOMToStaxSamlTest.java | 58 +++---
.../ws/security/wss4j/saml/SamlTokenTest.java | 119 +++++------
.../security/wss4j/saml/StaxToDOMSamlTest.java | 57 +++---
26 files changed, 610 insertions(+), 604 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
index ffcb0bc..0d57a9a 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
@@ -42,7 +42,6 @@ import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.dom.WSConstants;
import org.apache.wss4j.dom.handler.RequestData;
import org.apache.wss4j.dom.handler.WSHandler;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
public abstract class AbstractWSS4JInterceptor extends WSHandler implements SoapInterceptor,
PhaseInterceptor<SoapMessage> {
@@ -150,34 +149,34 @@ public abstract class AbstractWSS4JInterceptor extends WSHandler implements Soap
protected void translateProperties(SoapMessage msg) {
String bspCompliant = (String)msg.getContextualProperty(SecurityConstants.IS_BSP_COMPLIANT);
if (bspCompliant != null) {
- msg.put(WSHandlerConstants.IS_BSP_COMPLIANT, bspCompliant);
+ msg.put(ConfigurationConstants.IS_BSP_COMPLIANT, bspCompliant);
}
String futureTTL =
(String)msg.getContextualProperty(SecurityConstants.TIMESTAMP_FUTURE_TTL);
if (futureTTL != null) {
- msg.put(WSHandlerConstants.TTL_FUTURE_TIMESTAMP, futureTTL);
+ msg.put(ConfigurationConstants.TTL_FUTURE_TIMESTAMP, futureTTL);
}
String ttl =
(String)msg.getContextualProperty(SecurityConstants.TIMESTAMP_TTL);
if (ttl != null) {
- msg.put(WSHandlerConstants.TTL_TIMESTAMP, ttl);
+ msg.put(ConfigurationConstants.TTL_TIMESTAMP, ttl);
}
String utFutureTTL =
(String)msg.getContextualProperty(SecurityConstants.USERNAMETOKEN_FUTURE_TTL);
if (utFutureTTL != null) {
- msg.put(WSHandlerConstants.TTL_FUTURE_USERNAMETOKEN, utFutureTTL);
+ msg.put(ConfigurationConstants.TTL_FUTURE_USERNAMETOKEN, utFutureTTL);
}
String utTTL =
(String)msg.getContextualProperty(SecurityConstants.USERNAMETOKEN_TTL);
if (utTTL != null) {
- msg.put(WSHandlerConstants.TTL_USERNAMETOKEN, utTTL);
+ msg.put(ConfigurationConstants.TTL_USERNAMETOKEN, utTTL);
}
String certConstraints =
(String)SecurityUtils.getSecurityPropertyValue(SecurityConstants.SUBJECT_CERT_CONSTRAINTS, msg);
if (certConstraints != null) {
- msg.put(WSHandlerConstants.SIG_SUBJECT_CERT_CONSTRAINTS, certConstraints);
+ msg.put(ConfigurationConstants.SIG_SUBJECT_CERT_CONSTRAINTS, certConstraints);
}
// Now set SAML SenderVouches + Holder Of Key requirements
@@ -189,7 +188,7 @@ public abstract class AbstractWSS4JInterceptor extends WSHandler implements Soap
validateSAMLSubjectConf = Boolean.parseBoolean(valSAMLSubjectConf);
}
msg.put(
- WSHandlerConstants.VALIDATE_SAML_SUBJECT_CONFIRMATION,
+ ConfigurationConstants.VALIDATE_SAML_SUBJECT_CONFIRMATION,
Boolean.toString(validateSAMLSubjectConf)
);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
index 1b83bcf..34c5faa 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
@@ -42,6 +42,7 @@ import org.apache.cxf.ws.security.policy.PolicyUtils;
import org.apache.cxf.ws.security.wss4j.policyvalidators.PolicyValidatorParameters;
import org.apache.cxf.ws.security.wss4j.policyvalidators.SecurityPolicyValidator;
import org.apache.cxf.ws.security.wss4j.policyvalidators.ValidatorUtils;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.PasswordEncryptor;
import org.apache.wss4j.common.ext.WSSecurityException;
@@ -49,7 +50,6 @@ import org.apache.wss4j.dom.WSConstants;
import org.apache.wss4j.dom.WSDataRef;
import org.apache.wss4j.dom.engine.WSSecurityEngineResult;
import org.apache.wss4j.dom.handler.RequestData;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.dom.handler.WSHandlerResult;
import org.apache.wss4j.dom.message.token.Timestamp;
import org.apache.wss4j.policy.SP12Constants;
@@ -82,14 +82,14 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
private void handleWSS11(AssertionInfoMap aim, SoapMessage message) {
if (isRequestor(message)) {
- message.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "false");
+ message.put(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, "false");
Collection<AssertionInfo> ais =
PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.WSS11);
if (!ais.isEmpty()) {
for (AssertionInfo ai : ais) {
Wss11 wss11 = (Wss11)ai.getAssertion();
if (wss11.isRequireSignatureConfirmation()) {
- message.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
+ message.put(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
break;
}
}
@@ -137,16 +137,16 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
final String signCryptoRefId = signCrypto != null ? "RefId-" + signCrypto.hashCode() : null;
if (signCrypto != null) {
- message.put(WSHandlerConstants.DEC_PROP_REF_ID, signCryptoRefId);
+ message.put(ConfigurationConstants.DEC_PROP_REF_ID, signCryptoRefId);
message.put(signCryptoRefId, signCrypto);
}
if (encrCrypto != null) {
final String encCryptoRefId = "RefId-" + encrCrypto.hashCode();
- message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, encCryptoRefId);
+ message.put(ConfigurationConstants.SIG_VER_PROP_REF_ID, encCryptoRefId);
message.put(encCryptoRefId, encrCrypto);
} else if (signCrypto != null) {
- message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, signCryptoRefId);
+ message.put(ConfigurationConstants.SIG_VER_PROP_REF_ID, signCryptoRefId);
message.put(signCryptoRefId, signCrypto);
}
@@ -177,16 +177,16 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
final String signCryptoRefId = signCrypto != null ? "RefId-" + signCrypto.hashCode() : null;
if (signCrypto != null) {
- message.put(WSHandlerConstants.DEC_PROP_REF_ID, signCryptoRefId);
+ message.put(ConfigurationConstants.DEC_PROP_REF_ID, signCryptoRefId);
message.put(signCryptoRefId, signCrypto);
}
if (encrCrypto != null) {
final String encCryptoRefId = "RefId-" + encrCrypto.hashCode();
- message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, encCryptoRefId);
+ message.put(ConfigurationConstants.SIG_VER_PROP_REF_ID, encCryptoRefId);
message.put(encCryptoRefId, encrCrypto);
} else if (signCrypto != null) {
- message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, signCryptoRefId);
+ message.put(ConfigurationConstants.SIG_VER_PROP_REF_ID, signCryptoRefId);
message.put(signCryptoRefId, signCrypto);
}
@@ -251,7 +251,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
for (AssertionInfo ai : ais) {
UsernameToken policy = (UsernameToken)ai.getAssertion();
if (policy.getPasswordType() == PasswordType.NoPassword) {
- message.put(WSHandlerConstants.ALLOW_USERNAMETOKEN_NOPASSWORD, "true");
+ message.put(ConfigurationConstants.ALLOW_USERNAMETOKEN_NOPASSWORD, "true");
}
}
}
@@ -291,7 +291,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
}
if (crypto != null) {
final String refId = "RefId-" + crypto.hashCode();
- message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, refId);
+ message.put(ConfigurationConstants.SIG_VER_PROP_REF_ID, refId);
message.put(refId, crypto);
}
@@ -301,7 +301,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
}
if (crypto != null) {
final String refId = "RefId-" + crypto.hashCode();
- message.put(WSHandlerConstants.DEC_PROP_REF_ID, refId);
+ message.put(ConfigurationConstants.DEC_PROP_REF_ID, refId);
message.put(refId, crypto);
}
} else {
@@ -311,7 +311,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
}
if (crypto != null) {
final String refId = "RefId-" + crypto.hashCode();
- message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, refId);
+ message.put(ConfigurationConstants.SIG_VER_PROP_REF_ID, refId);
message.put(refId, crypto);
}
@@ -321,7 +321,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
}
if (crypto != null) {
final String refId = "RefId-" + crypto.hashCode();
- message.put(WSHandlerConstants.DEC_PROP_REF_ID, refId);
+ message.put(ConfigurationConstants.DEC_PROP_REF_ID, refId);
message.put(refId, crypto);
}
}
@@ -383,7 +383,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
}
protected void computeAction(SoapMessage message, RequestData data) throws WSSecurityException {
- String action = getString(WSHandlerConstants.ACTION, message);
+ String action = getString(ConfigurationConstants.ACTION, message);
if (action == null) {
action = "";
}
@@ -472,7 +472,7 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor {
}
}
- message.put(WSHandlerConstants.ACTION, action.trim());
+ message.put(ConfigurationConstants.ACTION, action.trim());
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
index dc35ded..f167c59 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
@@ -46,10 +46,10 @@ import org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler;
import org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandler;
import org.apache.cxf.ws.security.wss4j.policyhandlers.TransportBindingHandler;
import org.apache.neethi.Policy;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.ThreadLocalSecurityProvider;
import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.dom.engine.WSSConfig;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.dom.message.WSSecHeader;
import org.apache.wss4j.policy.model.AbstractBinding;
import org.apache.wss4j.policy.model.AsymmetricBinding;
@@ -225,7 +225,7 @@ public class PolicyBasedWSS4JOutInterceptor extends AbstractPhaseInterceptor<Soa
private void translateProperties(SoapMessage msg) {
String bspCompliant = (String)msg.getContextualProperty(SecurityConstants.IS_BSP_COMPLIANT);
if (bspCompliant != null) {
- msg.put(WSHandlerConstants.IS_BSP_COMPLIANT, bspCompliant);
+ msg.put(ConfigurationConstants.IS_BSP_COMPLIANT, bspCompliant);
}
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
index 6fdd656..5272bd5 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
@@ -62,6 +62,7 @@ import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.ws.security.SecurityConstants;
import org.apache.cxf.ws.security.tokenstore.TokenStore;
import org.apache.cxf.ws.security.tokenstore.TokenStoreUtils;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.cache.ReplayCache;
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.ThreadLocalSecurityProvider;
@@ -231,7 +232,7 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
List<Integer> actions = WSSecurityUtil.decodeAction(action);
- String actor = (String)getOption(WSHandlerConstants.ACTOR);
+ String actor = (String)getOption(ConfigurationConstants.ACTOR);
if (actor == null) {
actor = (String)msg.getContextualProperty(SecurityConstants.ACTOR);
}
@@ -254,8 +255,8 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
// Only search for and expand (Signed) XOP Elements if MTOM is enabled (and not
// explicitly specified by the user)
- if (getString(WSHandlerConstants.EXPAND_XOP_INCLUDE_FOR_SIGNATURE, msg) == null
- && getString(WSHandlerConstants.EXPAND_XOP_INCLUDE, msg) == null) {
+ if (getString(ConfigurationConstants.EXPAND_XOP_INCLUDE_FOR_SIGNATURE, msg) == null
+ && getString(ConfigurationConstants.EXPAND_XOP_INCLUDE, msg) == null) {
reqData.setExpandXopInclude(AttachmentUtil.isMtomEnabled(msg));
}
@@ -437,7 +438,7 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
// Now check to see if SIGNATURE_PARTS are specified
String signatureParts =
- (String)getProperty(msg, WSHandlerConstants.SIGNATURE_PARTS);
+ (String)getProperty(msg, ConfigurationConstants.SIGNATURE_PARTS);
if (signatureParts != null) {
String warning = "To enforce that particular elements were signed you must either "
+ "use WS-SecurityPolicy, or else use the CryptoCoverageChecker or "
@@ -572,9 +573,9 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
}
private String getAction(SoapMessage msg, SoapVersion version) {
- String action = (String)getOption(WSHandlerConstants.ACTION);
+ String action = (String)getOption(ConfigurationConstants.ACTION);
if (action == null) {
- action = (String)msg.get(WSHandlerConstants.ACTION);
+ action = (String)msg.get(ConfigurationConstants.ACTION);
}
if (action == null) {
LOG.warning("No security action was defined!");
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
index 6856e37..ee10d88 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
@@ -41,6 +41,7 @@ import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.Phase;
import org.apache.cxf.phase.PhaseInterceptor;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.ThreadLocalSecurityProvider;
import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.dom.WSConstants;
@@ -178,7 +179,7 @@ public class WSS4JOutInterceptor extends AbstractWSS4JInterceptor {
CastUtils.cast((List<?>)getProperty(mc, WSHandlerConstants.HANDLER_ACTIONS));
if (actions == null) {
// If null then just fall back to the "action" String
- String action = getString(WSHandlerConstants.ACTION, mc);
+ String action = getString(ConfigurationConstants.ACTION, mc);
if (action == null) {
throw new SoapFault(new Message("NO_ACTION", LOG), version
.getReceiver());
@@ -195,10 +196,10 @@ public class WSS4JOutInterceptor extends AbstractWSS4JInterceptor {
reqData.setAttachmentCallbackHandler(new AttachmentCallbackHandler(mc));
// Enable XOP Include unless the user has explicitly configured it
- if (getString(WSHandlerConstants.EXPAND_XOP_INCLUDE, mc) == null) {
+ if (getString(ConfigurationConstants.EXPAND_XOP_INCLUDE, mc) == null) {
reqData.setExpandXopInclude(AttachmentUtil.isMtomEnabled(mc));
}
- if (getString(WSHandlerConstants.STORE_BYTES_IN_ATTACHMENT, mc) == null) {
+ if (getString(ConfigurationConstants.STORE_BYTES_IN_ATTACHMENT, mc) == null) {
reqData.setStoreBytesInAttachment(AttachmentUtil.isMtomEnabled(mc));
}
@@ -206,10 +207,10 @@ public class WSS4JOutInterceptor extends AbstractWSS4JInterceptor {
* For every action we need a username, so get this now. The
* username defined in the deployment descriptor takes precedence.
*/
- reqData.setUsername((String) getOption(WSHandlerConstants.USER));
+ reqData.setUsername((String) getOption(ConfigurationConstants.USER));
if (reqData.getUsername() == null || reqData.getUsername().equals("")) {
String username = (String) getProperty(reqData.getMsgContext(),
- WSHandlerConstants.USER);
+ ConfigurationConstants.USER);
if (username != null) {
reqData.setUsername(username);
}
@@ -229,7 +230,7 @@ public class WSS4JOutInterceptor extends AbstractWSS4JInterceptor {
}
}
if (userNameRequired && (reqData.getUsername() == null || reqData.getUsername().equals(""))
- && (String)getOption(WSHandlerConstants.SIGNATURE_USER) == null) {
+ && (String)getOption(ConfigurationConstants.SIGNATURE_USER) == null) {
throw new SoapFault(new Message("NO_USERNAME", LOG), version
.getReceiver());
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
index 774f6ba..b2e3614 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.util.StreamReaderDelegate;
@@ -413,9 +414,9 @@ public class WSS4JStaxInInterceptor extends AbstractWSS4JStaxInterceptor {
XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
try {
int i = xmlReader.getEventType();
- while (i == XMLStreamReader.NAMESPACE
- || i == XMLStreamReader.ATTRIBUTE
- || i == XMLStreamReader.CHARACTERS) {
+ while (i == XMLStreamConstants.NAMESPACE
+ || i == XMLStreamConstants.ATTRIBUTE
+ || i == XMLStreamConstants.CHARACTERS) {
i = xmlReader.next();
}
} catch (XMLStreamException e) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index 833ebea..7879025 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -81,6 +81,7 @@ import org.apache.cxf.ws.security.wss4j.CXFCallbackLookup;
import org.apache.cxf.ws.security.wss4j.WSS4JUtils;
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.neethi.Assertion;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.WSEncryptionPart;
import org.apache.wss4j.common.bsp.BSPEnforcer;
import org.apache.wss4j.common.crypto.Crypto;
@@ -1660,7 +1661,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
if (encrUser == null || "".equals(encrUser)) {
unassertPolicy(token, "A " + (sign ? "signature" : "encryption") + " username needs to be declared.");
}
- if (WSHandlerConstants.USE_REQ_SIG_CERT.equals(encrUser)) {
+ if (ConfigurationConstants.USE_REQ_SIG_CERT.equals(encrUser)) {
List<WSHandlerResult> results =
CastUtils.cast((List<?>)
message.getExchange().getInMessage().get(WSHandlerConstants.RECV_RESULTS));
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
index c3407f2..82597de 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java
@@ -64,6 +64,7 @@ import org.apache.cxf.ws.security.tokenstore.TokenStore;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageUtil.CoverageType;
import org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor.PolicyBasedWSS4JOutInterceptorInternal;
import org.apache.neethi.Policy;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.CryptoFactory;
import org.apache.wss4j.common.crypto.CryptoType;
@@ -376,23 +377,23 @@ public abstract class AbstractPolicySecurityTest extends AbstractSecurityTest {
for (CoverageType type : types) {
switch(type) {
case SIGNED:
- action += " " + WSHandlerConstants.SIGNATURE;
+ action += " " + ConfigurationConstants.SIGNATURE;
break;
case ENCRYPTED:
- action += " " + WSHandlerConstants.ENCRYPT;
+ action += " " + ConfigurationConstants.ENCRYPT;
break;
default:
fail("Unsupported coverage type.");
}
}
- inHandler.setProperty(WSHandlerConstants.ACTION, action);
- inHandler.setProperty(WSHandlerConstants.SIG_VER_PROP_FILE,
+ inHandler.setProperty(ConfigurationConstants.ACTION, action);
+ inHandler.setProperty(ConfigurationConstants.SIG_VER_PROP_FILE,
"insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.DEC_PROP_FILE,
+ inHandler.setProperty(ConfigurationConstants.DEC_PROP_FILE,
"insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
+ inHandler.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS,
TestPwdCallback.class.getName());
- inHandler.setProperty(WSHandlerConstants.IS_BSP_COMPLIANT, "false");
+ inHandler.setProperty(ConfigurationConstants.IS_BSP_COMPLIANT, "false");
return inHandler;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageCheckerTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageCheckerTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageCheckerTest.java
index 283be4a..475e73a 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageCheckerTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageCheckerTest.java
@@ -40,7 +40,7 @@ import org.apache.cxf.phase.PhaseInterceptorChain;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageChecker.XPathExpression;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageUtil.CoverageScope;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageUtil.CoverageType;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.junit.Test;
@@ -235,17 +235,17 @@ public class CryptoCoverageCheckerTest extends AbstractSecurityTest {
private PhaseInterceptor<SoapMessage> getWss4jInInterceptor() {
final WSS4JInInterceptor inHandler = new WSS4JInInterceptor(true);
- final String action = WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT;
+ final String action = ConfigurationConstants.SIGNATURE + " " + ConfigurationConstants.ENCRYPT;
- inHandler.setProperty(WSHandlerConstants.ACTION, action);
- inHandler.setProperty(WSHandlerConstants.SIG_VER_PROP_FILE,
+ inHandler.setProperty(ConfigurationConstants.ACTION, action);
+ inHandler.setProperty(ConfigurationConstants.SIG_VER_PROP_FILE,
"insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.DEC_PROP_FILE,
+ inHandler.setProperty(ConfigurationConstants.DEC_PROP_FILE,
"insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
+ inHandler.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS,
TestPwdCallback.class.getName());
- inHandler.setProperty(WSHandlerConstants.IS_BSP_COMPLIANT, "false");
- inHandler.setProperty(WSHandlerConstants.ALLOW_RSA15_KEY_TRANSPORT_ALGORITHM, "true");
+ inHandler.setProperty(ConfigurationConstants.IS_BSP_COMPLIANT, "false");
+ inHandler.setProperty(ConfigurationConstants.ALLOW_RSA15_KEY_TRANSPORT_ALGORITHM, "true");
return inHandler;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxEncryptionIdentifierTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxEncryptionIdentifierTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxEncryptionIdentifierTest.java
index 553bb50..096f9c4 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxEncryptionIdentifierTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxEncryptionIdentifierTest.java
@@ -31,8 +31,8 @@ import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.Service;
import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.CryptoFactory;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.junit.Test;
@@ -64,11 +64,11 @@ public class DOMToStaxEncryptionIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.ENC_KEY_ID, "DirectReference");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ENC_KEY_ID, "DirectReference");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -97,11 +97,11 @@ public class DOMToStaxEncryptionIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.ENC_KEY_ID, "IssuerSerial");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ENC_KEY_ID, "IssuerSerial");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -130,11 +130,11 @@ public class DOMToStaxEncryptionIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.ENC_KEY_ID, "Thumbprint");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ENC_KEY_ID, "Thumbprint");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -163,11 +163,11 @@ public class DOMToStaxEncryptionIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.ENC_KEY_ID, "X509KeyIdentifier");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ENC_KEY_ID, "X509KeyIdentifier");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -196,11 +196,11 @@ public class DOMToStaxEncryptionIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.ENC_KEY_ID, "EncryptedKeySHA1");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ENC_KEY_ID, "EncryptedKeySHA1");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxRoundTripTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxRoundTripTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxRoundTripTest.java
index 547526e..2828c63 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxRoundTripTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxRoundTripTest.java
@@ -34,9 +34,9 @@ import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.Service;
import org.apache.cxf.transport.local.LocalTransportFactory;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.CryptoFactory;
import org.apache.wss4j.dom.WSConstants;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.junit.Test;
@@ -66,10 +66,10 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
- properties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.USER, "username");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.USERNAME_TOKEN);
+ properties.put(ConfigurationConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.USER, "username");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -114,10 +114,10 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
- properties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.USER, "username");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.USERNAME_TOKEN);
+ properties.put(ConfigurationConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.USER, "username");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -163,10 +163,10 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -195,12 +195,12 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.ENC_KEY_TRANSPORT, WSConstants.KEYTRANSPORT_RSA15);
- properties.put(WSHandlerConstants.ENC_SYM_ALGO, WSConstants.TRIPLE_DES);
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ENC_KEY_TRANSPORT, WSConstants.KEYTRANSPORT_RSA15);
+ properties.put(ConfigurationConstants.ENC_SYM_ALGO, WSConstants.TRIPLE_DES);
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -241,13 +241,13 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
Map<String, Object> properties = new HashMap<>();
properties.put(
- WSHandlerConstants.ACTION,
- WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.ENCRYPT
+ ConfigurationConstants.ACTION,
+ ConfigurationConstants.USERNAME_TOKEN + " " + ConfigurationConstants.ENCRYPT
);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "username");
- properties.put(WSHandlerConstants.ENCRYPTION_USER, "myalias");
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "username");
+ properties.put(ConfigurationConstants.ENCRYPTION_USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -276,10 +276,10 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -309,12 +309,12 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
Map<String, Object> properties = new HashMap<>();
properties.put(
- WSHandlerConstants.ACTION,
- WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.USERNAME_TOKEN
+ ConfigurationConstants.ACTION,
+ ConfigurationConstants.SIGNATURE + " " + ConfigurationConstants.USERNAME_TOKEN
);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -340,7 +340,7 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.TIMESTAMP);
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -370,17 +370,17 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
Map<String, Object> properties = new HashMap<>();
properties.put(
- WSHandlerConstants.ACTION,
- WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.SIGNATURE
+ ConfigurationConstants.ACTION,
+ ConfigurationConstants.TIMESTAMP + " " + ConfigurationConstants.SIGNATURE
);
properties.put(
- WSHandlerConstants.SIGNATURE_PARTS,
+ ConfigurationConstants.SIGNATURE_PARTS,
"{}{" + WSSConstants.NS_WSU10 + "}Timestamp;"
+ "{}{" + WSSConstants.NS_SOAP11 + "}Body;"
);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -410,17 +410,17 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
Map<String, Object> properties = new HashMap<>();
properties.put(
- WSHandlerConstants.ACTION,
- WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.SIGNATURE
+ ConfigurationConstants.ACTION,
+ ConfigurationConstants.TIMESTAMP + " " + ConfigurationConstants.SIGNATURE
);
properties.put(
- WSHandlerConstants.SIGNATURE_PARTS,
+ ConfigurationConstants.SIGNATURE_PARTS,
"{}{" + WSSConstants.NS_WSSE10 + "}Timestamp;"
+ "{}{" + WSSConstants.NS_SOAP11 + "}Body;"
);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -454,12 +454,12 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new KeystorePasswordCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "alice.properties");
- properties.put(WSHandlerConstants.USER, "alice");
- properties.put(WSHandlerConstants.USE_SINGLE_CERTIFICATE, "true");
- properties.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new KeystorePasswordCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "alice.properties");
+ properties.put(ConfigurationConstants.USER, "alice");
+ properties.put(ConfigurationConstants.USE_SINGLE_CERTIFICATE, "true");
+ properties.put(ConfigurationConstants.SIG_KEY_ID, "DirectReference");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -490,13 +490,13 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
Map<String, Object> properties = new HashMap<>();
properties.put(
- WSHandlerConstants.ACTION,
- WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT
+ ConfigurationConstants.ACTION,
+ ConfigurationConstants.SIGNATURE + " " + ConfigurationConstants.ENCRYPT
);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -539,20 +539,20 @@ public class DOMToStaxRoundTripTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
- properties.put(WSHandlerConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
+ properties.put(ConfigurationConstants.USER, "myalias");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
Map<String, Object> domInProperties = new HashMap<>();
- domInProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- domInProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- domInProperties.put(WSHandlerConstants.SIG_VER_PROP_FILE, "insecurity.properties");
- domInProperties.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
+ domInProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ domInProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ domInProperties.put(ConfigurationConstants.SIG_VER_PROP_FILE, "insecurity.properties");
+ domInProperties.put(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(domInProperties);
client.getInInterceptors().add(inInterceptor);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxSignatureIdentifierTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxSignatureIdentifierTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxSignatureIdentifierTest.java
index 9038858..0b59b2b 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxSignatureIdentifierTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DOMToStaxSignatureIdentifierTest.java
@@ -31,9 +31,9 @@ import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.Service;
import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.bsp.BSPRule;
import org.apache.wss4j.common.crypto.CryptoFactory;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.junit.Test;
@@ -65,11 +65,11 @@ public class DOMToStaxSignatureIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.SIG_KEY_ID, "DirectReference");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -98,11 +98,11 @@ public class DOMToStaxSignatureIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.SIG_KEY_ID, "IssuerSerial");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -131,11 +131,11 @@ public class DOMToStaxSignatureIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.SIG_KEY_ID, "Thumbprint");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.SIG_KEY_ID, "Thumbprint");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -164,11 +164,11 @@ public class DOMToStaxSignatureIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.SIG_KEY_ID, "X509KeyIdentifier");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.SIG_KEY_ID, "X509KeyIdentifier");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
@@ -198,11 +198,11 @@ public class DOMToStaxSignatureIdentifierTest extends AbstractSecurityTest {
client.getOutInterceptors().add(new LoggingOutInterceptor());
Map<String, Object> properties = new HashMap<>();
- properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- properties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- properties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- properties.put(WSHandlerConstants.USER, "myalias");
- properties.put(WSHandlerConstants.SIG_KEY_ID, "KeyValue");
+ properties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ properties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ properties.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ properties.put(ConfigurationConstants.USER, "myalias");
+ properties.put(ConfigurationConstants.SIG_KEY_ID, "KeyValue");
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor(properties);
client.getOutInterceptors().add(ohandler);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DefaultCryptoCoverageCheckerTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DefaultCryptoCoverageCheckerTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DefaultCryptoCoverageCheckerTest.java
index b58747e..c88395a 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DefaultCryptoCoverageCheckerTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/DefaultCryptoCoverageCheckerTest.java
@@ -32,7 +32,7 @@ import org.apache.cxf.phase.PhaseInterceptor;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageChecker.XPathExpression;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageUtil.CoverageScope;
import org.apache.cxf.ws.security.wss4j.CryptoCoverageUtil.CoverageType;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.junit.Test;
/**
@@ -122,16 +122,16 @@ public class DefaultCryptoCoverageCheckerTest extends AbstractSecurityTest {
private PhaseInterceptor<SoapMessage> getWss4jInInterceptor() {
final WSS4JInInterceptor inHandler = new WSS4JInInterceptor(true);
- final String action = WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT;
+ final String action = ConfigurationConstants.SIGNATURE + " " + ConfigurationConstants.ENCRYPT;
- inHandler.setProperty(WSHandlerConstants.ACTION, action);
- inHandler.setProperty(WSHandlerConstants.SIG_VER_PROP_FILE,
+ inHandler.setProperty(ConfigurationConstants.ACTION, action);
+ inHandler.setProperty(ConfigurationConstants.SIG_VER_PROP_FILE,
"insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.DEC_PROP_FILE,
+ inHandler.setProperty(ConfigurationConstants.DEC_PROP_FILE,
"insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
+ inHandler.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS,
TestPwdCallback.class.getName());
- inHandler.setProperty(WSHandlerConstants.IS_BSP_COMPLIANT, "false");
+ inHandler.setProperty(ConfigurationConstants.IS_BSP_COMPLIANT, "false");
return inHandler;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
index 1ef6466..99686ac 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
@@ -29,7 +29,7 @@ import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.Service;
import org.apache.cxf.transport.local.LocalTransportFactory;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.junit.Before;
import org.junit.Test;
@@ -55,18 +55,18 @@ public class RoundTripTest extends AbstractSecurityTest {
service.getOutInterceptors().add(new LoggingOutInterceptor());
wsIn = new WSS4JInInterceptor();
- wsIn.setProperty(WSHandlerConstants.SIG_VER_PROP_FILE, "insecurity.properties");
- wsIn.setProperty(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
- wsIn.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
+ wsIn.setProperty(ConfigurationConstants.SIG_VER_PROP_FILE, "insecurity.properties");
+ wsIn.setProperty(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
+ wsIn.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
service.getInInterceptors().add(wsIn);
wsOut = new WSS4JOutInterceptor();
- wsOut.setProperty(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- wsOut.setProperty(WSHandlerConstants.ENC_PROP_FILE, "outsecurity.properties");
- wsOut.setProperty(WSHandlerConstants.USER, "myalias");
+ wsOut.setProperty(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ wsOut.setProperty(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
+ wsOut.setProperty(ConfigurationConstants.USER, "myalias");
wsOut.setProperty("password", "myAliasPassword");
- wsOut.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
+ wsOut.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
service.getOutInterceptors().add(wsOut);
// Create the client
@@ -88,28 +88,28 @@ public class RoundTripTest extends AbstractSecurityTest {
@Test
public void testSignature() throws Exception {
- wsIn.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- wsOut.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
+ wsIn.setProperty(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ wsOut.setProperty(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
assertEquals("test", echo.echo("test"));
}
@Test
public void testEncryptionPlusSig() throws Exception {
- wsIn.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT + " "
- + WSHandlerConstants.SIGNATURE);
- wsOut.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT + " "
- + WSHandlerConstants.SIGNATURE);
+ wsIn.setProperty(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT + " "
+ + ConfigurationConstants.SIGNATURE);
+ wsOut.setProperty(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT + " "
+ + ConfigurationConstants.SIGNATURE);
assertEquals("test", echo.echo("test"));
}
@Test
public void testUsernameToken() throws Exception {
- String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
- + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;
+ String actions = ConfigurationConstants.ENCRYPT + " " + ConfigurationConstants.SIGNATURE + " "
+ + ConfigurationConstants.TIMESTAMP + " " + ConfigurationConstants.USERNAME_TOKEN;
- wsIn.setProperty(WSHandlerConstants.ACTION, actions);
- wsOut.setProperty(WSHandlerConstants.ACTION, actions);
+ wsIn.setProperty(ConfigurationConstants.ACTION, actions);
+ wsOut.setProperty(ConfigurationConstants.ACTION, actions);
assertEquals("test", echo.echo("test"));
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
index c50cdf5..073de42 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
@@ -30,6 +30,7 @@ import org.w3c.dom.Document;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.EncryptionActionToken;
import org.apache.wss4j.common.SignatureActionToken;
import org.apache.wss4j.dom.WSConstants;
@@ -56,11 +57,11 @@ public class SecurityActionTokenTest extends AbstractSecurityTest {
Map<String, Object> outProperties = new HashMap<>();
outProperties.put(WSHandlerConstants.HANDLER_ACTIONS, actions);
- outProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ outProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- inProperties.put(WSHandlerConstants.SIG_VER_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ inProperties.put(ConfigurationConstants.SIG_VER_PROP_FILE, "insecurity.properties");
List<String> xpaths = new ArrayList<>();
xpaths.add("//wsse:Security");
@@ -88,9 +89,9 @@ public class SecurityActionTokenTest extends AbstractSecurityTest {
outProperties.put(WSHandlerConstants.HANDLER_ACTIONS, actions);
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- inProperties.put(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
- inProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ inProperties.put(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
List<String> xpaths = new ArrayList<>();
xpaths.add("//wsse:Security");
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
index ff1441b..2059e78 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
@@ -37,6 +37,7 @@ import org.apache.cxf.message.ExchangeImpl;
import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.phase.PhaseInterceptor;
import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.dom.handler.WSHandlerResult;
@@ -62,10 +63,10 @@ public class SignatureConfirmationTest extends AbstractSecurityTest {
SoapMessage msg = getSoapMessageForDom(doc);
- msg.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- msg.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
- msg.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
- msg.put(WSHandlerConstants.USER, "myalias");
+ msg.put(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ msg.put(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
+ msg.put(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
+ msg.put(ConfigurationConstants.USER, "myalias");
msg.put("password", "myAliasPassword");
//
// This is necessary to convince the WSS4JOutInterceptor that we're
@@ -109,9 +110,9 @@ public class SignatureConfirmationTest extends AbstractSecurityTest {
ex.setInMessage(inmsg);
inmsg.setContent(SOAPMessage.class, saajMsg);
- inHandler.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
- inHandler.setProperty(WSHandlerConstants.SIG_VER_PROP_FILE, "insecurity.properties");
- inHandler.setProperty(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
+ inHandler.setProperty(ConfigurationConstants.ACTION, ConfigurationConstants.SIGNATURE);
+ inHandler.setProperty(ConfigurationConstants.SIG_VER_PROP_FILE, "insecurity.properties");
+ inHandler.setProperty(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
inHandler.handleMessage(inmsg);
@@ -138,7 +139,7 @@ public class SignatureConfirmationTest extends AbstractSecurityTest {
SoapMessage msg = getSoapMessageForDom(doc);
- msg.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
+ msg.put(ConfigurationConstants.ACTION, ConfigurationConstants.TIMESTAMP);
msg.put(WSHandlerConstants.RECV_RESULTS, sigReceived);
handler.handleMessage(msg);
@@ -172,7 +173,7 @@ public class SignatureConfirmationTest extends AbstractSecurityTest {
ex.setInMessage(inmsg);
inmsg.setContent(SOAPMessage.class, saajMsg);
- inHandler.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
+ inHandler.setProperty(ConfigurationConstants.ACTION, ConfigurationConstants.TIMESTAMP);
inmsg.put(WSHandlerConstants.SEND_SIGV, sigSaved);
inHandler.handleMessage(inmsg);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a5dd7fa0/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/StaxToDOMEncryptionIdentifierTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/StaxToDOMEncryptionIdentifierTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/StaxToDOMEncryptionIdentifierTest.java
index 274f208..dc5b125 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/StaxToDOMEncryptionIdentifierTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/StaxToDOMEncryptionIdentifierTest.java
@@ -33,8 +33,8 @@ import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.Service;
import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.wss4j.common.ConfigurationConstants;
import org.apache.wss4j.common.crypto.CryptoFactory;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
import org.apache.wss4j.stax.ext.WSSConstants;
import org.apache.wss4j.stax.ext.WSSSecurityProperties;
import org.apache.wss4j.stax.securityToken.WSSecurityTokenConstants;
@@ -53,9 +53,9 @@ public class StaxToDOMEncryptionIdentifierTest extends AbstractSecurityTest {
Service service = createService();
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- inProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- inProperties.put(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ inProperties.put(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties);
service.getInInterceptors().add(inInterceptor);
@@ -92,9 +92,9 @@ public class StaxToDOMEncryptionIdentifierTest extends AbstractSecurityTest {
Service service = createService();
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- inProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- inProperties.put(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ inProperties.put(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties);
service.getInInterceptors().add(inInterceptor);
@@ -131,9 +131,9 @@ public class StaxToDOMEncryptionIdentifierTest extends AbstractSecurityTest {
Service service = createService();
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- inProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- inProperties.put(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ inProperties.put(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties);
service.getInInterceptors().add(inInterceptor);
@@ -170,10 +170,10 @@ public class StaxToDOMEncryptionIdentifierTest extends AbstractSecurityTest {
Service service = createService();
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- inProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- inProperties.put(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
- inProperties.put(WSHandlerConstants.IS_BSP_COMPLIANT, "false");
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ inProperties.put(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.IS_BSP_COMPLIANT, "false");
WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties);
service.getInInterceptors().add(inInterceptor);
@@ -210,9 +210,9 @@ public class StaxToDOMEncryptionIdentifierTest extends AbstractSecurityTest {
Service service = createService();
Map<String, Object> inProperties = new HashMap<>();
- inProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
- inProperties.put(WSHandlerConstants.PW_CALLBACK_REF, new TestPwdCallback());
- inProperties.put(WSHandlerConstants.DEC_PROP_FILE, "insecurity.properties");
+ inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.ENCRYPT);
+ inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new TestPwdCallback());
+ inProperties.put(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties);
service.getInInterceptors().add(inInterceptor);