-
Notifications
You must be signed in to change notification settings - Fork 387
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: simplify the import / export API for the Keybase
#3285
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Two small details, but apart from that, looks good to me 👍
As someone using this package, I prefer this new API. But I would like to summon a few people:
|
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):No automated checks match this pull request. ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
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.
The SDK equivalent Keyring
struct exposes a similar API to the actual Keybase
of this repo (see 1 2 3) (before this PR), without the method that returns the unencrypted private key (namely ExportPrivateKeyObject()
). This method is not part of the public interface, so it's a bit harder to call (example from the CLI export command: 4).
However, I see no reason why the API couldn't be simplified. Methods like Export/ImportPubkey()
are not used anywhere in the SDK, yet they have been around for years.
Now about the "obfuscation" of unsafe ExportPrivateKeyObject()
, the current change makes a clear difference with the SDK keyring, which only exposes safe methods, while here only the unsafe method is exposed. That said, since ExportPrivateKeyObject()
was already part of the public API, this may not really matter.
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.
I spent about an hour reviewing, and this all looks good to me to improving the interface and code clarity.
## Description This PR greatly simplifies the `Keybase` interface in regards to key imports / exports, by removing redundant methods. The goal of the PR is to put the application-level key armor management outside the keybase (not including storage), towards the caller. In fact, this is the reason why the `Keybase` has a chaotic API for imports / exports. I've preserved existing `gnokey` functionality -- this is unchanged. I will update `gnokey` imports / exports in a separate PR, to make the flag usage make more sense. **BREAKING CHANGE:** - Removed 9 `Keybase` methods, and added 2 new ones (that replace them) cc @jefft0 <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests </details>
Description
This PR greatly simplifies the
Keybase
interface in regards to key imports / exports, by removing redundant methods.The goal of the PR is to put the application-level key armor management outside the keybase (not including storage), towards the caller. In fact, this is the reason why the
Keybase
has a chaotic API for imports / exports.I've preserved existing
gnokey
functionality -- this is unchanged.I will update
gnokey
imports / exports in a separate PR, to make the flag usage make more sense.BREAKING CHANGE:
Keybase
methods, and added 2 new ones (that replace them)cc @jefft0
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description