This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new e3aee23 Updating HTTP Signature test to check for a signed digest
properly
e3aee23 is described below
commit e3aee2313300215ca11b2611ebe9baa15375baeb
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Wed Apr 10 11:54:19 2019 +0100
Updating HTTP Signature test to check for a signed digest properly
---
.../httpsignature/JAXRSHTTPSignatureTest.java | 12 +++---------
.../systest/jaxrs/security/httpsignature/server.xml | 19 +++++++++++++++++++
2 files changed, 22 insertions(+), 9 deletions(-)
diff --git
a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
index 5cfd2c9..cd85c97 100644
---
a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
+++
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/httpsignature/JAXRSHTTPSignatureTest.java
@@ -66,6 +66,7 @@ import org.apache.cxf.systest.jaxrs.security.Book;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -597,6 +598,7 @@ public class JAXRSHTTPSignatureTest extends
AbstractBusClientServerTestBase {
// TODO The Digest is not being signed yet
@Test
+ @Ignore
public void testHttpSignatureDigest() throws Exception {
URL busFile = JAXRSHTTPSignatureTest.class.getResource("client.xml");
@@ -613,7 +615,7 @@ public class JAXRSHTTPSignatureTest extends
AbstractBusClientServerTestBase {
CreateDigestInterceptor digestFilter = new CreateDigestInterceptor();
- String address = "http://localhost:" + PORT +
"/httpsig/bookstore/books";
+ String address = "http://localhost:" + PORT +
"/httpsigdigest/bookstore/books";
WebClient client =
WebClient.create(address, Arrays.asList(digestFilter,
signatureFilter), busFile.toString());
client.type("application/xml").accept("application/xml");
@@ -1117,18 +1119,10 @@ public class JAXRSHTTPSignatureTest extends
AbstractBusClientServerTestBase {
IOUtils.copy(cachedOutputStream.getInputStream(),
originalOutputStream);
}
- public boolean isChangeDigestValue() {
- return changeDigestValue;
- }
-
public void setChangeDigestValue(boolean changeDigestValue) {
this.changeDigestValue = changeDigestValue;
}
- public boolean isEmptyDigestValue() {
- return emptyDigestValue;
- }
-
public void setEmptyDigestValue(boolean emptyDigestValue) {
this.emptyDigestValue = emptyDigestValue;
}
diff --git
a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
index 99cc209..4fc5d87 100644
---
a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
+++
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/httpsignature/server.xml
@@ -154,4 +154,23 @@ under the License.
</jaxrs:properties>
</jaxrs:server>
+ <util:list id="requiredHeaders">
+ <value>(request-target)</value>
+ <value>digest</value>
+ </util:list>
+ <jaxrs:server
address="http://localhost:${testutil.ports.jaxrs-httpsignature}/httpsigdigest">
+ <jaxrs:serviceBeans>
+ <ref bean="serviceBean"/>
+ </jaxrs:serviceBeans>
+ <jaxrs:providers>
+ <bean
class="org.apache.cxf.rs.security.httpsignature.filters.VerifySignatureFilter"
/>
+ <bean
class="org.apache.cxf.rs.security.httpsignature.filters.VerifyDigestInterceptor"
/>
+ </jaxrs:providers>
+ <jaxrs:properties>
+ <entry key="rs.security.signature.in.properties"
+
value="org/apache/cxf/systest/jaxrs/security/httpsignature/alice.httpsig.properties"
/>
+ <entry key="rs.security.http.signature.in.headers"
value-ref="requiredHeaders" />
+ </jaxrs:properties>
+ </jaxrs:server>
+
</beans>