jborean93 / pyspnego

Python SPNEGO authentication library
MIT License
52 stars 11 forks source link

Do not lowercase GSSAPI service #27

Closed jborean93 closed 3 years ago

jborean93 commented 3 years ago

When testing out pyspnego for requests-kerberos I found that the keytab being created was for an upper case HTTP and this library always converted the service to lowercase causing a failure trying to find the service in the KDC. This removes the lower() function for GSSAPI and relies on the caller to provide the correct SPN value.

codecov[bot] commented 3 years ago

Codecov Report

Merging #27 (dff49a4) into main (31e38c8) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #27   +/-   ##
=======================================
  Coverage   99.92%   99.92%           
=======================================
  Files          28       28           
  Lines        3950     3950           
=======================================
  Hits         3947     3947           
  Misses          3        3           
Flag Coverage Δ
macOS 94.55% <100.00%> (ø)
py3.10 99.87% <100.00%> (ø)
py3.6 99.92% <100.00%> (ø)
py3.7 99.87% <100.00%> (ø)
py3.8 99.87% <100.00%> (ø)
py3.9 99.87% <100.00%> (ø)
ubuntu 96.74% <100.00%> (ø)
windows 94.81% <66.66%> (ø)
x64 99.92% <100.00%> (ø)
x86 94.78% <66.66%> (ø)

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

Impacted Files Coverage Δ
src/spnego/_context.py 100.00% <100.00%> (ø)
src/spnego/_gss.py 99.61% <100.00%> (ø)
src/spnego/_version.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 31e38c8...dff49a4. Read the comment docs.

jborean93 commented 3 years ago

I need to investigate how Windows/SSPI deals with different cases for the SPN for when it talks to a Windows domain or a Linux domain. Currently it's using the upper case for {SERVICE}/{hostname} where service is the upper case but that may not be ideal.

jborean93 commented 3 years ago

After testing the same logic should apply to SSPI as well. The code will no longer upper case the service portion of the SPN for SSPI.