Skip to content
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(hubl): integrate client/v2 signing #17960

Merged
merged 12 commits into from
Nov 8, 2023
Merged

feat(hubl): integrate client/v2 signing #17960

merged 12 commits into from
Nov 8, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Oct 4, 2023

Description

Blocked on #17913


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • New Feature: Enhanced security measures have been implemented with the introduction of a new keyring management system. This system securely stores and manages sensitive information, improving the overall security of the application.
  • Refactor: The internal structure of the application has been updated to utilize this new keyring system, ensuring a seamless transition and compatibility with existing features. This change is not directly visible to users but contributes to the robustness and reliability of the application.

@julienrbrt julienrbrt added the S:blocked Status: Blocked label Oct 4, 2023
@github-actions github-actions bot added the C:Hubl Tool: Hubl label Oct 4, 2023
Base automatically changed from julien/autocli-from to main October 5, 2023 11:06
@julienrbrt julienrbrt removed the S:blocked Status: Blocked label Oct 5, 2023
@julienrbrt julienrbrt marked this pull request as ready for review October 5, 2023 11:14
@julienrbrt julienrbrt requested a review from a team as a code owner October 5, 2023 11:14
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

@julienrbrt your pull request is missing a changelog!

@julienrbrt
Copy link
Member Author

Haven't tested this against v0.50 nodes.

I'm going to finish this first to be able to: julienrbrt/simapp#29

Unless someone knows other remote nodes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 26, 2023

Walkthrough

This change introduces a new function for keyring management and updates the existing one. It also adds keyring support to the client context and the Builder struct in the remote file. The keyring package from Cosmos SDK is now being used.

Changes

File Summary
tools/hubl/internal/keyring.go Introduced a new function getKeyring for keyring management and updated the existing KeyringCmd function.
tools/hubl/internal/remote.go Added keyring support to the client context and the Builder struct. Imported the "github.com/cosmos/cosmos-sdk/crypto/keyring" package.

🐇

In the land of code, where logic intertwines,

A keyring change, like a vine it climbs.

With Cosmos SDK, we now align,

For secure keys, in the stars they shine. 🌟


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 86eaeed and e45c14b.
Files ignored due to filter (2)
  • tools/hubl/go.mod
  • tools/hubl/go.sum
Files selected for processing (2)
  • tools/hubl/internal/keyring.go (2} hunks)
  • tools/hubl/internal/remote.go (2} hunks)
Additional comments: 7
tools/hubl/internal/keyring.go (2)
  • 25-51: The new function getKeyring is introduced to create and return a sdkkeyring.Keyring instance. It takes a chainName as an argument and uses it to determine the keyring backend and directory. If chainName is empty, it defaults to the global keyring directory. The function also registers interfaces and initializes the codec. This function is a good example of modularity and separation of concerns, as it encapsulates the logic for creating a keyring instance. However, it's important to ensure that error handling is done properly in the upstream code where this function is called.

  • 94-97: The KeyringCmd function is updated to use sdkkeyring.New instead of keyring.New to create a keyring instance. This change is consistent with the introduction of the getKeyring function and the shift towards using sdkkeyring.Keyring. Ensure that this change doesn't break any existing functionality that relies on the KeyringCmd function.

tools/hubl/internal/remote.go (5)
  • 21-21: The import of the "github.com/cosmos/cosmos-sdk/crypto/keyring" package is a new addition. Ensure that this package is used in the code and that it is compatible with the existing codebase.

  • 70-78: The getKeyring function is being called to get a keyring for the chain. Ensure that error handling for this function is done correctly and that the keyring is used appropriately in the rest of the code.

  • 75-78: The keyring.NewAutoCLIKeyring function is being called to create an auto CLI keyring. Ensure that error handling for this function is done correctly and that the auto CLI keyring is used appropriately in the rest of the code.

  • 80-84: The clientCtx is being updated with the WithKeyring method call. This is a new addition and should be verified to ensure that it is compatible with the existing codebase and that it does not introduce any breaking changes.

  • 86-98: The Keyring field is being added to the Builder struct. This is a new addition and should be verified to ensure that it is compatible with the existing codebase and that it does not introduce any breaking changes.

@julienrbrt julienrbrt added the S: DO NOT MERGE Status: DO NOT MERGE label Oct 26, 2023
@julienrbrt
Copy link
Member Author

julienrbrt commented Oct 26, 2023

Leaving dnm. Still haven't had time to test against a v0.50 node and it should use latest client/v2 as there is fixes there since since PR.

I will do that soonish.

@julienrbrt julienrbrt removed the S: DO NOT MERGE Status: DO NOT MERGE label Nov 8, 2023
@github-actions github-actions bot added the C:Cosmovisor Issues and PR related to Cosmovisor label Nov 8, 2023
@julienrbrt julienrbrt added this pull request to the merge queue Nov 8, 2023
Merged via the queue into main with commit 0af8111 Nov 8, 2023
58 of 60 checks passed
@julienrbrt julienrbrt deleted the julien/hubl-signing branch November 8, 2023 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Cosmovisor Issues and PR related to Cosmovisor C:Hubl Tool: Hubl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants