Trusted Entitlements: update handling of 304 responses#2698
Conversation
f3654ae to
90a95d8
Compare
38c9d99 to
fd49f15
Compare
90a95d8 to
12283d5
Compare
fd49f15 to
5b3a59d
Compare
12283d5 to
5741e29
Compare
5b3a59d to
83757b0
Compare
4875780 to
6d5da7b
Compare
250270c to
b0782ab
Compare
6d5da7b to
e9e2d8e
Compare
b0782ab to
a11ae88
Compare
e9e2d8e to
4d7e631
Compare
88a3120 to
62010bf
Compare
b4e4adc to
dd41618
Compare
There was a problem hiding this comment.
This is removed from HTTPResponse now, so it no longer defaults to .notRequested.
There was a problem hiding this comment.
A nice refactor here: this is now defined on the protocol HTTPResponseType so it's available for both response types.
Also no longer accepting any String, enforcing that we use this only with HTTPClient.ResponseHeaders and not HTTPClient.RequestHeaders
1265476 to
c101849
Compare
62010bf to
e654254
Compare
fb1b4c9 to
7181dba
Compare
|
This is ready again 🎉 |
tonidero
left a comment
There was a problem hiding this comment.
Everything makes sense!
|
|
||
| // MARK: - VerifiedHTTPResponse | ||
|
|
||
| struct VerifiedHTTPResponse<Body: HTTPResponseBody>: HTTPResponseType { |
There was a problem hiding this comment.
In Android, I'm still keeping only the HTTPResponse object (in android that's HTTPResult. In Android, that's created within the ETagManager, (which I admit, it's a weird responsibility to have there), but we don't need to default to NOT_REQUESTED.
There was a problem hiding this comment.
I kept this refactor cause it made things cleaner on iOS.
9d3ee66 to
92b1d1c
Compare
7181dba to
ba53303
Compare
6d66630 to
4d8fd34
Compare
- `ETagManager` no longer knows anything about signatures - `HTTPClient` loads cached response from `ETagManager` first before verifying signature with the cached body - Created new `VerifiedHTTPResponse`, which has the `VerificationResult`, extracted from `HTTPResponse` - Removed `VerificationResult.from(cache:response:)` - Updated `MockETagManager` to reflect behavior changed in #2666 - Removed `ETagManager` tests about verification since they're no longer relevant - Removed several `HTTPClient` tests that were checking a behavior that was impossible (for example, no verification result despite it being enabled), or that checked behavior based on the cached `VerificationResult`
ba53303 to
1876819
Compare
Changes:
ETagManagerno longer stores the verification modeVerifiedHTTPResponse, which has theVerificationResult, extracted fromHTTPResponseVerificationResult.from(cache:response:)SignatureVerificationHTTPClientTeststo test using the realETagManager, so they become more "end to end" unit tests. A lot of them were relying on implementation details of the mock instead of the realETagManager.HTTPClienttests that were checking a behavior that was impossible (for example, no verification result despite it being enabled), or that checked behavior based on the cachedVerificationResultDepends on #2679 and #2697.