Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use string for SNI instead of byte[] #2790

Merged
merged 12 commits into from
Mar 3, 2025
Merged

Conversation

twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Aug 19, 2024

This change replaces byte[] usage for SNI values to be string. There was a lot of decoding done in different areas and with this it becomes clearer that the value is a server name. The only place that actually needs the byte[] representation is the native sni - so it makes it easier to keep it as a string as much as possible.

Part of #2253

@twsouthwick twsouthwick marked this pull request as ready for review February 26, 2025 22:20
@twsouthwick
Copy link
Member Author

@mdaigle here's the next step on the SSPI change

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 84.34783% with 18 lines in your changes missing coverage. Please review.

Project coverage is 66.20%. Comparing base (dcf6ac4) to head (c6c95c2).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...Client/src/Interop/Windows/Sni/SniNativeWrapper.cs 70.96% 9 Missing ⚠️
...nt/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs 50.00% 6 Missing ⚠️
...tcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs 75.00% 1 Missing ⚠️
.../netcore/src/Microsoft/Data/SqlClient/TdsParser.cs 80.00% 1 Missing ⚠️
...qlClient/src/Microsoft/Data/SqlClient/TdsParser.cs 97.50% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (dcf6ac4) and HEAD (c6c95c2). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (dcf6ac4) HEAD (c6c95c2)
addons 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2790      +/-   ##
==========================================
- Coverage   72.79%   66.20%   -6.60%     
==========================================
  Files         283      281       -2     
  Lines       59139    58847     -292     
==========================================
- Hits        43051    38960    -4091     
- Misses      16088    19887    +3799     
Flag Coverage Δ
addons ?
netcore 69.17% <86.02%> (-6.36%) ⬇️
netfx 64.87% <83.83%> (-6.28%) ⬇️

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.

@mdaigle mdaigle requested a review from a team February 26, 2025 22:49
Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

I'm not familiar with this area of the code, so I reviewed for consistency and side-effects mainly.

Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the naming and init comments. Just a couple more try-finally tweaks, and this will be good to go!

@paulmedynski
Copy link
Contributor

Looks good, and definitely simplifies the internal APIs, reducing cognitive load.

@paulmedynski paulmedynski requested a review from a team February 27, 2025 18:31
Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

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

I have one issue that I'd like addressed, then just a couple nits for naming consistency.

twsouthwick and others added 7 commits February 27, 2025 14:18
…ent/TdsParserStateObjectNative.cs

Co-authored-by: Malcolm Daigle <[email protected]>
…ent/TdsParserStateObject.netcore.cs

Co-authored-by: Malcolm Daigle <[email protected]>
…ent/TdsParserStateObjectManaged.cs

Co-authored-by: Malcolm Daigle <[email protected]>
…/NativeSSPIContextProvider.cs

Co-authored-by: Malcolm Daigle <[email protected]>
…/SSPIContextProvider.cs

Co-authored-by: Malcolm Daigle <[email protected]>
…/SSPIContextProvider.cs

Co-authored-by: Malcolm Daigle <[email protected]>
@twsouthwick twsouthwick requested a review from mdaigle February 27, 2025 22:28
@mdaigle
Copy link
Contributor

mdaigle commented Feb 27, 2025

Looks good. Will make sure the CI passes, then merge.

@twsouthwick
Copy link
Member Author

(FYI there's an auto merge option you can enable in the settings to do so when all conditions are met)

@mdaigle mdaigle merged commit 9450fde into dotnet:main Mar 3, 2025
123 checks passed
@twsouthwick twsouthwick deleted the string-sni branch March 3, 2025 19:19
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