azdev 0.1.88__tar.gz → 0.1.89__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. {azdev-0.1.88 → azdev-0.1.89}/HISTORY.rst +5 -0
  2. {azdev-0.1.88/azdev.egg-info → azdev-0.1.89}/PKG-INFO +6 -1
  3. {azdev-0.1.88 → azdev-0.1.89}/azdev/__init__.py +1 -1
  4. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/secret.py +34 -20
  5. {azdev-0.1.88 → azdev-0.1.89}/azdev/params.py +4 -0
  6. {azdev-0.1.88 → azdev-0.1.89/azdev.egg-info}/PKG-INFO +6 -1
  7. {azdev-0.1.88 → azdev-0.1.89}/LICENSE +0 -0
  8. {azdev-0.1.88 → azdev-0.1.89}/MANIFEST.in +0 -0
  9. {azdev-0.1.88 → azdev-0.1.89}/README.md +0 -0
  10. {azdev-0.1.88 → azdev-0.1.89}/README.rst +0 -0
  11. {azdev-0.1.88 → azdev-0.1.89}/azdev/__main__.py +0 -0
  12. {azdev-0.1.88 → azdev-0.1.89}/azdev/commands.py +0 -0
  13. {azdev-0.1.88 → azdev-0.1.89}/azdev/completer.py +0 -0
  14. {azdev-0.1.88 → azdev-0.1.89}/azdev/config/__init__.py +0 -0
  15. {azdev-0.1.88 → azdev-0.1.89}/azdev/config/cli.flake8 +0 -0
  16. {azdev-0.1.88 → azdev-0.1.89}/azdev/config/cli_pylintrc +0 -0
  17. {azdev-0.1.88 → azdev-0.1.89}/azdev/config/ext.flake8 +0 -0
  18. {azdev-0.1.88 → azdev-0.1.89}/azdev/config/ext_pylintrc +0 -0
  19. {azdev-0.1.88 → azdev-0.1.89}/azdev/help.py +0 -0
  20. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/HISTORY.rst +0 -0
  21. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/README.rst +0 -0
  22. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/_client_factory.py +0 -0
  23. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/_help.py +0 -0
  24. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/_params.py +0 -0
  25. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/_validators.py +0 -0
  26. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/azext_metadata.json +0 -0
  27. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/blank__init__.py +0 -0
  28. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/commands.py +0 -0
  29. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/custom.py +0 -0
  30. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/module__init__.py +0 -0
  31. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/pkg_declare__init__.py +0 -0
  32. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/setup.cfg +0 -0
  33. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/setup.py +0 -0
  34. {azdev-0.1.88 → azdev-0.1.89}/azdev/mod_templates/test_service_scenario.py +0 -0
  35. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/__init__.py +0 -0
  36. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/breaking_change/__init__.py +0 -0
  37. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/breaking_change/markdown_template.jinja2 +0 -0
  38. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/__init__.py +0 -0
  39. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/_macros.j2 +0 -0
  40. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/cmdcov.py +0 -0
  41. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/component.css +0 -0
  42. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/component.js +0 -0
  43. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/favicon.ico +0 -0
  44. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/index.j2 +0 -0
  45. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/index2.j2 +0 -0
  46. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/cmdcov/module.j2 +0 -0
  47. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/code_gen.py +0 -0
  48. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/command_change/__init__.py +0 -0
  49. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/command_change/custom.py +0 -0
  50. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/command_change/util.py +0 -0
  51. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/constant.py +0 -0
  52. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/extensions/__init__.py +0 -0
  53. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/extensions/util.py +0 -0
  54. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/extensions/version_upgrade.py +0 -0
  55. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/help/__init__.py +0 -0
  56. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/help/refdoc/__init__.py +0 -0
  57. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/help/refdoc/conf.py +0 -0
  58. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/legal.py +0 -0
  59. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/__init__.py +0 -0
  60. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/linter.py +0 -0
  61. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/pylint_checkers/__init__.py +0 -0
  62. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/pylint_checkers/show_command.py +0 -0
  63. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rule_decorators.py +0 -0
  64. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/__init__.py +0 -0
  65. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/ci_exclusions.yml +0 -0
  66. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/command_coverage_rules.py +0 -0
  67. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/command_group_rules.py +0 -0
  68. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/command_rules.py +0 -0
  69. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/help_rules.py +0 -0
  70. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/linter_exclusions.yml +0 -0
  71. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/rules/parameter_rules.py +0 -0
  72. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/linter/util.py +0 -0
  73. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/performance.py +0 -0
  74. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/pypi.py +0 -0
  75. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/python_sdk.py +0 -0
  76. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/regex.py +0 -0
  77. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/resource.py +0 -0
  78. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/setup.py +0 -0
  79. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/statistics/__init__.py +0 -0
  80. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/statistics/util.py +0 -0
  81. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/style.py +0 -0
  82. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/testtool/__init__.py +0 -0
  83. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/testtool/incremental_strategy.py +0 -0
  84. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/testtool/profile_context.py +0 -0
  85. {azdev-0.1.88 → azdev-0.1.89}/azdev/operations/testtool/pytest_runner.py +0 -0
  86. {azdev-0.1.88 → azdev-0.1.89}/azdev/transformers.py +0 -0
  87. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/__init__.py +0 -0
  88. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/command.py +0 -0
  89. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/config.py +0 -0
  90. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/const.py +0 -0
  91. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/display.py +0 -0
  92. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/git_util.py +0 -0
  93. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/path.py +0 -0
  94. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/pypi.py +0 -0
  95. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/testing.py +0 -0
  96. {azdev-0.1.88 → azdev-0.1.89}/azdev/utilities/tools.py +0 -0
  97. {azdev-0.1.88 → azdev-0.1.89}/azdev.egg-info/SOURCES.txt +0 -0
  98. {azdev-0.1.88 → azdev-0.1.89}/azdev.egg-info/dependency_links.txt +0 -0
  99. {azdev-0.1.88 → azdev-0.1.89}/azdev.egg-info/entry_points.txt +0 -0
  100. {azdev-0.1.88 → azdev-0.1.89}/azdev.egg-info/requires.txt +0 -0
  101. {azdev-0.1.88 → azdev-0.1.89}/azdev.egg-info/top_level.txt +0 -0
  102. {azdev-0.1.88 → azdev-0.1.89}/pyproject.toml +0 -0
  103. {azdev-0.1.88 → azdev-0.1.89}/setup.cfg +0 -0
  104. {azdev-0.1.88 → azdev-0.1.89}/setup.py +0 -0
@@ -2,7 +2,12 @@
2
2
 
3
3
  Release History
4
4
  ===============
5
+ 0.1.89
6
+ ++++++
7
+ * `azdev scan/mask`: Add `--continue-on-failure` support
8
+
5
9
  0.1.88
10
+ ++++++
6
11
  * `azdev cmdcov`: Fix incorrect detection of code changes as new commands
7
12
 
8
13
  0.1.87
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azdev
3
- Version: 0.1.88
3
+ Version: 0.1.89
4
4
  Summary: Microsoft Azure CLI Developer Tools
5
5
  Home-page: https://github.com/Azure/azure-cli-dev-tools
6
6
  Author: Microsoft Corporation
@@ -148,7 +148,12 @@ License
148
148
 
149
149
  Release History
150
150
  ===============
151
+ 0.1.89
152
+ ++++++
153
+ * `azdev scan/mask`: Add `--continue-on-failure` support
154
+
151
155
  0.1.88
156
+ ++++++
152
157
  * `azdev cmdcov`: Fix incorrect detection of code changes as new commands
153
158
 
154
159
  0.1.87
@@ -4,4 +4,4 @@
4
4
  # license information.
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __VERSION__ = '0.1.88'
7
+ __VERSION__ = '0.1.89'
@@ -146,7 +146,8 @@ def _scan_secrets_for_string(data, confidence_level=None, custom_pattern=None):
146
146
  def scan_secrets(file_path=None, directory_path=None, recursive=False,
147
147
  include_pattern=None, exclude_pattern=None, data=None,
148
148
  save_scan_result=None, scan_result_path=None,
149
- confidence_level=None, custom_pattern=None):
149
+ confidence_level=None, custom_pattern=None,
150
+ continue_on_failure=None):
150
151
  _validate_data_path(file_path=file_path, directory_path=directory_path,
151
152
  include_pattern=include_pattern, exclude_pattern=exclude_pattern, data=data)
152
153
  target_files = []
@@ -165,15 +166,21 @@ def scan_secrets(file_path=None, directory_path=None, recursive=False,
165
166
  scan_results['raw_data'] = secrets
166
167
  elif target_files:
167
168
  for target_file in target_files:
168
- logger.debug('start scanning secrets for %s', target_file)
169
- with open(target_file, encoding='utf8') as f:
170
- data = f.read()
171
- if not data:
172
- continue
173
- secrets = _scan_secrets_for_string(data, confidence_level, custom_pattern)
174
- logger.debug('%d secrets found for %s', len(secrets), target_file)
175
- if secrets:
176
- scan_results[target_file] = secrets
169
+ try:
170
+ logger.debug('start scanning secrets for %s', target_file)
171
+ with open(target_file, encoding='utf8') as f:
172
+ data = f.read()
173
+ if not data:
174
+ continue
175
+ secrets = _scan_secrets_for_string(data, confidence_level, custom_pattern)
176
+ logger.debug('%d secrets found for %s', len(secrets), target_file)
177
+ if secrets:
178
+ scan_results[target_file] = secrets
179
+ except Exception as ex: # pylint: disable=broad-exception-caught
180
+ if continue_on_failure:
181
+ logger.warning("Error handling file %s, exception %s", target_file, str(ex))
182
+ else:
183
+ raise ex
177
184
 
178
185
  if scan_result_path:
179
186
  save_scan_result = True
@@ -244,7 +251,7 @@ def _mask_secret_for_string(data, secret, redaction_type=None):
244
251
  def mask_secrets(file_path=None, directory_path=None, recursive=False,
245
252
  include_pattern=None, exclude_pattern=None, data=None,
246
253
  save_scan_result=None, scan_result_path=None,
247
- confidence_level=None, custom_pattern=None,
254
+ confidence_level=None, custom_pattern=None, continue_on_failure=None,
248
255
  saved_scan_result_path=None, redaction_type='FIXED_VALUE', yes=None):
249
256
  scan_results = {}
250
257
  if saved_scan_result_path:
@@ -259,7 +266,8 @@ def mask_secrets(file_path=None, directory_path=None, recursive=False,
259
266
  scan_response = scan_secrets(file_path=file_path, directory_path=directory_path, recursive=recursive,
260
267
  include_pattern=include_pattern, exclude_pattern=exclude_pattern, data=data,
261
268
  save_scan_result=save_scan_result, scan_result_path=scan_result_path,
262
- confidence_level=confidence_level, custom_pattern=custom_pattern)
269
+ confidence_level=confidence_level, custom_pattern=custom_pattern,
270
+ continue_on_failure=continue_on_failure)
263
271
  if save_scan_result and scan_response['scan_result_path']:
264
272
  with open(scan_response['scan_result_path'], encoding='utf8') as f:
265
273
  scan_results = json.load(f)
@@ -291,13 +299,19 @@ def mask_secrets(file_path=None, directory_path=None, recursive=False,
291
299
  return mask_result
292
300
 
293
301
  for scan_file_path, secrets in scan_results.items():
294
- with open(scan_file_path, 'r', encoding='utf8') as f:
295
- content = f.read()
296
- if not content:
297
- continue
298
- for secret in secrets:
299
- content = _mask_secret_for_string(content, secret, redaction_type)
300
- with open(scan_file_path, 'w', encoding='utf8') as f:
301
- f.write(content)
302
+ try:
303
+ with open(scan_file_path, 'r', encoding='utf8') as f:
304
+ content = f.read()
305
+ if not content:
306
+ continue
307
+ for secret in secrets:
308
+ content = _mask_secret_for_string(content, secret, redaction_type)
309
+ with open(scan_file_path, 'w', encoding='utf8') as f:
310
+ f.write(content)
311
+ except Exception as ex: # pylint: disable=broad-exception-caught
312
+ if continue_on_failure:
313
+ logger.warning("Error handling file %s, exception %s", scan_file_path, str(ex))
314
+ else:
315
+ raise ex
302
316
  mask_result['mask'] = True
303
317
  return mask_result
@@ -132,6 +132,10 @@ def load_arguments(self, _):
132
132
  c.argument('custom_pattern',
133
133
  help='Additional patterns you want to apply or built-in patterns you want to exclude '
134
134
  'for scanning. Can be json string or path to the json file.')
135
+ c.argument('continue_on_failure', action='store_true',
136
+ help='If not, the operation will terminate quickly on encountering file operation errors. '
137
+ 'If true, the operation will warning the error for specific file and proceed with other files. '
138
+ 'If not set the default value is false.')
135
139
 
136
140
  with ArgumentsContext(self, 'mask') as c:
137
141
  c.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Answer "yes" to all prompts.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azdev
3
- Version: 0.1.88
3
+ Version: 0.1.89
4
4
  Summary: Microsoft Azure CLI Developer Tools
5
5
  Home-page: https://github.com/Azure/azure-cli-dev-tools
6
6
  Author: Microsoft Corporation
@@ -148,7 +148,12 @@ License
148
148
 
149
149
  Release History
150
150
  ===============
151
+ 0.1.89
152
+ ++++++
153
+ * `azdev scan/mask`: Add `--continue-on-failure` support
154
+
151
155
  0.1.88
156
+ ++++++
152
157
  * `azdev cmdcov`: Fix incorrect detection of code changes as new commands
153
158
 
154
159
  0.1.87
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes