-
Notifications
You must be signed in to change notification settings - Fork 493
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: add support to display mnemonic discreetly for algokey generate
#5886
Conversation
If this pr LGTY, I will draft another prs for |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5886 +/- ##
==========================================
- Coverage 56.00% 55.66% -0.34%
==========================================
Files 478 487 +9
Lines 67561 68040 +479
==========================================
+ Hits 37835 37875 +40
- Misses 27174 27592 +418
- Partials 2552 2573 +21 ☔ View full report in Codecov by Sentry. |
@jasonpaulos @onetechnical Hi sir, could you please help me review this pr, thanks🙏 |
User deleted their account. |
Are you kidding? I'm just take this "ghost" nickname for funny. Github deleted user's profile is github.com/ghost |
@Halimao our mistake, we looked quick and thought you had deleted the account. If we understand this PR correctly, the mnemonic is still displayed when you first run it - so people watching over you could see it. An alternative to this code change to could be to hit ^L on your keyboard in the terminal to hide the mnemonic right? |
I'm afraid I can't agree with this. In some cases, This pr is indeed not suitable in the case that someone is watching over you. If we wanna prevent displaying private information when someone is watching over us, there are still more things that need to be done first IMO. This pr aims to split the |
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 don't like this change in behaviour. But if we we did want it, is there something wrong with this:
package main
import (
"github.com/inancgumus/screen"
)
func main() {
// Clears the screen
screen.Clear()
}
Do we have any way to know which terminals this solution works in vs another solution? Do we have any way to know if it stops working in some subset of the million terminal emulators on million OSes?
Why should we clear the whole screen? I just wanna clear the secret information on the terminal.
If we are concerned about the compatibility with all Oses, we could make |
This was in my initial comment, I would make the setting --discrete defaulting to false (so that true is enabling the hiding functionality). Definitely did not want to change default behavior for folks under them. |
Aha, sorry for missing this comment. I just updated |
Hi @Halimao, do you mind rebasing off of master? Our license check is failing I think because we updated them all to 2024 after January 1. |
There are also some linter warnings from reviewdog related to expected test structure:
|
@Halimao can you update the license header in |
@Halimao I just checked this out manually and tested it: The default Side note: had to refresh myself on discrete vs discreet usage :) |
Addressed~ |
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.
Thanks for making the changes, looks good.
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.
Seems useful, and I confirmed locally that it works as intended
Summary
This PR add support for displaying mnemonic discreetly.
generateIndiscreet
, used to disable new feature and printing mnemonic as old way.algokey generate
incmd/algokey
.Test Plan
Test_printDiscreetly
for new functionprintDiscreetly
algokey
binary and test in local machine