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

fix: Keyring output #2784

Merged
merged 5 commits into from
Jun 27, 2024
Merged

fix: Keyring output #2784

merged 5 commits into from
Jun 27, 2024

Conversation

nasdf
Copy link
Member

@nasdf nasdf commented Jun 26, 2024

Relevant issue(s)

Resolves #2759
Resolves #2758
Resolves #2757

Description

This PR adds more logs to the keyring to improve the user experience.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

  • unit test

Specify the platform(s) on which this was tested:

  • MacOS

@nasdf nasdf added the area/cli Related to the CLI binary label Jun 26, 2024
@nasdf nasdf self-assigned this Jun 26, 2024
@nasdf nasdf added this to the DefraDB v0.12 milestone Jun 26, 2024
@nasdf nasdf requested a review from a team June 26, 2024 17:02
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 78.75%. Comparing base (c6c2373) to head (fbd13c8).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2784      +/-   ##
===========================================
- Coverage    78.83%   78.75%   -0.08%     
===========================================
  Files          315      315              
  Lines        23810    23835      +25     
===========================================
+ Hits         18769    18770       +1     
- Misses        3668     3682      +14     
- Partials      1373     1383      +10     
Flag Coverage Δ
all-tests 78.75% <80.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
cli/keyring.go 100.00% <100.00%> (ø)
cli/utils.go 71.26% <25.00%> (-1.35%) ⬇️
cli/keyring_generate.go 77.27% <80.00%> (+2.27%) ⬆️

... and 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6c2373...fbd13c8. Read the comment docs.

Copy link
Contributor

@islamaliev islamaliev left a comment

Choose a reason for hiding this comment

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

LGTM!

var cmd = &cobra.Command{
Use: "generate",
Short: "Generate private keys",
Long: `Generate private keys.
Randomly generate and store private keys in the keyring.
By default peer and encryption keys will be generated.
Copy link
Contributor

Choose a reason for hiding this comment

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

though: I wonder if we need to be more clear every time we mention encryption keys as there are different types of them for different context: encryption-at-rest, doc encryption, some ACP-related and so on. They grow like mushrooms these days.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is well worth being very clear here - this is a destructive operation (information is overwritten), and the keys are accessible to users via the export command. I have a preference for us to list each key with it's keyring name, and a short description as to what it does.

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a readme section dedicated to this already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we link to it from the cli? It is very handy if the CLI is self-explanatory, I find it annoying when I have to search for CLI documentation instead of just using --help

Copy link
Member Author

Choose a reason for hiding this comment

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

I've copied the key management section into the help for the base keyring command.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Keenan :)

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LGTM but I agree that documentation should be linked in user facing cli documentation(help).

Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Keenan :)

@nasdf nasdf merged commit 2efd29a into sourcenetwork:develop Jun 27, 2024
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to the CLI binary
Projects
None yet
4 participants