This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch coheigea/wss4j-saml-refactor in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 664263d75aa8ce3514dd446788d99c696808b57c Author: Colm O hEigeartaigh <[email protected]> AuthorDate: Wed Jul 2 13:41:08 2025 +0100 Fixing SAML unit tests --- .../org/apache/cxf/sts/SignatureProperties.java | 2 +- .../org/apache/cxf/sts/StaticSTSProperties.java | 2 +- .../cxf/sts/operation/AbstractOperation.java | 2 +- .../cxf/sts/operation/TokenIssueOperation.java | 33 +++++++++++++--------- .../org/apache/cxf/sts/request/RequestParser.java | 12 ++++---- .../cxf/sts/service/EncryptionProperties.java | 2 +- .../cxf/sts/token/canceller/SCTCanceller.java | 6 ++-- .../apache/cxf/sts/token/provider/SCTProvider.java | 4 +-- .../sts/token/realm/UsernameTokenRealmCodec.java | 2 +- .../cxf/sts/token/renewer/SAMLTokenRenewer.java | 16 +++++------ .../sts/token/validator/SAMLTokenValidator.java | 16 +++++------ .../cxf/sts/token/validator/SCTValidator.java | 2 +- .../token/validator/UsernameTokenValidator.java | 10 +++---- .../sts/token/validator/X509TokenValidator.java | 12 ++++---- .../operation/CustomUsernameTokenRealmCodec.java | 2 +- .../cxf/sts/operation/DummyTokenProvider.java | 2 +- .../cxf/sts/operation/IssueEncryptedUnitTest.java | 2 +- .../cxf/sts/operation/IssueSamlUnitTest.java | 12 ++++---- .../cxf/sts/request/RequestParserUnitTest.java | 2 +- .../cxf/sts/token/canceller/SCTCancellerTest.java | 2 +- .../cxf/sts/token/provider/SCTProviderTest.java | 2 +- .../sts/token/renewer/SAMLTokenRenewerPOPTest.java | 4 +-- .../cxf/sts/token/validator/SCTValidatorTest.java | 2 +- .../validator/UsernameTokenValidatorTest.java | 2 +- 24 files changed, 79 insertions(+), 74 deletions(-) diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java index 05485546f5..3539e42387 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.wss4j.common.WSS4JConstants; -import org.apache.wss4j.dom.WSConstants; +import org.apache.wss4j.common.dom.WSConstants; /** * This class contains various configuration properties that can be used to sign an issued token, diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java index 1c1db1aa89..3aeb40ae69 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java @@ -38,7 +38,7 @@ import org.apache.cxf.ws.security.sts.provider.STSException; import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; -import org.apache.wss4j.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.engine.WSSConfig; /** * A static implementation of the STSPropertiesMBean. diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java index ef05d5fd67..7c6cca59d3 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java @@ -81,7 +81,7 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.util.DateUtil; import org.apache.wss4j.common.util.KeyUtils; import org.apache.wss4j.common.util.XMLUtils; -import org.apache.wss4j.dom.WSConstants; +import org.apache.wss4j.common.dom.WSConstants; import org.apache.wss4j.dom.message.WSSecEncryptedKey; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.stax.securityEvent.SecurityEvent; diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java index c7c1f5c4ea..ce04f6d3de 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java @@ -61,7 +61,7 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.SAMLTokenPrincipal; import org.apache.wss4j.common.principal.SAMLTokenPrincipalImpl; import org.apache.wss4j.common.saml.SamlAssertionWrapper; -import org.apache.wss4j.dom.engine.WSSecurityEngineResult; +import org.apache.wss4j.common.dom.engine.WSSecurityEngineResult; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; import org.apache.wss4j.stax.securityEvent.WSSecurityEventConstants; @@ -126,20 +126,25 @@ public class TokenIssueOperation extends AbstractOperation implements IssueOpera if (assertion != null) { String wssecRealm = stsProperties.getSamlRealmCodec().getRealmFromToken(assertion); - SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipalImpl(assertion); - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("SAML token realm of user '" + samlPrincipal.getName() + "' is " + wssecRealm); + try { + SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipalImpl(assertion); + if (LOG.isLoggable(Level.FINE)) { + LOG.fine("SAML token realm of user '" + samlPrincipal.getName() + "' is " + wssecRealm); + } + + ReceivedToken wssecToken = new ReceivedToken(assertion.getElement()); + wssecToken.setState(STATE.VALID); + TokenValidatorResponse tokenResponse = new TokenValidatorResponse(); + tokenResponse.setPrincipal(samlPrincipal); + tokenResponse.setToken(wssecToken); + tokenResponse.setTokenRealm(wssecRealm); + tokenResponse.setAdditionalProperties(new HashMap<String, Object>()); + processValidToken(providerParameters, wssecToken, tokenResponse); + providerParameters.setPrincipal(wssecToken.getPrincipal()); + } catch (org.apache.wss4j.common.ext.WSSecurityException ex) { + LOG.log(Level.WARNING, "", ex); + throw new STSException("Error in providing a token", ex, STSException.REQUEST_FAILED); } - - ReceivedToken wssecToken = new ReceivedToken(assertion.getElement()); - wssecToken.setState(STATE.VALID); - TokenValidatorResponse tokenResponse = new TokenValidatorResponse(); - tokenResponse.setPrincipal(samlPrincipal); - tokenResponse.setToken(wssecToken); - tokenResponse.setTokenRealm(wssecRealm); - tokenResponse.setAdditionalProperties(new HashMap<String, Object>()); - processValidToken(providerParameters, wssecToken, tokenResponse); - providerParameters.setPrincipal(wssecToken.getPrincipal()); } } diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java index 9bfcdd8037..1e5d3b05cb 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java @@ -77,14 +77,14 @@ import org.apache.cxf.ws.security.sts.provider.model.xmldsig.KeyInfoType; import org.apache.cxf.ws.security.sts.provider.model.xmldsig.X509DataType; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.util.XMLUtils; -import org.apache.wss4j.dom.WSConstants; -import org.apache.wss4j.dom.WSDocInfo; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.engine.WSSecurityEngineResult; -import org.apache.wss4j.dom.handler.RequestData; +import org.apache.wss4j.common.dom.WSConstants; +import org.apache.wss4j.common.dom.WSDocInfo; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.engine.WSSecurityEngineResult; +import org.apache.wss4j.common.dom.RequestData; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; import org.apache.wss4j.dom.processor.EncryptedKeyProcessor; import org.apache.xml.security.utils.Constants; diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/EncryptionProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/EncryptionProperties.java index b6e106c8b3..40c3f596d7 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/EncryptionProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/EncryptionProperties.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.wss4j.common.WSS4JConstants; -import org.apache.wss4j.dom.WSConstants; +import org.apache.wss4j.common.dom.WSConstants; /** * This class contains various configuration properties that can be used to encrypt an issued token. diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java index fc874d1cb5..9725d2f3d9 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java @@ -38,11 +38,11 @@ import org.apache.cxf.ws.security.sts.provider.STSException; import org.apache.cxf.ws.security.tokenstore.SecurityToken; import org.apache.cxf.ws.security.trust.STSUtils; import org.apache.wss4j.common.ext.WSSecurityException; -import org.apache.wss4j.dom.WSConstants; -import org.apache.wss4j.dom.engine.WSSecurityEngineResult; +import org.apache.wss4j.common.dom.WSConstants; +import org.apache.wss4j.common.dom.engine.WSSecurityEngineResult; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; import org.apache.wss4j.stax.securityEvent.WSSecurityEventConstants; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.stax.securityEvent.AbstractSecuredElementSecurityEvent; diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java index ce707df742..c9f717e846 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java @@ -38,8 +38,8 @@ import org.apache.cxf.ws.security.tokenstore.SecurityToken; import org.apache.cxf.ws.security.trust.STSUtils; import org.apache.wss4j.common.derivedKey.ConversationConstants; import org.apache.wss4j.common.ext.WSSecurityException; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; /** * A TokenProvider implementation that provides a SecurityContextToken. diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/UsernameTokenRealmCodec.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/UsernameTokenRealmCodec.java index 1ed40c1361..d6c5d65cfb 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/UsernameTokenRealmCodec.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/UsernameTokenRealmCodec.java @@ -19,7 +19,7 @@ package org.apache.cxf.sts.token.realm; -import org.apache.wss4j.dom.message.token.UsernameToken; +import org.apache.wss4j.common.dom.message.token.UsernameToken; /** * This interface defines a pluggable way to return a realm associated with a UsernameToken. diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java index d7d0d3cdfa..c85207b91a 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java @@ -59,15 +59,15 @@ import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.apache.wss4j.common.saml.bean.ConditionsBean; import org.apache.wss4j.common.saml.builder.SAML1ComponentBuilder; import org.apache.wss4j.common.saml.builder.SAML2ComponentBuilder; -import org.apache.wss4j.dom.WSConstants; -import org.apache.wss4j.dom.WSDocInfo; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.engine.WSSecurityEngineResult; -import org.apache.wss4j.dom.handler.RequestData; +import org.apache.wss4j.common.dom.WSConstants; +import org.apache.wss4j.common.dom.WSDocInfo; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.engine.WSSecurityEngineResult; +import org.apache.wss4j.common.dom.RequestData; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; -import org.apache.wss4j.dom.saml.DOMSAMLUtil; -import org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor; +import org.apache.wss4j.common.saml.DOMSAMLUtil; +import org.apache.wss4j.common.saml.message.WSSSAMLKeyInfoProcessor; import org.apache.xml.security.stax.impl.util.IDGenerator; import org.opensaml.saml.common.SAMLVersion; import org.opensaml.saml.saml1.core.Audience; @@ -338,7 +338,7 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements Token // Parse the HOK subject if it exists assertion.parseSubject( - new WSSSAMLKeyInfoProcessor(requestData), sigCrypto + new WSSSAMLKeyInfoProcessor(), requestData, sigCrypto ); SAMLKeyInfo keyInfo = assertion.getSubjectKeyInfo(); diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java index ab6d46689e..92857ccc5d 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java @@ -50,13 +50,13 @@ import org.apache.wss4j.common.principal.SAMLTokenPrincipalImpl; import org.apache.wss4j.common.saml.SAMLKeyInfo; import org.apache.wss4j.common.saml.SAMLUtil; import org.apache.wss4j.common.saml.SamlAssertionWrapper; -import org.apache.wss4j.dom.WSDocInfo; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.handler.RequestData; -import org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor; -import org.apache.wss4j.dom.validate.Credential; -import org.apache.wss4j.dom.validate.SignatureTrustValidator; -import org.apache.wss4j.dom.validate.Validator; +import org.apache.wss4j.common.dom.WSDocInfo; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.RequestData; +import org.apache.wss4j.common.saml.message.WSSSAMLKeyInfoProcessor; +import org.apache.wss4j.common.dom.validate.Credential; +import org.apache.wss4j.common.dom.validate.SignatureTrustValidator; +import org.apache.wss4j.common.dom.validate.Validator; import org.opensaml.saml.common.SAMLVersion; import org.opensaml.xmlsec.signature.KeyInfo; import org.opensaml.xmlsec.signature.Signature; @@ -174,7 +174,7 @@ public class SAMLTokenValidator implements TokenValidator { KeyInfo keyInfo = sig.getKeyInfo(); SAMLKeyInfo samlKeyInfo = SAMLUtil.getCredentialFromKeyInfo( - keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(requestData), sigCrypto + keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(), requestData, sigCrypto ); assertion.verifySignature(samlKeyInfo); diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java index f1263b78b2..3467f02dcf 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java @@ -32,7 +32,7 @@ import org.apache.cxf.sts.request.ReceivedToken.STATE; import org.apache.cxf.ws.security.tokenstore.SecurityToken; import org.apache.cxf.ws.security.trust.STSUtils; import org.apache.wss4j.common.ext.WSSecurityException; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; /** * This class validates a SecurityContextToken. diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java index 6555d925f8..6f2f86eec3 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java @@ -54,11 +54,11 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.handler.RequestData; -import org.apache.wss4j.dom.message.token.UsernameToken; -import org.apache.wss4j.dom.validate.Credential; -import org.apache.wss4j.dom.validate.Validator; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.RequestData; +import org.apache.wss4j.common.dom.message.token.UsernameToken; +import org.apache.wss4j.common.dom.validate.Credential; +import org.apache.wss4j.common.dom.validate.Validator; /** * This class validates a wsse UsernameToken. diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java index 4e6f776cc4..6bc3c1a1c2 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java @@ -42,12 +42,12 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.token.BinarySecurity; import org.apache.wss4j.common.token.X509Security; -import org.apache.wss4j.dom.WSConstants; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.handler.RequestData; -import org.apache.wss4j.dom.validate.Credential; -import org.apache.wss4j.dom.validate.SignatureTrustValidator; -import org.apache.wss4j.dom.validate.Validator; +import org.apache.wss4j.common.dom.WSConstants; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.RequestData; +import org.apache.wss4j.common.dom.validate.Credential; +import org.apache.wss4j.common.dom.validate.SignatureTrustValidator; +import org.apache.wss4j.common.dom.validate.Validator; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.keys.content.X509Data; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CustomUsernameTokenRealmCodec.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CustomUsernameTokenRealmCodec.java index 574e93e625..72d472ee5c 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CustomUsernameTokenRealmCodec.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CustomUsernameTokenRealmCodec.java @@ -19,7 +19,7 @@ package org.apache.cxf.sts.operation; import org.apache.cxf.sts.token.realm.UsernameTokenRealmCodec; -import org.apache.wss4j.dom.message.token.UsernameToken; +import org.apache.wss4j.common.dom.message.token.UsernameToken; /** * This class defines a pluggable way to return a realm associated with a UsernameToken. diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/DummyTokenProvider.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/DummyTokenProvider.java index 0109b2fbe3..f88fbc6ffe 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/DummyTokenProvider.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/DummyTokenProvider.java @@ -29,7 +29,7 @@ import org.apache.cxf.sts.token.provider.TokenProviderResponse; import org.apache.cxf.sts.token.provider.TokenProviderUtils; import org.apache.cxf.ws.security.sts.provider.STSException; import org.apache.wss4j.common.token.BinarySecurity; -import org.apache.wss4j.dom.WSConstants; +import org.apache.wss4j.common.dom.WSConstants; /** * A Dummy TokenProvider for use in the unit tests. It mocks up a dummy BinarySecurityToken. diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java index db80b7add6..b4c2fe05d2 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java @@ -44,7 +44,7 @@ import org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType; import org.apache.wss4j.common.WSS4JConstants; import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; -import org.apache.wss4j.dom.WSConstants; +import org.apache.wss4j.common.dom.WSConstants; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java index b10fefa125..8b05b06948 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java @@ -68,12 +68,12 @@ import org.apache.wss4j.common.saml.builder.SAML1Constants; import org.apache.wss4j.common.saml.builder.SAML2Constants; import org.apache.wss4j.common.util.DOM2Writer; import org.apache.wss4j.common.util.KeyUtils; -import org.apache.wss4j.dom.WSConstants; -import org.apache.wss4j.dom.WSDocInfo; -import org.apache.wss4j.dom.engine.WSSConfig; -import org.apache.wss4j.dom.handler.RequestData; +import org.apache.wss4j.common.dom.WSConstants; +import org.apache.wss4j.common.dom.WSDocInfo; +import org.apache.wss4j.common.dom.engine.WSSConfig; +import org.apache.wss4j.common.dom.RequestData; import org.apache.wss4j.dom.message.WSSecEncryptedKey; -import org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor; +import org.apache.wss4j.common.saml.message.WSSSAMLKeyInfoProcessor; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -889,7 +889,7 @@ public class IssueSamlUnitTest { data.setWsDocInfo(new WSDocInfo(assertion.getOwnerDocument())); assertionWrapper.parseSubject( - new WSSSAMLKeyInfoProcessor(data), data.getSigVerCrypto() + new WSSSAMLKeyInfoProcessor(), data, data.getSigVerCrypto() ); SAMLKeyInfo samlKeyInfo = assertionWrapper.getSubjectKeyInfo(); diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java index a78505f04c..4523b347a5 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java @@ -43,7 +43,7 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.dom.engine.WSSecurityEngine; -import org.apache.wss4j.dom.handler.RequestData; +import org.apache.wss4j.common.dom.RequestData; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java index 7d1b7dd424..b692902245 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java @@ -45,7 +45,7 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; import org.junit.BeforeClass; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java index 3a1a88e2e9..f4b8356851 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java @@ -39,7 +39,7 @@ import org.apache.wss4j.common.derivedKey.ConversationConstants; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DOM2Writer; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; import org.junit.BeforeClass; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java index a6b5efe52b..451b780457 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewerPOPTest.java @@ -61,8 +61,8 @@ import org.apache.wss4j.common.crypto.CryptoType; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; import org.apache.wss4j.common.util.DateUtil; -import org.apache.wss4j.dom.WSConstants; -import org.apache.wss4j.dom.engine.WSSecurityEngineResult; +import org.apache.wss4j.common.dom.WSConstants; +import org.apache.wss4j.common.dom.engine.WSSecurityEngineResult; import org.apache.wss4j.dom.handler.WSHandlerConstants; import org.apache.wss4j.dom.handler.WSHandlerResult; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java index 3a897a020b..3be7d30b08 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java @@ -45,7 +45,7 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; -import org.apache.wss4j.dom.message.token.SecurityContextToken; +import org.apache.wss4j.common.dom.message.token.SecurityContextToken; import org.junit.BeforeClass; diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java index b93e394552..8ab189debc 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java @@ -46,7 +46,7 @@ import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.principal.CustomTokenPrincipal; -import org.apache.wss4j.dom.message.token.UsernameToken; +import org.apache.wss4j.common.dom.message.token.UsernameToken; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue;
