-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- permit to cache Proxy authentication, and to combine with website authentication #83
- permit to cache Proxy authentication, and to combine with website authentication #83
Conversation
…tinguish between a key from a request, and a key from a proxy object. - AuthenticationCacheInterceptor use a DefaultRequestCacheKeyProvider or DefaultProxyCacheKeyProvider, to get the right key. autCache is purged, depending if applied against a proxy or request object, AND the related response code. - Add DefaultProxyCacheKeyProvider - Rename DefaultCacheKeyProvider.java into DefaultRequestCacheKeyProvider - update doc to illustrate how to cache proxy authenticaiton (with NetworkInterceptor), and how to combine both authentications (proxy and web site).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot for your great contribution. I really appreciate it. Could you be so kind to add a new test case for the new features you introduced. As I dont have a test server with which I can replicate that it would take me quite a while to set everything up and come up with a realistic test case.
src/main/java/com/burgstaller/okhttp/DefaultProxyCacheKeyProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/burgstaller/okhttp/AuthenticationCacheInterceptor.java
Outdated
Show resolved
Hide resolved
src/main/java/com/burgstaller/okhttp/AuthenticationCacheInterceptor.java
Outdated
Show resolved
Hide resolved
…der.java Co-authored-by: rburgst <rburgst@gmail.com>
…thentication failed.
add junit 5 'test' dependency. add wiremock 'test' dependency. add a 'test' block to allow junit5 use in gradle.
- basic authentication for proxy and basic authentication for web site - digest authentication for proxy and digest authentication for web site
…ion_in_the_same_time' into allow_proxy_and_site_authentication_in_the_same_time
@rburgst : i've updated the pull request based on your comments. Have you any feedback on this new submission ? Charles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your great contribution and sorry for the slow responses. I am currently on vacation and reviewing on the phone is a bit tricky. Once I am back I will prepare a new release.
src/test/java/com/burgstaller/okhttp/AuthenticationCacheInterceptorTest.java
Show resolved
Hide resolved
…ble and fix AuthenticationCacheInterceptorTest mockito content, and modernize assertions.
…ble and fix AuthenticationCacheInterceptorTest mockito content, and modernize assertions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome improvements, thanks so much
goal : permit to cache Proxy authentication, and to combine it with website authentication :
add to CacheKeyProvider the 'applyToProxy' method, to permit to distinguish between a key from a request, and a key from a proxy object.
AuthenticationCacheInterceptor use a DefaultRequestCacheKeyProvider or DefaultProxyCacheKeyProvider, to get the right key. autCache is purged, depending if applied against a proxy or request object, AND the related response code.
Add DefaultProxyCacheKeyProvider
Rename DefaultCacheKeyProvider.java into DefaultRequestCacheKeyProvider
update doc to illustrate how to cache proxy authenticaiton (with NetworkInterceptor), and how to combine both authentications (proxy and web site).