[Bug] Outdated cryptography version ceiling prevents upgrading to v51

Offen Anfängerfreundlich
#997 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@Roshithapendela arbeitet bereits daran.

Seit 03.12.2026.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
75/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Lies die Abhängigkeitsdeklaration in setup.cfg und den Test zur Obergrenzenrichtlinie in tests/test_cryptography.py. Prüfe, wie dieser Test die erwartete N+3-Grenze bestimmt, und führe ihn zusammen mit den Kompatibilitätstests zur Zertifikatsverarbeitung aus. Das Ziel ist erreicht, wenn die deklarierte Obergrenze der Richtlinie entspricht und die Kompatibilitätstests mit der vorgeschlagenen cryptography-Version bestehen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

needs attention untriaged

Describe the bug

MSAL Python v1.39.0 currently declares the following dependency constraint in setup.cfg:

cryptography>=2.5,<51

With the release of cryptography v51.0.0, this upper bound prevents downstream applications from upgrading to the latest major version.

The same constraint is currently present on the dev branch.

According to the compatibility policy documented in setup.cfg and the corresponding test in tests/test_cryptography.py, the upper bound is intended to follow an N+3 strategy, where N is the latest major version of cryptography.

With v51.0.0 available, the expected upper bound under this policy would be <54, subject to compatibility validation.

To Reproduce

This is a dependency resolution issue rather than a runtime authentication issue, so no authentication sample, credentials, or Azure configuration should be necessary.

The conflict can be reproduced independently of Azure Identity or any downstream application using uv:

uv pip install --dry-run --python 3.14 "msal==1.39.0" "cryptography==51.0.0"

Alternatively, using pip in a Python 3.14 environment:

python -m pip install --dry-run "msal==1.39.0" "cryptography==51.0.0"

Expected behavior

MSAL should support installing alongside cryptography v51.0.0, provided its existing compatibility tests pass.

In accordance with MSAL's documented N+3 policy, the dependency constraint would be updated from:

cryptography>=2.5,<51

To:

cryptography>=2.5,<54

What you see instead

Dependency resolution fails because MSAL v1.39.0 requires cryptography>=2.5,<51, which excludes cryptography v51.0.0.

error: No solution found when resolving dependencies
  cause: Because msal>=1.39.0 depends on cryptography>=2.5,<51 and you require msal==1.39.0, we can conclude that you require cryptography>=2.5,<51.
         And because you require cryptography==51.0.0, we can conclude that your requirements are unsatisfiable.

This also affects downstream consumers of MSAL through packages such as azure-identity, even though Azure Identity itself does not declare an upper bound on cryptography.

The MSAL Python version you are using

  • MSAL: 1.39.0
  • Azure Identity: 1.27.1
  • Current cryptography: 50.0.2
  • Target cryptography: 51.0.0
  • Python: 3.14
  • Dependency manager: uv

Additional context

This appears to be a recurrence of #914, which addressed the previous version ceiling increase from <50 to <51.

The current upper bound also appears to have fallen behind the N+3 policy before the release of v51:

Cryptography major version Expected upper bound
48 <51
49 <52
50 <53
51 <54

The repository already contains a test named test_ceiling_should_be_latest_cryptography_version_plus_three, which detects discrepancies between the current dependency ceiling and the expected N+3 ceiling by emitting a warning.

The existing certificate-handling compatibility tests could be used to validate the proposed increase.

I am not suggesting removing the upper bound entirely, but rather updating it in accordance with the project's existing compatibility policy.

Relevant references:

Thank you for maintaining MSAL Python!

Vorherrschende Sprache
Python
Sterne
971
Forks
223
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus AzureAD/microsoft-authentication-library-for-python

Alle Issues in AzureAD/microsoft-authentication-library-for-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.