Skip to content

Fix DeprecationWarnings by updating key type property usage in tests #1590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Subham-KRLX
Copy link

Fixes #1483.

Replaced deprecated key.key_type with key.kty in test files to remove DeprecationWarnings and ensure compatibility with latest dependencies.

Single change (remove DeprecationWarnings).

@dopry
Copy link
Member

dopry commented Aug 11, 2025

@Subham-KRLX for context, can you link to the documentation regarding the deprecation of key_type here in the issue?

@Subham-KRLX
Copy link
Author

Hi @dopry, this change is based on the official JSON Web Key spec (RFC 7517, Section 4.1) which mandates "kty" as the standard parameter for key type. The older key_type property in libraries like jwcrypto has been deprecated and now triggers warnings with .kty being the correct standards-compliant attribute. Updating the tests removes these DeprecationWarnings ensures compatibility with the latest dependencies and aligns with the JWK specification.

@dopry
Copy link
Member

dopry commented Aug 12, 2025

I'm familiar with the spec change. I was specifically wondering which one of our dependencies is throwing this deprecation warning and is a mention of the deprecation available in their changelog or release notes.

@dopry dopry force-pushed the fix-deprecation-warnings branch from 10a5cbd to f82bb48 Compare August 12, 2025 17:15
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Subham-KRLX
Copy link
Author

The warning comes from the jwcrypto library.
Since v1.5 key_type is deprecated in favour of the RFC 7517‑compliant kty attribute as noted in their changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeprecationWarning in test_authorization_code.py::TestOIDCAuthorizationCodeHSAlgorithm::test_id_token
2 participants