-
Notifications
You must be signed in to change notification settings - Fork 0
Added SecureKeyX validator #70
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
Conversation
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.
Pull Request Overview
This PR introduces the SecureKeyX validator into the codebase, integrating it with secure key exchange operations across server and client components. Key changes include:
- Injection of a lumeraClient dependency and validator within server credential creation and related tests.
- Updates to factory and client creation functions to accept and pass along the lumeraClient.
- Addition of a new SecureKeyExchangeValidator implementation in the lumera package.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/securegrpc/secure_connection_test.go | Updated integration tests to initialize and use mocked validator objects |
| supernode/node/supernode/server/server_test.go | Updated tests to include lumeraClient mocks and validator parameters |
| supernode/node/supernode/server/server.go | Injected lumeraClient and applied a secure validator in server creds |
| supernode/cmd/start.go | Passed the lumeraClient during server initialization |
| sdk/task/cascade.go | Updated client factory calls with the new lumeraClient parameter |
| sdk/net/impl.go | Adjusted NewSupernodeClient to accept lumeraClient; currently passes nil validator |
| sdk/net/factory.go | Modified NewClientFactory to require and pass the lumeraClient |
| pkg/lumera/validator.go | Added new SecureKeyExchangeValidator implementation |
| pkg/testutil/* | Updated test utilities to account for validator support |
| go.mod | Updated the lumera dependency version |
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.
Pull Request Overview
This PR adds a SecureKeyX validator to centralize Lumera client checks during secure key exchanges and integrates it throughout client creation, credential setup, and DHT initialization.
- Introduces
SecureKeyExchangeValidatorwrapping alumera.Clientto exposeAccountInfoByAddressandGetSupernodeBySupernodeAddress. - Refactors
ClientFactory,NewSupernodeClient, and DHT setup to accept and use the new validator. - Updates tests, mocks, and CI workflows to support validator injection and dynamic Go version/checkout improvements.
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| supernode/cmd/start.go | Passes lumeraClient into server.New for validator support |
| sdk/task/cascade.go | Updates NewClientFactory calls to include the Lumera client |
| sdk/net/impl.go | Wires lumeraClient as Validator in NewSupernodeClient |
| sdk/net/factory.go | Extends ClientFactory with lumeraClient field and ctor change |
| sdk/adapters/lumera/adapter.go | Adds new adapter methods to call Lumera queries |
| pkg/testutil/lumera.go | Enhances mock modules to return meaningful account/supernode data |
| pkg/testutil/accounts.go | Updates SetupTestKeyExchange signature to accept a validator |
| pkg/net/credentials/lumeratc.go | Adds Validator to CommonOptions for transport credentials |
| pkg/net/credentials/alts/handshake/handshake_test.go | Mocks and injects key exchanger validator into handshake tests |
| pkg/lumera/validator.go | Defines SecureKeyExchangeValidator wrapping lumera.Client |
| pkg/lumera/modules/supernode/supernode_mock.go | Adds mock stubs for GetParams |
| pkg/lumera/modules/node/node_mock.go | Removes obsolete Verify stubs from node mock |
| pkg/lumera/modules/action_msg/action_msg_mock.go | Adds generated mock for action_msg module |
| pkg/lumera/modules/action/action_mock.go | Adds mock stubs for GetParams in action module |
| pkg/lumera/lumera_mock.go | Adds ActionMsg mock methods to Lumera client mock |
| p2p/kademlia/dht.go | Injects SecureKeyExchangeValidator into DHT secure credentials |
| go.mod | Bumps github.com/LumeraProtocol/lumera to v1.1.0 |
| .github/workflows/tests.yml | Upgrades actions/checkout to v4 |
| .github/workflows/build&release.yml | Consolidates setup to setup-env composite action |
| .github/actions/setup-env/action.yml | Adds dynamic Go version parsing and GOPRIVATE setting |
Comments suppressed due to low confidence (2)
sdk/net/factory.go:29
- [nitpick] The parameter and struct field named
lumeraClientactually held a validator. Consider renaming tovalidatororkeyExchangerValidatorfor clarity.
func NewClientFactory(ctx context.Context, logger log.Logger, keyring keyring.Keyring, lumeraClient lumera.Client, config FactoryConfig) *ClientFactory {
pkg/lumera/validator.go:21
- [nitpick] There are no unit tests covering
SecureKeyExchangeValidator. Adding tests for bothAccountInfoByAddressandGetSupernodeBySupernodeAddresswould verify error paths and nil‐response handling.
func (v *SecureKeyExchangeValidator) AccountInfoByAddress(ctx context.Context, addr string) (*authtypes.QueryAccountInfoResponse, error) {
| Keyring: keyring, | ||
| LocalIdentity: localCosmosAddress, | ||
| PeerType: securekeyx.Supernode, | ||
| Validator: lumeraClient, |
Copilot
AI
May 23, 2025
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.
Passing the raw lumera.Client to CommonOptions.Validator may not satisfy the KeyExchangerValidator interface. You should wrap lumeraClient with lumera.NewSecureKeyExchangeValidator(lumeraClient) to provide the expected methods.
| Validator: lumeraClient, | |
| Validator: lumera.NewSecureKeyExchangeValidator(lumeraClient), |
No description provided.