Author: coheigea Date: Wed Mar 20 16:36:34 2013 New Revision: 1458934 URL: http://svn.apache.org/r1458934 Log: Merged revisions 1458929 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
........ r1458929 | coheigea | 2013-03-20 16:32:29 +0000 (Wed, 20 Mar 2013) | 10 lines Merged revisions 1458926 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1458926 | coheigea | 2013-03-20 16:27:24 +0000 (Wed, 20 Mar 2013) | 2 lines Removing some non-namespace aware DOM calls ........ ........ Added: cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java - copied, changed from r1458828, cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/EncryptedPartsBuilder.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/RequiredPartsBuilder.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java cxf/branches/2.6.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java cxf/branches/2.6.x-fixes/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java cxf/branches/2.6.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java cxf/branches/2.6.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/EncryptedPartsBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/EncryptedPartsBuilder.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/EncryptedPartsBuilder.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/EncryptedPartsBuilder.java Wed Mar 20 16:36:34 2013 @@ -70,11 +70,11 @@ public class EncryptedPartsBuilder imple private void processElement(Element element, SignedEncryptedParts parent) { if ("Header".equals(element.getLocalName())) { - String nameAttribute = element.getAttribute(SPConstants.NAME); + String nameAttribute = element.getAttributeNS(null, SPConstants.NAME); if (nameAttribute == null) { nameAttribute = ""; } - String namespaceAttribute = element.getAttribute(SPConstants.NAMESPACE); + String namespaceAttribute = element.getAttributeNS(null, SPConstants.NAMESPACE); if ("".equals(namespaceAttribute)) { throw new IllegalArgumentException( "sp:EncryptedParts/sp:Header@Namespace must have a value" Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/RequiredPartsBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/RequiredPartsBuilder.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/RequiredPartsBuilder.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/RequiredPartsBuilder.java Wed Mar 20 16:36:34 2013 @@ -55,12 +55,12 @@ public class RequiredPartsBuilder implem private void processElement(Element element, RequiredParts parent) { if ("Header".equals(element.getLocalName())) { - String nameAttribute = element.getAttribute(SPConstants.NAME); + String nameAttribute = element.getAttributeNS(null, SPConstants.NAME); if (nameAttribute == null) { nameAttribute = ""; } - String namespaceAttribute = element.getAttribute(SPConstants.NAMESPACE); + String namespaceAttribute = element.getAttributeNS(null, SPConstants.NAMESPACE); if ("".equals(namespaceAttribute)) { throw new IllegalArgumentException( "sp:RequiredParts/sp:Header@Namespace must have a value" Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java Wed Mar 20 16:36:34 2013 @@ -72,11 +72,11 @@ public class SignedPartsBuilder implemen if ("Header".equals(element.getLocalName())) { - String nameAttribute = element.getAttribute(SPConstants.NAME); + String nameAttribute = element.getAttributeNS(null, SPConstants.NAME); if (nameAttribute == null) { nameAttribute = ""; } - String namespaceAttribute = element.getAttribute(SPConstants.NAMESPACE); + String namespaceAttribute = element.getAttributeNS(null, SPConstants.NAMESPACE); if ("".equals(namespaceAttribute)) { throw new IllegalArgumentException( "sp:SignedParts/sp:Header@Namespace must have a value" Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java Wed Mar 20 16:36:34 2013 @@ -439,7 +439,7 @@ public class SecurityToken implements Se return DOMUtils.getContent(child); } else if (Reference.TOKEN.getLocalPart().equals(child.getLocalName()) && Reference.TOKEN.getNamespaceURI().equals(child.getNamespaceURI())) { - return child.getAttribute("URI").substring(1); + return child.getAttributeNS(null, "URI").substring(1); } return null; } Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java Wed Mar 20 16:36:34 2013 @@ -1466,7 +1466,7 @@ public abstract class AbstractSTSClient || elName.equals(new QName(WSConstants.WSSE_NS, "KeyIdentifier"))) { return DOMUtils.getContent(child); } else if (elName.equals(Reference.TOKEN)) { - return child.getAttribute("URI"); + return child.getAttributeNS(null, "URI"); } else if (elName.equals(new QName(STSUtils.SCT_NS_05_02, "Identifier")) || elName.equals(new QName(STSUtils.SCT_NS_05_12, "Identifier"))) { return DOMUtils.getContent(child); Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java Wed Mar 20 16:36:34 2013 @@ -1045,7 +1045,7 @@ public abstract class AbstractBindingBui String id; //first try to get the Id attr - Attr idAttr = elem.getAttributeNode("Id"); + Attr idAttr = elem.getAttributeNodeNS(null, "Id"); if (idAttr == null) { //then try the wsu:Id value idAttr = elem.getAttributeNodeNS(PolicyConstants.WSU_NAMESPACE_URI, "Id"); @@ -1392,7 +1392,7 @@ public abstract class AbstractBindingBui } else { //not forcing an ID on this. Use one if there is one //there already, but don't force one - Attr idAttr = el.getAttributeNode("Id"); + Attr idAttr = el.getAttributeNodeNS(null, "Id"); if (idAttr == null) { //then try the wsu:Id value idAttr = el.getAttributeNodeNS(PolicyConstants.WSU_NAMESPACE_URI, "Id"); Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java Wed Mar 20 16:36:34 2013 @@ -469,7 +469,7 @@ public abstract class AbstractBindingPol for (WSDataRef r : el) { Element protectedElement = r.getProtectedElement(); if (protectedElement != null) { - String id = protectedElement.getAttribute("Id"); + String id = protectedElement.getAttributeNS(null, "Id"); String wsuId = protectedElement.getAttributeNS(WSConstants.WSU_NS, "Id"); if (sigId.equals(id) || sigId.equals(wsuId)) { return true; Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractPolicySecurityTest.java Wed Mar 20 16:36:34 2013 @@ -336,7 +336,7 @@ public abstract class AbstractPolicySecu Element issuedAssertion = this.readDocument("example-sts-issued-saml-assertion.xml").getDocumentElement(); - String assertionId = issuedAssertion.getAttributeNode("AssertionID").getNodeValue(); + String assertionId = issuedAssertion.getAttributeNodeNS(null, "AssertionID").getNodeValue(); SecurityToken issuedToken = new SecurityToken(assertionId, issuedAssertion, null); Modified: cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java Wed Mar 20 16:36:34 2013 @@ -45,8 +45,8 @@ public class IdentityClaimsParser implem String claimLocalName = claimType.getLocalName(); String claimNS = claimType.getNamespaceURI(); if ("ClaimType".equals(claimLocalName)) { - String claimTypeUri = claimType.getAttribute("Uri"); - String claimTypeOptional = claimType.getAttribute("Optional"); + String claimTypeUri = claimType.getAttributeNS(null, "Uri"); + String claimTypeOptional = claimType.getAttributeNS(null, "Optional"); RequestClaim requestClaim = new RequestClaim(); try { requestClaim.setClaimType(new URI(claimTypeUri)); @@ -60,8 +60,8 @@ public class IdentityClaimsParser implem requestClaim.setOptional(Boolean.parseBoolean(claimTypeOptional)); return requestClaim; } else if ("ClaimValue".equals(claimLocalName)) { - String claimTypeUri = claimType.getAttribute("Uri"); - String claimTypeOptional = claimType.getAttribute("Optional"); + String claimTypeUri = claimType.getAttributeNS(null, "Uri"); + String claimTypeOptional = claimType.getAttributeNS(null, "Optional"); RequestClaim requestClaim = new RequestClaim(); try { requestClaim.setClaimType(new URI(claimTypeUri)); Modified: cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java Wed Mar 20 16:36:34 2013 @@ -571,7 +571,7 @@ public class RequestParser { String dialectAttr = null; RequestClaimCollection requestedClaims = new RequestClaimCollection(); try { - dialectAttr = claimsElement.getAttribute("Dialect"); + dialectAttr = claimsElement.getAttributeNS(null, "Dialect"); if (dialectAttr != null && !"".equals(dialectAttr)) { requestedClaims.setDialect(new URI(dialectAttr)); } Modified: cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java Wed Mar 20 16:36:34 2013 @@ -174,9 +174,9 @@ public class SAMLTokenProvider implement String tokenType = tokenRequirements.getTokenType(); if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML2_NS.equals(tokenType)) { - response.setTokenId(token.getAttribute("ID")); + response.setTokenId(token.getAttributeNS(null, "ID")); } else { - response.setTokenId(token.getAttribute("AssertionID")); + response.setTokenId(token.getAttributeNS(null, "AssertionID")); } DateTime validFrom = null; Modified: cxf/branches/2.6.x-fixes/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimParser.java Wed Mar 20 16:36:34 2013 @@ -34,12 +34,12 @@ public class CustomClaimParser implement String claimLocalName = claim.getLocalName(); String claimNS = claim.getNamespaceURI(); if (CLAIMS_DIALECT.equals(claimNS) && "MyElement".equals(claimLocalName)) { - String claimTypeUri = claim.getAttribute("Uri"); + String claimTypeUri = claim.getAttributeNS(null, "Uri"); CustomRequestClaim response = new CustomRequestClaim(); response.setClaimType(URI.create(claimTypeUri)); - String claimValue = claim.getAttribute("value"); + String claimValue = claim.getAttributeNS(null, "value"); response.setClaimValue(claimValue); - String scope = claim.getAttribute("scope"); + String scope = claim.getAttributeNS(null, "scope"); response.setScope(scope); return response; } Modified: cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java Wed Mar 20 16:36:34 2013 @@ -1086,7 +1086,7 @@ public class SimpleBatchSTSClient implem || elName.equals(new QName(WSConstants.WSSE_NS, "KeyIdentifier"))) { return DOMUtils.getContent(child); } else if (elName.equals(Reference.TOKEN)) { - return child.getAttribute("URI"); + return child.getAttributeNS(null, "URI"); } else if (elName.equals(new QName(STSUtils.SCT_NS_05_02, "Identifier")) || elName.equals(new QName(STSUtils.SCT_NS_05_12, "Identifier"))) { return DOMUtils.getContent(child); Modified: cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java Wed Mar 20 16:36:34 2013 @@ -58,12 +58,12 @@ public final class TokenTestUtils { //mess with the token a bit to force it to fail to validate Element e = tok.getToken(); Element e2 = DOMUtils.getFirstChildWithName(e, e.getNamespaceURI(), "Conditions"); - String nb = e2.getAttribute("NotBefore"); - String noa = e2.getAttribute("NotOnOrAfter"); + String nb = e2.getAttributeNS(null, "NotBefore"); + String noa = e2.getAttributeNS(null, "NotOnOrAfter"); nb = "2010" + nb.substring(4); noa = "2010" + noa.substring(4); - e2.setAttribute("NotBefore", nb); - e2.setAttribute("NotOnOrAfter", noa); + e2.setAttributeNS(null, "NotBefore", nb); + e2.setAttributeNS(null, "NotOnOrAfter", noa); try { sts.validateSecurityToken(tok); fail("Failure expected on an invalid token"); Copied: cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java (from r1458828, cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java) URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java?p2=cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java&p1=cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java&r1=1458828&r2=1458934&rev=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsParser.java Wed Mar 20 16:36:34 2013 @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.cxf.sts.claims; +package org.apache.cxf.systest.sts.deployment; import java.net.URI; import java.net.URISyntaxException; @@ -29,13 +29,18 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.apache.cxf.common.logging.LogUtils; +import org.apache.cxf.sts.claims.ClaimsParser; +import org.apache.cxf.sts.claims.RequestClaim; -public class IdentityClaimsParser implements ClaimsParser { +/** + * A Custom ClaimsParser implementation. + */ +public class CustomClaimsParser implements ClaimsParser { - public static final String IDENTITY_CLAIMS_DIALECT = - "http://schemas.xmlsoap.org/ws/2005/05/identity"; + public static final String DIALECT = + "http://schemas.mycompany.com/claims"; - private static final Logger LOG = LogUtils.getL7dLogger(IdentityClaimsParser.class); + private static final Logger LOG = LogUtils.getL7dLogger(CustomClaimsParser.class); public RequestClaim parse(Element claim) { return parseClaimType(claim); @@ -45,8 +50,8 @@ public class IdentityClaimsParser implem String claimLocalName = claimType.getLocalName(); String claimNS = claimType.getNamespaceURI(); if ("ClaimType".equals(claimLocalName)) { - String claimTypeUri = claimType.getAttribute("Uri"); - String claimTypeOptional = claimType.getAttribute("Optional"); + String claimTypeUri = claimType.getAttributeNS(null, "Uri"); + String claimTypeOptional = claimType.getAttributeNS(null, "Optional"); RequestClaim requestClaim = new RequestClaim(); try { requestClaim.setClaimType(new URI(claimTypeUri)); @@ -60,8 +65,8 @@ public class IdentityClaimsParser implem requestClaim.setOptional(Boolean.parseBoolean(claimTypeOptional)); return requestClaim; } else if ("ClaimValue".equals(claimLocalName)) { - String claimTypeUri = claimType.getAttribute("Uri"); - String claimTypeOptional = claimType.getAttribute("Optional"); + String claimTypeUri = claimType.getAttributeNS(null, "Uri"); + String claimTypeOptional = claimType.getAttributeNS(null, "Optional"); RequestClaim requestClaim = new RequestClaim(); try { requestClaim.setClaimType(new URI(claimTypeUri)); @@ -100,6 +105,6 @@ public class IdentityClaimsParser implem * Return the supported dialect of this class */ public String getSupportedDialect() { - return IDENTITY_CLAIMS_DIALECT; + return DIALECT; } } Modified: cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java Wed Mar 20 16:36:34 2013 @@ -109,9 +109,9 @@ public class SCTSAMLTokenProvider implem String tokenType = tokenRequirements.getTokenType(); if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML2_NS.equals(tokenType)) { - response.setTokenId(token.getAttribute("ID")); + response.setTokenId(token.getAttributeNS(null, "ID")); } else { - response.setTokenId(token.getAttribute("AssertionID")); + response.setTokenId(token.getAttributeNS(null, "AssertionID")); } response.setLifetime(conditionsProvider.getLifetime()); response.setEntropy(entropyBytes); Modified: cxf/branches/2.6.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java (original) +++ cxf/branches/2.6.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java Wed Mar 20 16:36:34 2013 @@ -59,12 +59,12 @@ public final class TokenTestUtils { //mess with the token a bit to force it to fail to validate Element e = tok.getToken(); Element e2 = DOMUtils.getFirstChildWithName(e, e.getNamespaceURI(), "Conditions"); - String nb = e2.getAttribute("NotBefore"); - String noa = e2.getAttribute("NotOnOrAfter"); + String nb = e2.getAttributeNS(null, "NotBefore"); + String noa = e2.getAttributeNS(null, "NotOnOrAfter"); nb = "2010" + nb.substring(4); noa = "2010" + noa.substring(4); - e2.setAttribute("NotBefore", nb); - e2.setAttribute("NotOnOrAfter", noa); + e2.setAttributeNS(null, "NotBefore", nb); + e2.setAttributeNS(null, "NotOnOrAfter", noa); try { sts.validateSecurityToken(tok); fail("Failure expected on an invalid token"); Modified: cxf/branches/2.6.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1458934&r1=1458933&r2=1458934&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java (original) +++ cxf/branches/2.6.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java Wed Mar 20 16:36:34 2013 @@ -217,7 +217,7 @@ public class JavaFirstPolicyServiceTest private Element getOperationElement(String operationName, List<Element> operationMessages) { Element operationElement = null; for (Element operation : operationMessages) { - if (operationName.equals(operation.getAttribute("name"))) { + if (operationName.equals(operation.getAttributeNS(null, "name"))) { operationElement = operation; break; } @@ -230,10 +230,24 @@ public class JavaFirstPolicyServiceTest Element messageElement = DOMUtils.getFirstChildWithName(operationElement, WSDL_NAMESPACE, type.name().toLowerCase()); assertNotNull(messageElement); +<<<<<<< HEAD Element policyReference = DOMUtils.getFirstChildWithName(messageElement, policyNamespace, +======= + Element policyReference = DOMUtils.getFirstChildWithName(messageElement, policyNamespace, "PolicyReference"); if (policyReference != null) { - return policyReference.getAttribute("URI"); + return policyReference.getAttributeNS(null, "URI"); + } else { + return null; + } + } + + private String getOperationPolicyReferenceId(Element operationElement, String policyNamespace) { + Element policyReference = DOMUtils.getFirstChildWithName(operationElement, policyNamespace, +>>>>>>> 4c6a8d2... Merged revisions 1458926 via git cherry-pick from + "PolicyReference"); + if (policyReference != null) { + return policyReference.getAttributeNS(null, "URI"); } else { return null; }
