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: In the gnokey CLI, add command to update the password #2700

Merged
merged 8 commits into from
Oct 16, 2024

Conversation

jefft0
Copy link
Contributor

@jefft0 jefft0 commented Aug 14, 2024

The Keybase API supports a method to change the password of a key. It is currently called Update which is confusing. This PR renames the API function to Rotate and adds the "rotate" command to the gnokey CLI.

BREAKING CHANGE: The Keybase API function Update is renamed to Rotate. (Note: I haven't seen code using this function, so it should be minimal impact.)

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description

@jefft0 jefft0 requested review from jaekwon, moul, gfanton and a team as code owners August 14, 2024 14:52
@github-actions github-actions bot added 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 60.97%. Comparing base (8a62a28) to head (ec359a7).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
tm2/pkg/crypto/keys/client/rotate.go 76.92% 5 Missing and 4 partials ⚠️
tm2/pkg/crypto/keys/lazy_keybase.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2700      +/-   ##
==========================================
+ Coverage   60.95%   60.97%   +0.02%     
==========================================
  Files         564      565       +1     
  Lines       75273    75314      +41     
==========================================
+ Hits        45884    45926      +42     
+ Misses      26019    26015       -4     
- Partials     3370     3373       +3     
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
gno.land 67.93% <100.00%> (+<0.01%) ⬆️
gnovm 65.77% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 20.23% <ø> (+0.35%) ⬆️
tm2 62.10% <74.41%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@gfanton gfanton left a comment

Choose a reason for hiding this comment

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

LGTM

In the meantime, do we really need this command? You can simply export and re-import the key and set a new password. It's not like you will update your password every day.
On the other hand, this command doesn't seem to cause any harm, so I suppose it's fine to have it.

tm2/pkg/crypto/keys/client/update.go Outdated Show resolved Hide resolved
gno.land/pkg/keyscli/root.go Outdated Show resolved Hide resolved
tm2/pkg/crypto/keys/client/update.go Outdated Show resolved Hide resolved
@Kouteki Kouteki added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Oct 3, 2024
@jefft0 jefft0 added review/triage-pending PRs opened by external contributors that are waiting for the 1st review and removed review/triage-pending PRs opened by external contributors that are waiting for the 1st review labels Oct 4, 2024
@Kouteki Kouteki removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Oct 4, 2024
Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

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

LGTM for the docs

@thehowl thehowl merged commit 641d2fd into gnolang:master Oct 16, 2024
122 checks passed
jefft0 added a commit to gnolang/gnonative that referenced this pull request Oct 17, 2024
In PR gnolang/gno#2700, the keybase API method
`Update` is renamed to `Rotate` because "Update" is too general. (This
method only changes the password.) We want Gno Native Kit to closely
follow the core APIs, so this PR renames `UpdatePassword` to
`RotatePassword`.

* In go.mod, use the latest gnolang/gno .
* In the API, rename UpdatePassword to RotatePassword. Run `make
regenerate` .
* Push to buf the latest API and update expo dependencies.

---------

Signed-off-by: Jeff Thompson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants