oasisprotocol / oasis-sdk

Official SDK for the Oasis Network.
Apache License 2.0
75 stars 20 forks source link

client-sdk: allow insecure connections to localhost address #2013

Closed ptrus closed 1 month ago

ptrus commented 1 month ago

This usecase came up in https://github.com/oasisprotocol/oasis-web3-gateway/pull/626 since we want to expose the node from docker via a port (since this works better cross-platform than exposing the socket via a volume).

The alternative possible solution would be to provide a flag that allows insecure connections or connections with self-signed certs (something like --insecure in curl).

BTW we might want to do the same in oasis-core: https://github.com/oasisprotocol/oasis-core/blob/280d2ef1947bc9baaeb390c3131a08b87824c9ef/go/oasis-node/cmd/common/grpc/grpc.go#L83-L89 since ideally, both oasis-node and oasis-cli would work with local-net without much hassle.

cc @matevz

TODO:

netlify[bot] commented 1 month ago

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
Latest commit 885a055e2796a4f89c8d60f6b830fbdab81f2612
Latest deploy log https://app.netlify.com/sites/oasisprotocol-oasis-sdk/deploys/670f6fbbe4f8d7000889a604
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 60.63%. Comparing base (182b1b3) to head (a6cca06). Report is 17 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2013 +/- ## ========================================== + Coverage 59.25% 60.63% +1.38% ========================================== Files 129 130 +1 Lines 9583 9604 +21 ========================================== + Hits 5678 5823 +145 + Misses 3905 3781 -124 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ptrus commented 1 month ago

Please check again, I updated it a bit to be in line with the gRPC address spec defined at: https://github.com/grpc/grpc/blob/master/doc/naming.md

ptrus commented 1 month ago

Updated code once again, now it reuses the method from oasis-core (added in: https://github.com/oasisprotocol/oasis-core/pull/5878)

ptrus commented 1 month ago

Yes, but if we don't plan to release it anytime soon, then we could copy the method for now.

But we will need to release the updated oasis-sdk and oasis-cli anyway if we want a working cli with the localnet container, so we could wait for oasis-core as well if there are any plans for it in the near future.

@matevz not sure how urgently we want this for different components

matevz commented 1 month ago

Sure, we can wait for the point release of the oasis-core and keep a clean code here.

kostko commented 1 month ago

Oasis Core 24.3 has been released, please rebase, then we can tag the Go Client SDK.