jborean93 / pyspnego

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

Fix deprecation warning for Cryptography 44.0.0 or newer #87

Closed hamarituc closed 1 month ago

hamarituc commented 1 month ago

Starting with cryptography-44.0.0 the ARC4 cipher was relocated to a module for deprecated ciphers. It needs to be imported from there now.

jborean93 commented 1 month ago

Thanks for the PR, I probably would prefer to keep the older import as a fallback in case someone still running with an older cryptography version.

I’ll probably need to also figure out another way forward for the future as it looks like it’ll be removed from cryptography as well in a future release but for now let’s get it working.

Edit: I misread the changelog, it’ll still be there, the old import will be removed in the future.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.92%. Comparing base (2811a7e) to head (e51fa02).

Files Patch % Lines
src/spnego/_ntlm_raw/crypto.py 60.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #87 +/- ## ========================================== - Coverage 99.96% 99.92% -0.04% ========================================== Files 30 30 Lines 5361 5365 +4 ========================================== + Hits 5359 5361 +2 - Misses 2 4 +2 ``` | [Flag](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | Coverage Δ | | |---|---|---| | [arm64](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `?` | | | [heimdal](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `96.32% <66.66%> (-0.04%)` | :arrow_down: | | [macOS](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `94.70% <66.66%> (-0.04%)` | :arrow_down: | | [mit](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `96.45% <66.66%> (-0.04%)` | :arrow_down: | | [py3.10](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `99.88% <66.66%> (-0.04%)` | :arrow_down: | | [py3.11](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `99.88% <66.66%> (-0.04%)` | :arrow_down: | | [py3.12](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `99.88% <66.66%> (-0.04%)` | :arrow_down: | | [py3.8](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `99.88% <66.66%> (-0.04%)` | :arrow_down: | | [py3.9](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `99.92% <66.66%> (-0.04%)` | :arrow_down: | | [sspi](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `95.84% <66.66%> (-0.04%)` | :arrow_down: | | [ubuntu](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `96.51% <66.66%> (-0.04%)` | :arrow_down: | | [windows](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `95.84% <66.66%> (-0.04%)` | :arrow_down: | | [x64](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `99.92% <66.66%> (-0.04%)` | :arrow_down: | | [x86](https://app.codecov.io/gh/jborean93/pyspnego/pull/87/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean) | `95.80% <66.66%> (-0.04%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jordan+Borean#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jborean93 commented 1 month ago

Thanks for fixing this up, I pushed a small commit that cleaned up some metadata and added the old import back in as a fallback.