reta commented on a change in pull request #869:
URL: https://github.com/apache/cxf/pull/869#discussion_r741939763
##########
File path:
rt/rs/security/http-signature/src/test/java/org/apache/cxf/rs/security/httpsignature/MessageVerifierTest.java
##########
@@ -51,6 +51,7 @@
private static final String METHOD = "GET";
private static final String URI = "/test/signature";
private static final String KEY_PAIR_GENERATOR_ALGORITHM = "RSA";
+ private static final String MESSAGE_BODY = "Hello";
Review comment:
@AnilKumarHurkadli I just realized there are no testcases for the case
when message body is not present, exactly the flow you are implementing. Could
you please add a couple please?
##########
File path:
rt/rs/security/http-signature/src/main/java/org/apache/cxf/rs/security/httpsignature/MessageVerifier.java
##########
@@ -119,11 +118,23 @@ public void verifyMessage(Map<String, List<String>>
messageHeaders, String metho
// Add the default required headers
boolean requestor = MessageUtils.isRequestor(m);
+ byte[] payload = null;
if (addDefaultRequiredHeaders) {
if (!(requestor ||
signedHeaders.contains(HTTPSignatureConstants.REQUEST_TARGET))) {
signedHeaders.add(HTTPSignatureConstants.REQUEST_TARGET);
}
- if (!signedHeaders.contains("digest")) {
+
+ InputStream is = m.getContent(InputStream.class);
Review comment:
👍 Thank you!
##########
File path:
rt/rs/security/http-signature/src/test/java/org/apache/cxf/rs/security/httpsignature/MessageVerifierTest.java
##########
@@ -51,6 +51,7 @@
private static final String METHOD = "GET";
private static final String URI = "/test/signature";
private static final String KEY_PAIR_GENERATOR_ALGORITHM = "RSA";
+ private static final String MESSAGE_BODY = "Hello";
Review comment:
@AnilKumarHurkadli I just realized there are no testcases for the case
when message body is not present, exactly the flow you are implementing. Could
you please add a couple please?
##########
File path:
rt/rs/security/http-signature/src/main/java/org/apache/cxf/rs/security/httpsignature/MessageVerifier.java
##########
@@ -119,11 +118,23 @@ public void verifyMessage(Map<String, List<String>>
messageHeaders, String metho
// Add the default required headers
boolean requestor = MessageUtils.isRequestor(m);
+ byte[] payload = null;
if (addDefaultRequiredHeaders) {
if (!(requestor ||
signedHeaders.contains(HTTPSignatureConstants.REQUEST_TARGET))) {
signedHeaders.add(HTTPSignatureConstants.REQUEST_TARGET);
}
- if (!signedHeaders.contains("digest")) {
+
+ InputStream is = m.getContent(InputStream.class);
Review comment:
👍 Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]