-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix up the healthcheck endpoint #2704
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2704 +/- ##
============================================
+ Coverage 91.14% 91.17% +0.02%
- Complexity 1497 1501 +4
============================================
Files 306 307 +1
Lines 6312 6332 +20
============================================
+ Hits 5753 5773 +20
Misses 542 542
Partials 17 17
Flags with carried forward coverage won't be shown. Click here to find out more.
|
$request = $this->signer->signRequest($request, $this->credentials); | ||
|
||
foreach ($this->headers as $header => $value) { | ||
$request = $request->withHeader($header, $value); | ||
} | ||
|
||
return $this->signer->signRequest($request, $this->credentials); | ||
return $request; |
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.
I think this may cause signing to break, since V4 signatures include the headers as part of the signature. If you add headers after signing, they'll be included in the signature AWS generates server-side and the signatures won't match,
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.
Mmm. Darn. Hadn't considered that.
The issue here is that the mock codes service expects a static Authorisation header value, hence overwriting it after the fact works.
If you set that value first then the aws signer overwrites it with it's own.
I guess this class needs a different approach to handle that case. I think what I'll do is treat the 'Authorization' header as a special case. If you're setting that manually then you know you're going to be breaking the aws signature side of things - which is fine for us because that only happens when doing local dev.
* @param RequestInterface $request | ||
* @param RequestInterface $uri |
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.
Is this right? The PHP typehints suggest the parameter is still called $request
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.
Not sure what happened here. Will fix.
Side effect being that all 3rd party dependencies of the service must be working for a successful deployment.
ef1c98a
to
8dd5a11
Compare
Approach
Switch out to the PSR standards http client code introduced earlier for the healthcheck.
Additionally ensured that the healthcheck works locally against the configured mocks.
Checklist