-
Notifications
You must be signed in to change notification settings - Fork 215
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
feat(casting): makeHttpClient for explicit net access with cosmjs #7935
Conversation
cb7154d
to
c2716e2
Compare
7b15a20
to
3a10d1b
Compare
21b7030
to
3ebb206
Compare
3ebb206
to
d7ffad5
Compare
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 love it! The response id
handling could be made spec-conformant, but this is worth landing even if you don't do that.
code: -32601, | ||
message: 'Method not found', | ||
}, | ||
id: 1, |
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.
This id
should match the one on line 18 it is replying to, in order to conform to the JSON-RPC response object spec.
}, | ||
]), | ||
{ | ||
id: 2, |
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.
This, too, should match the body.id
above.
}, | ||
]), | ||
{ | ||
id: 753972443441, |
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.
Same.
I haven't looked closely yet but regarding the recording have you considered something off the shelf? Eg https://github.com/nock/nock#recording |
I didn't; I don't expect to find anything comparable. That is: ~100 lines and no use of ambient authority. nock is clearly >>100 lines. I don't see any support for explicit rather than ambient authority. |
- test: query using generated vstorage stubs - captureIO test utility - net access fixture
7ae4130
to
dd56704
Compare
feat(casting): makeHttpClient for explicit net access with cosmjs
refs: #7905
stacked on #7950
Description
makeHttpClient
is an alternative to the cosmjs HttpClient that uses explicit rather than ambient access to the network.Security Considerations
facilitates use within a
Compartment
, for example.In due course, I'd like other relevant APIs in the casting package to allow passing in network access likewise.
Scaling / Documentation Considerations
n/a
Testing Considerations
Also includes
captureIO
andreplayIO
test utilities to wrapfetch
, record the traffic as fixtures, and then replay it from those fixtures.