Use actual ohttp-relay in integration tests#572
Conversation
Pull Request Test Coverage Report for Build 13866951625Details
💛 - Coveralls |
spacebear21
left a comment
There was a problem hiding this comment.
concept ACK
I wonder if there's any way we could specify the SSL cert path explicitly when initializing the ohttp relay, such that it wouldn't have to read from a shared env variable?
Yes, we can construct a This would mean following up on payjoin/ohttp-relay#62 with something that introduces a mechanism to pass that root store around (IMO introducing a Then instead of an environment variable, the CLI interface for the relay could have a CLI option. That would be a more significant change, I decided to use an environment variable in the end since it was significantly less boilerplate code, which I felt was important to control the feature gating complexity. |
|
I was mistaken, since the relay is not actually started as a CLI program in the e2e tests, there's no such restriction. |
While the directory's OHTTP gateway does not require the content type header to be set to `message/ohttp-req`, the OHTTP relay does.
072ae78 to
0cfea7a
Compare
9f40e94 to
6073ff2
Compare
6073ff2 to
935d4a8
Compare
The certificate generated by TestServices is self signed, add it to a new RootCertStore and give it to the relay for when it acts as an HTTP client as part of the updated relay API that supports this. Also use GatewayUri instead of Uri, which has also changed upstream.
Instead of sending OHTTP requests directly to the gateway, send them through the relay set up by TestServices.
935d4a8 to
8649acf
Compare
DanGould
left a comment
There was a problem hiding this comment.
ACK 8649acf
What a relief to get rid of this mock.
Note this makes use of an ohttp-relay commit instead of release so that we can test properly. We will have to come out with an ohttp-relay release before we release the next payjoin version.
With this change, the payjoin directory's RFC 9540 compatible OHTTP gateway additionally opts in to receiving OHTTP requests from arbitrary relays. See payjoin/ohttp-relay#58. Depends on - #549 - #572
Some instances of specifying the gateway as the relay were missed in payjoin#572
Some instances of specifying the gateway as the relay were missed in payjoin#572
Instead of submitting OHTTP requests directly to the directory's OHTTP gateway, give the OHTTP gateway's self signed certificate to the relay so it can connect to it, and exercise the relay in the integration tests.
This change updates
payjoin-test-util'sCargo.tomlto use a git origin for the merge commit of payjoin/ohttp-relay#63, as such it needs to be followed up with a commit that specifies an updated version before release.Depends on
(edit by Dan, when you put dependencies in a list the render pretty)