Added Password Prompt to operate with echo off in terminal#265
Merged
sundarshankar89 merged 3 commits intomainfrom Sep 8, 2025
Merged
Added Password Prompt to operate with echo off in terminal#265sundarshankar89 merged 3 commits intomainfrom
sundarshankar89 merged 3 commits intomainfrom
Conversation
|
✅ 40/40 passed, 2 skipped, 1m47s total Running from acceptance #348 |
asnare
requested changes
Sep 3, 2025
Contributor
asnare
left a comment
There was a problem hiding this comment.
Looks mostly fine, albeit some small things to look at.
src/databricks/labs/blueprint/tui.py
Outdated
| attempt = 0 | ||
| while attempt < max_attempts: | ||
| attempt += 1 | ||
| passwd = getpass.getpass(f"\033[1m{text}\033[0m: ") |
Contributor
There was a problem hiding this comment.
Also, not a fan of embedding these ANSI sequences directly everywhere… they're hard to read. It's the convention for this file but I think what we having in the logging module is much more sensible.
asnare
approved these changes
Sep 4, 2025
sundarshankar89
added a commit
that referenced
this pull request
Oct 6, 2025
* Added Password Prompt to operate with echo off in terminal ([#265](#265)). The command-line interface now includes a secure password prompt feature, allowing users to enter sensitive information without it being visible on the screen. This is achieved through a new method that utilizes the `getpass` library to hide user input when entering passwords, taking a prompt message and an optional maximum number of attempts as parameters. The method repeatedly prompts the user for a password until a valid input is provided or the maximum number of attempts is reached, at which point it raises a `ValueError`. This addition enhances the security and usability of the interface, and its functionality is validated through new test methods that cover both successful password entry and the scenario where the maximum number of attempts is exceeded, ensuring the feature behaves as expected in various situations. * Sniff encoding properly in XML files with a standalone directive ([#256](#256)). The XML file encoding detection has been improved to support a wider range of valid XML declarations. The regular expression used to match XML declarations has been updated to correctly handle cases where both `encoding` and `standalone` attributes are present, such as `<?xml version="1.x" encoding="xxx" standalone="yes"?>`. This change enables more accurate detection of the encoding attribute in XML files, even when a `standalone` directive is present. Additionally, test functions have been added and modified to verify this functionality, including tests for XML files with a BOM prefix and those with an XML standalone declaration, ensuring that the code can correctly read these files and detect the encoding.
Merged
sundarshankar89
added a commit
that referenced
this pull request
Oct 6, 2025
* Added Password Prompt to operate with echo off in terminal ([#265](#265)). The command-line interface now includes a secure password prompt feature, allowing users to enter sensitive information without it being visible on the screen. This is achieved through a new method that utilizes the `getpass` library to hide user input when entering passwords, taking a prompt message and an optional maximum number of attempts as parameters. The method repeatedly prompts the user for a password until a valid input is provided or the maximum number of attempts is reached, at which point it raises a `ValueError`. This addition enhances the security and usability of the interface, and its functionality is validated through new test methods that cover both successful password entry and the scenario where the maximum number of attempts is exceeded, ensuring the feature behaves as expected in various situations. * Sniff encoding properly in XML files with a standalone directive ([#256](#256)). The XML file encoding detection has been improved to support a wider range of valid XML declarations. The regular expression used to match XML declarations has been updated to correctly handle cases where both `encoding` and `standalone` attributes are present, such as `<?xml version="1.x" encoding="xxx" standalone="yes"?>`. This change enables more accurate detection of the encoding attribute in XML files, even when a `standalone` directive is present. Additionally, test functions have been added and modified to verify this functionality, including tests for XML files with a BOM prefix and those with an XML standalone declaration, ensuring that the code can correctly read these files and detect the encoding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?