jborean93 / pyspnego

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

Add new_context() option to copy a context #58

Closed jborean93 closed 1 year ago

jborean93 commented 1 year ago

Adds the new_context() function that will create a new context based on the existing contexts credentials and options. This is designed to be a more efficient way to recreate a brand new security context. For example it can recreate the context with a cached provider specific credential rather than retrieving a new one for each context. This is important when using Kerberos authentication as the retrieved TGT can be cached and reused across multiple contexts.

codecov[bot] commented 1 year ago

Codecov Report

Merging #58 (0fafcf4) into main (5644e1a) will decrease coverage by 0.77%. The diff coverage is 89.23%.

:exclamation: Current head 0fafcf4 differs from pull request most recent head 603d91e. Consider uploading reports for the commit 603d91e to get more accurate results

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   99.94%   99.17%   -0.78%     
==========================================
  Files          31       31              
  Lines        5274     5303      +29     
==========================================
- Hits         5271     5259      -12     
- Misses          3       44      +41     
Flag Coverage Δ
99.17% <89.23%> (-0.78%) :arrow_down:
py3.10 99.17% <89.23%> (-0.78%) :arrow_down:
py3.11 99.17% <89.23%> (-0.78%) :arrow_down:
py3.7 99.16% <89.23%> (-0.78%) :arrow_down:
py3.8 99.16% <89.23%> (-0.78%) :arrow_down:
py3.9 99.16% <89.23%> (-0.78%) :arrow_down:
x64 99.17% <89.23%> (-0.78%) :arrow_down:
x86 94.43% <75.38%> (-0.79%) :arrow_down:

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

Impacted Files Coverage Δ
src/spnego/_credssp.py 99.67% <50.00%> (-0.33%) :arrow_down:
src/spnego/_ntlm.py 97.02% <55.55%> (-2.98%) :arrow_down:
src/spnego/_sspi.py 92.60% <90.00%> (-7.40%) :arrow_down:
src/spnego/_negotiate.py 95.27% <96.66%> (-4.73%) :arrow_down:
src/spnego/_context.py 100.00% <100.00%> (ø)
src/spnego/_gss.py 99.05% <100.00%> (-0.63%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.