FIX: Access Token Issue (EntraID Auth)#285
Merged
bewithgaurav merged 3 commits intomainfrom Oct 14, 2025
Merged
Conversation
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changes
Summary
mssql_python/pybind/connection/connection.cppLines 172-180 172 SQLRETURN Connection::setAttribute(SQLINTEGER attribute, py::object value) {
173 LOG("Setting SQL attribute");
174 SQLPOINTER ptr = nullptr;
175 SQLINTEGER length = 0;
! 176 static std::string buffer; // to hold sensitive data temporarily
177
178 if (py::isinstance<py::int_>(value)) {
179 int intValue = value.cast<int>();
180 ptr = reinterpret_cast<SQLPOINTER>(static_cast<uintptr_t>(intValue));📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.connection.connection.cpp: 68.3%
mssql_python.ddbc_bindings.py: 68.5%
mssql_python.pybind.ddbc_bindings.cpp: 69.3%
mssql_python.pybind.connection.connection_pool.cpp: 78.9%
mssql_python.cursor.py: 79.7%
mssql_python.connection.py: 81.7%
mssql_python.helpers.py: 84.7%
mssql_python.auth.py: 85.3%
mssql_python.type.py: 86.8%
mssql_python.pooling.py: 87.5%🔗 Quick Links
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reintroduces a static buffer as a temporary hotfix for an access token issue, addressing GitHub Issue #286. The change modifies how sensitive data is stored temporarily during SQL attribute setting.
- Converts a local string buffer to a static buffer for holding sensitive data
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
gargsaumya
requested changes
Oct 14, 2025
gargsaumya
approved these changes
Oct 14, 2025
sumitmsft
approved these changes
Oct 14, 2025
gargsaumya
pushed a commit
that referenced
this pull request
Nov 3, 2025
### Work Item / Issue Reference <!-- IMPORTANT: Please follow the PR template guidelines below. For mssql-python maintainers: Insert your ADO Work Item ID below (e.g. AB#37452) For external contributors: Insert Github Issue number below (e.g. #149) Only one reference is required - either GitHub issue OR ADO Work Item. --> <!-- mssql-python maintainers: ADO Work Item --> > AB#<WORK_ITEM_ID> <!-- External contributors: GitHub Issue --> > GitHub Issue: #286 ------------------------------------------------------------------- ### Summary <!-- Insert your summary of changes below. Minimum 10 characters required. --> Reintroduce Static Buffer as a temporary hotfix, will keep a new task to remove static tokens. <!-- ### 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 -->
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.
Work Item / Issue Reference
Summary
Reintroduce Static Buffer as a temporary hotfix, will keep a new task to remove static tokens.