denisenkom / pytds

Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation
MIT License
190 stars 52 forks source link

feat: Allow NtlmAuth to use NTLMv2 #152

Closed mariusdkm closed 1 year ago

mariusdkm commented 1 year ago

This PR simplifies NtlmAuth to use the already supplied NtlmContext. Doing this allows the use of NTLMv2.

I tried to implement NTLMv2 using the flags like before but didn't succeed. And since somebody in the library ntlm-auth already did the hard work of figuring out what flags to set for the different NTLM versions, why not use what is already there instead of doing the hard work.

If I should add tests, I'm happy to do that, just tell me what tests you want or want updated.

codecov[bot] commented 1 year ago

Codecov Report

Merging #152 (50bfa69) into master (e697481) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
- Coverage   91.75%   91.75%   -0.01%     
==========================================
  Files          28       28              
  Lines        7763     7759       -4     
==========================================
- Hits         7123     7119       -4     
  Misses        640      640              
Impacted Files Coverage Δ
src/pytds/login.py 60.43% <100.00%> (-1.67%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

denisenkom commented 1 year ago

NTLM is already covered by existing tests so no need to add more. Thank you for this PR!