Skip to content

Conversation

twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Jul 23, 2025

Since the main PR to make this public is held up for some security
reviews, this finishes up the internal changes required, but leaves
making anything public until after that is done. This minimizes any
potential merge conflicts if that review ends up taking longer.

Part of #2253

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 21:40
@twsouthwick twsouthwick requested a review from a team as a code owner July 23, 2025 21:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates SSPI (Security Support Provider Interface) context provider functionality throughout the SqlConnection infrastructure, allowing custom SSPI implementations to be plumbed through the connection system. The changes enable dependency injection of custom SSPI context providers while maintaining backward compatibility with existing authentication mechanisms.

Key changes include:

  • Addition of SspiContextProvider property to SqlConnection for custom SSPI implementations
  • Integration of SSPI context providers into connection pooling and factory mechanisms
  • Refactoring of SSPI method names and visibility modifiers for better API design

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
IntegratedAuthenticationTest.cs Adds test coverage for custom SSPI context provider functionality
SqlConnectionFactory.cs Updates connection creation to pass SSPI context provider parameter
SspiContextProvider.cs Refactors method names and adds protected constructor
NegotiateSspiContextProvider.cs Updates to use renamed GenerateContext method
NativeSspiContextProvider.cs Updates to use renamed GenerateContext method and improves comparison logic
SqlConnectionPoolKey.cs Extends pool key to include SSPI context provider for proper connection pooling
TdsParser.cs (both netfx/netcore) Integrates custom SSPI context provider selection logic
SqlInternalConnectionTds.cs (both netfx/netcore) Adds SSPI context provider parameter to internal connection constructor
SqlConnection.cs (both netfx/netcore) Adds SspiContextProvider property and updates all pool key instantiations

Copy link

codecov bot commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base (aaba34f) to head (830f5f8).
Report is 7 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3511       +/-   ##
===========================================
+ Coverage   64.78%   90.82%   +26.04%     
===========================================
  Files         276        6      -270     
  Lines       62192      316    -61876     
===========================================
- Hits        40289      287    -40002     
+ Misses      21903       29    -21874     
Flag Coverage Δ
addons 90.82% <ø> (-0.23%) ⬇️
netcore ?
netfx ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski paulmedynski merged commit 66c097a into main Jul 24, 2025
251 checks passed
@paulmedynski paulmedynski deleted the plumb-sspi branch July 24, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants