-
Notifications
You must be signed in to change notification settings - Fork 1
Generate command added #85
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
Conversation
keepercli-package/src/keepercli/commands/password_generate.py
Dismissed
Show dismissed
Hide dismissed
keepercli-package/src/keepercli/commands/password_generate.py
Dismissed
Show dismissed
Hide dismissed
| try: | ||
| import pyperclip | ||
| CLIPBOARD_AVAILABLE = True | ||
| except ImportError: |
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.
Remove try except while importing
|
|
||
| def execute(self, context: KeeperParams, **kwargs) -> Any: | ||
| """Execute the password generation command.""" | ||
| try: |
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.
add context and vault verification to ensure user is logged in, refer other command execution method
|
|
||
| if not request.enable_breach_scan: | ||
| logger.debug("BreachWatch scanning disabled by user") | ||
| elif context.vault and context.vault.breach_watch_plugin(): |
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.
dont check context.vault here, that would be the first step in execute method
Don't pass context to this method, only pass vault
| breach_watch = breach_watch_plugin.breach_watch | ||
| logger.debug("Using BreachWatch for password scanning") | ||
| else: | ||
| logger.debug("BreachWatch not available (vault not initialized or feature not enabled)") |
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.
change this mesaage to breachwatch plugin not available, enable it to use and make it logger.warning
| @@ -0,0 +1,4 @@ | |||
| Strength(%) BreachWatch Password | |||
| 1 100 Skipped helmet prosper artefact paddle style cannon slow left original logic hawk loyal middle sugar enable carbon asset hood patient apple ability seminar fold family | |||
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.
What is the purpose of this file
adeshmukh-ks
left a comment
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.
In all examples, remove arguments from the CLI and add hardcoded variables which can be forwarded to the functions instead, this makes it easier to change for user
Implemented the 'generate' command, which generates random passwords according to user-defined parameters for password length, complexity, and composition.