Trusted entitlements: Support API key and url in signature#1118
Conversation
Codecov Report
@@ Coverage Diff @@
## new-trusted-entitlements-signature-format #1118 +/- ##
=============================================================================
- Coverage 85.10% 84.91% -0.20%
=============================================================================
Files 186 186
Lines 6574 6614 +40
Branches 935 947 +12
=============================================================================
+ Hits 5595 5616 +21
- Misses 603 622 +19
Partials 376 376
|
| RCHTTPStatusCodes.isSuccessful(responseCode) | ||
| ) { | ||
| verifyResponse(path, connection, payload, nonce) | ||
| verifyResponse(urlPathWithVersion, connection, payload, nonce) |
There was a problem hiding this comment.
This was previously only used for logging, so it's fine to change it to include the api version (/v1)
vegaro
left a comment
There was a problem hiding this comment.
Haven't followed that much the required change but code looks good to me 😊
| Uri.decode(urlPath).toByteArray() + | ||
| requestTime.toByteArray() + | ||
| (eTag?.toByteArray() ?: byteArrayOf()) + | ||
| (body?.toByteArray() ?: byteArrayOf()) |
There was a problem hiding this comment.
I was going to suggest extracting this into a private function but it might have too many parameters?
There was a problem hiding this comment.
Yeah, I wasn't in love this... In the end, I changed it to imitate what we do in iOS. Basically I created a new data holder for all this so we can move the creation of the signature to verify there. Still long, but provides a better abstraction IMO.
### Description This will support the newer form of signature that includes the API key and url
Description
This will support the newer form of signature that includes the API key and url