Repository navigation
Conversation
| * A shared cache must not store a response to a request that the protocol layer | ||
| * authenticated with credentials from the credentials provider. | ||
| */ | ||
| class TestCachingExecAuthenticatedResponse { |
There was a problem hiding this comment.
@Hsnmohd Please move this test case to TestClientAuthentication
|
@Hsnmohd Better yet, consider starting new test suites for caching clients (classic and async). There are |
arturobernalg
left a comment
There was a problem hiding this comment.
I reproduced a case not covered by this fix: preemptive authentication sends Authorization while AuthExchange remains UNCHALLENGED, so isTargetAuthenticated() returns false.
Both classic and async caching clients serve Alice's cached private response to an anonymous request instead of returning 401.
We should cover this case before merging.
CachingExec and AsyncCachingExec run above ProtocolExec, so the RFC 9111 3.5 shared-cache check never sees the Authorization header generated from the CredentialsProvider or AuthCache (the classic exec always sends a copy down the chain, and both protocol execs copy the request on a non-tunnelled proxy route), which let a
200withCache-Control: max-age=60returned to alice's authenticated request be stored in the default shared cache and served to a context with no credentials; the fix treats the response as authenticated when the route target's AuthExchange is in SUCCESS state.