cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1327512 - in /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts: claims/IdentityClaimsParser.java request/RequestParser.java
Date Wed, 18 Apr 2012 13:58:42 GMT
Author: coheigea
Date: Wed Apr 18 13:58:41 2012
New Revision: 1327512

URL: http://svn.apache.org/viewvc?rev=1327512&view=rev
Log:
Trim input parameters that are received via SecondaryParameters and Claims

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java?rev=1327512&r1=1327511&r2=1327512&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/IdentityClaimsParser.java
Wed Apr 18 13:58:41 2012
@@ -76,7 +76,7 @@ public class IdentityClaimsParser implem
             Node valueNode = claimType.getFirstChild();
             if (valueNode != null) {
                 if ("Value".equals(valueNode.getLocalName())) {
-                    requestClaim.setClaimValue(valueNode.getTextContent());
+                    requestClaim.setClaimValue(valueNode.getTextContent().trim());
                 } else {
                     LOG.warning("Unsupported child element of ClaimValue element "
                             + valueNode.getLocalName());

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java?rev=1327512&r1=1327511&r2=1327512&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
Wed Apr 18 13:58:41 2012
@@ -342,7 +342,7 @@ public class RequestParser {
                     SecurityTokenReferenceType.class.cast(useKeyJaxb.getValue());
                 Element token = fetchTokenElementFromReference(strType, wsContext);
                 try {
-                    x509 = Base64Utility.decode(token.getTextContent());
+                    x509 = Base64Utility.decode(token.getTextContent().trim());
                     LOG.fine("Found X509Certificate UseKey type via reference");
                 } catch (Exception e) {
                     LOG.log(Level.WARNING, "", e);
@@ -353,7 +353,7 @@ public class RequestParser {
             if (isTokenReferenced(useKey.getAny())) {
                 Element token = fetchTokenElementFromReference(useKey.getAny(), wsContext);
                 try {
-                    x509 = Base64Utility.decode(token.getTextContent());
+                    x509 = Base64Utility.decode(token.getTextContent().trim());
                     LOG.fine("Found X509Certificate UseKey type via reference");
                 } catch (Exception e) {
                     LOG.log(Level.WARNING, "", e);
@@ -370,7 +370,7 @@ public class RequestParser {
                         );
                     if (x509CertData != null && x509CertData.getLength() > 0)
{
                         try {
-                            x509 = Base64Utility.decode(x509CertData.item(0).getTextContent());
+                            x509 = Base64Utility.decode(x509CertData.item(0).getTextContent().trim());
                             LOG.fine("Found X509Certificate UseKey type");
                         } catch (Exception e) {
                             LOG.log(Level.WARNING, "", e);
@@ -528,17 +528,17 @@ public class RequestParser {
             String namespace = child.getNamespaceURI();
             if (keyRequirements.getKeySize() == 0 && "KeySize".equals(localName)

                 && STSConstants.WST_NS_05_12.equals(namespace)) {
-                long keySize = Integer.parseInt(child.getTextContent());
+                long keySize = Integer.parseInt(child.getTextContent().trim());
                 keyRequirements.setKeySize(keySize);
                 LOG.fine("Found KeySize: " + keySize);
             } else if (tokenRequirements.getTokenType() == null 
                 && "TokenType".equals(localName) && STSConstants.WST_NS_05_12.equals(namespace))
{
-                String tokenType = child.getTextContent();
+                String tokenType = child.getTextContent().trim();
                 tokenRequirements.setTokenType(tokenType);
                 LOG.fine("Found TokenType: " + tokenType);
             } else if (keyRequirements.getKeyType() == null 
                 && "KeyType".equals(localName) && STSConstants.WST_NS_05_12.equals(namespace))
{
-                String keyType = child.getTextContent();
+                String keyType = child.getTextContent().trim();
                 LOG.fine("Found KeyType: " + keyType);
                 keyRequirements.setKeyType(keyType);
             } else if (tokenRequirements.getClaims() == null 



Mime
View raw message