Skip to content

add client digest interceptor#531

Merged
coheigea merged 5 commits intoapache:masterfrom
davidkarlsen:feature/digestInterceptor
Apr 5, 2019
Merged

add client digest interceptor#531
coheigea merged 5 commits intoapache:masterfrom
davidkarlsen:feature/digestInterceptor

Conversation

@davidkarlsen
Copy link
Copy Markdown
Contributor

Signed-off-by: David J. M. Karlsen david@davidkarlsen.com
@coheigea

@davidkarlsen davidkarlsen force-pushed the feature/digestInterceptor branch from fa93f25 to 5463c82 Compare April 2, 2019 13:22
@davidkarlsen
Copy link
Copy Markdown
Contributor Author

@coheigea any thoughts on this one?
BTW: Are updated snapshots pushed out anywhere? I have a library to adapt to 3.3.2

@coheigea
Copy link
Copy Markdown
Contributor

coheigea commented Apr 2, 2019

Yes see here: https://repository.apache.org/content/groups/snapshots/org/apache/cxf/cxf-rt-rs-security-http-signature/3.3.2-SNAPSHOT/

Copy link
Copy Markdown
Contributor

@coheigea coheigea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried the CreateDigestInterceptor in a test, it writes the header out correctly, but the message body is blank. Here is a test to reproduce:

9005703

I suggest looking at the JOSE interceptors to see how they do it: https://github.com/apache/cxf/tree/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs

Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
@davidkarlsen davidkarlsen force-pushed the feature/digestInterceptor branch from 93b5c67 to 47ee9bd Compare April 3, 2019 17:49
Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
@davidkarlsen davidkarlsen force-pushed the feature/digestInterceptor branch from 6499c07 to 80c949f Compare April 3, 2019 19:51
@davidkarlsen
Copy link
Copy Markdown
Contributor Author

davidkarlsen commented Apr 4, 2019

@coheigea I had missed calling proceed() which is added now and the test passes (although there is not a matching server-side filter configured in the test as far as I could see?) - maybe it should be a round-trip test with digest+signing+signature-validation on the client side + digestVerification+signatureCheck+signatureOfResponse serverside.

I have an alternative implementation which looks more similar to the jws stuff and wraps the output stream in a cachedOutputStream if you are interested in taking a look? I could add it as a separate PR?

@coheigea
Copy link
Copy Markdown
Contributor

coheigea commented Apr 4, 2019

@davidkarlsen - I'll take care of adding the tests. The latest code is still not working, if you look at SignatureHeaderUtils.createDigestHeader, the messageBody String is actually blank. Maybe use the JWS approach instead in this PR?

@davidkarlsen davidkarlsen force-pushed the feature/digestInterceptor branch from 20ec789 to 92c5a87 Compare April 4, 2019 19:16
@coheigea coheigea merged commit 40b9814 into apache:master Apr 5, 2019
@davidkarlsen davidkarlsen deleted the feature/digestInterceptor branch April 6, 2019 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants