{Core} Bump microsoft-security-utilities-secret-masker to 1.0.0b4#30993
{Core} Bump microsoft-security-utilities-secret-masker to 1.0.0b4#30993
microsoft-security-utilities-secret-masker to 1.0.0b4#30993Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
| 'jmespath', | ||
| 'knack~=0.11.0', | ||
| 'microsoft-security-utilities-secret-masker~=1.0.0b2', | ||
| 'microsoft-security-utilities-secret-masker~=1.0.0b4', |
There was a problem hiding this comment.
Why it is not in requirements.txt?
There was a problem hiding this comment.
It's azure-cli-core's dependency, not azure-cli
There was a problem hiding this comment.
I see.
This change has no effect since ~= will select the 1.0.0b4 by default.
There was a problem hiding this comment.
Right, this PR fixes tests after sdk upgrade as well
There was a problem hiding this comment.
It's
azure-cli-core's dependency, notazure-cli
This is not accurate. requirements.txt contains requirements of both Azure CLI and Core. requirements.txt is used to have stable dependencies in MSI, ZIP, DEB, RPM packages.
If microsoft-security-utilities-secret-masker is required by Azure CLI Core, it should be included in requirements.txt too. msal is an example:
azure-cli/src/azure-cli-core/setup.py
Line 57 in 1696f9f
There was a problem hiding this comment.
I upvote adding more azure-cli-core dependencies in requirements.txt.
I have to manually add microsoft-security-utilities-secret-masker and py-deviceid to requirements.txt in: https://github.com/Azure/azure-cli-pr/pull/143#discussion_r2030667413
| from microsoft_security_utilities_secret_masker import SecretMasker, load_regex_pattern_from_json | ||
| email_address_json = { | ||
| "Pattern": r"(?<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,})", | ||
| "Pattern": r"(?P<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,})", |
There was a problem hiding this comment.
#31367 contains the detailed error.
2025-04-27T09:22:37.8357554Z if char not in "=!":
2025-04-27T09:22:37.8357740Z > raise source.error("unknown extension ?<" + char,
2025-04-27T09:22:37.8357916Z len(char) + 2)
2025-04-27T09:22:37.8358098Z E re.error: unknown extension ?<r at position 1
2025-04-27T09:22:37.8358190Z
2025-04-27T09:22:37.8358388Z /opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/re/_parser.py:769: error
I am curious if ?<r is an invalid regex, how is it not detected by the old microsoft-security-utilities-secret-masker library?
Is it because (?<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,}) is actually never used?
There was a problem hiding this comment.
old microsoft-security-utilities-secret-masker has a func replacing all ?P<refine> with ?<refine> because it was wrong in rule json file that 1ES shared. The new version removed this func as 1ES has fixed the rule patterns
There was a problem hiding this comment.
old microsoft-security-utilities-secret-masker has a func replacing all ?<refine> with ?P<refine> because it was wrong in rule json file that 1ES shared. The new version removed this func as 1ES has fixed the rule patterns
Related command
Description
Pick up regex patterns' updates from https://github.com/microsoft/security-utilities/tree/main/GeneratedRegexPatterns
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.