Skip to content

Commit 0ffc0e5

Browse files
FIX: Test dummy credentials to avoid ADO secret scanner false positive (#504)
### Work Item / Issue Reference <!-- IMPORTANT: Please follow the PR template guidelines below. For mssql-python maintainers: Insert your ADO Work Item ID below For external contributors: Insert Github Issue number below Only one reference is required - either GitHub issue OR ADO Work Item. --> <!-- mssql-python maintainers: ADO Work Item --> > [AB#43894](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/43894) ------------------------------------------------------------------- ### Summary <!-- Insert your summary of changes below. Minimum 10 characters required. --> This pull request updates test credentials in the `tests/test_020_bulkcopy_auth_cleanup.py` file to use more generic and less sensitive values for the database connection and password assertions. Test credential updates: * Changed the database connection string in the `_make_cursor` call to use `Server=localhost` and `PWD=mypwd` instead of `Server=tcp:test.database.windows.net` and `PWD=password123` to avoid using production-like or sensitive values in tests. * Updated the corresponding password assertion in the `capture_context` test to match the new password value (`mypwd`). <!-- ### PR Title Guide > For feature requests FEAT: (short-description) > For non-feature requests like test case updates, config updates , dependency updates etc CHORE: (short-description) > For Fix requests FIX: (short-description) > For doc update requests DOC: (short-description) > For Formatting, indentation, or styling update STYLE: (short-description) > For Refactor, without any feature changes REFACTOR: (short-description) > For release related changes, without any feature changes RELEASE: #<RELEASE_VERSION> (short-description) ### Contribution Guidelines External contributors: - Create a GitHub issue first: https://github.com/microsoft/mssql-python/issues/new - Link the GitHub issue in the "GitHub Issue" section above - Follow the PR title format and provide a meaningful summary mssql-python maintainers: - Create an ADO Work Item following internal processes - Link the ADO Work Item in the "ADO Work Item" section above - Follow the PR title format and provide a meaningful summary --> Co-authored-by: gargsaumya <saumyagarg.100@gmail.com>
1 parent d3b2f01 commit 0ffc0e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_020_bulkcopy_auth_cleanup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_no_auth_type_leaves_fields_intact(self, mock_logger):
8080
mock_logger.is_debug_enabled = False
8181

8282
cursor = _make_cursor(
83-
"Server=tcp:test.database.windows.net;Database=testdb;" "UID=sa;PWD=password123",
83+
"Server=localhost;Database=testdb;" "UID=sa;PWD=mypwd",
8484
None, # no AD auth
8585
)
8686

@@ -107,4 +107,4 @@ def capture_context(ctx, **kwargs):
107107

108108
assert "access_token" not in captured_context
109109
assert captured_context.get("user_name") == "sa"
110-
assert captured_context.get("password") == "password123"
110+
assert captured_context.get("password") == "mypwd"

0 commit comments

Comments
 (0)