Author: coheigea
Date: Mon May 9 16:00:46 2011
New Revision: 1101079
URL: http://svn.apache.org/viewvc?rev=1101079&view=rev
Log:
Default to signing the SOAP Body for an empty SignedParts policy assertion.
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/SignedEncryptedElements.java
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java?rev=1101079&r1=1101078&r2=1101079&view=diff
==============================================================================
---
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java
(original)
+++
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SignedPartsBuilder.java
Mon May 9 16:00:46 2011
@@ -59,6 +59,14 @@ public class SignedPartsBuilder implemen
nd = nd.getNextSibling();
}
+ //
+ // If SignedParts is empty then default to signing the SOAP Body
+ //
+ if (!signedEncryptedParts.isBody() &&
!signedEncryptedParts.isAttachments()
+ && signedEncryptedParts.getHeaders().isEmpty()) {
+ signedEncryptedParts.setBody(true);
+ }
+
return signedEncryptedParts;
}
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/SignedEncryptedElements.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/SignedEncryptedElements.java?rev=1101079&r1=1101078&r2=1101079&view=diff
==============================================================================
---
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/SignedEncryptedElements.java
(original)
+++
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/SignedEncryptedElements.java
Mon May 9 16:00:46 2011
@@ -43,11 +43,11 @@ public class SignedEncryptedElements ext
/**
* Just a flag to identify whether this holds sign element info or encr
elements info
*/
- private boolean signedElemets;
+ private boolean signedElements;
public SignedEncryptedElements(boolean signedElements, SPConstants
version) {
super(version);
- this.signedElemets = signedElements;
+ this.signedElements = signedElements;
}
/**
@@ -76,10 +76,10 @@ public class SignedEncryptedElements ext
}
/**
- * @return Returns the signedElemets.
+ * @return Returns the signedElements.
*/
public boolean isSignedElemets() {
- return signedElemets;
+ return signedElements;
}
public Map<String, String> getDeclaredNamespaces() {
@@ -127,13 +127,13 @@ public class SignedEncryptedElements ext
}
public QName getRealName() {
- if (signedElemets) {
+ if (signedElements) {
return constants.getSignedElements();
}
return constants.getEncryptedElements();
}
public QName getName() {
- if (signedElemets) {
+ if (signedElements) {
return SP12Constants.INSTANCE.getSignedElements();
}
return SP12Constants.INSTANCE.getEncryptedElements();