-
Notifications
You must be signed in to change notification settings - Fork 346
feat: add cryptography as required dependency #1929
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
Conversation
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully transitions the library to use cryptography as a required dependency for RSA operations, moving away from the deprecated rsa library. The introduction of RSASigner and RSAVerifier wrapper classes is a clean approach to maintain backward compatibility while encouraging migration. The dependency updates and test modifications are all well-executed. I have a couple of minor suggestions to improve the docstrings in the new wrapper classes, which will enhance documentation clarity and prevent potential issues with tooling.
| # TODO(https://github.com/googleapis/google-auth-library-python/issues/1665): Remove the pinned version of pyopenssl | ||
| # once `TestDecryptPrivateKey::test_success` is updated to remove the deprecated `OpenSSL.crypto.sign` and | ||
| # `OpenSSL.crypto.verify` methods. See: https://www.pyopenssl.org/en/latest/changelog.html#id3. | ||
| "pyopenssl < 24.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking: For testing, we're using pyopenssl < 24.3.0, we should revisit this in the future so that we're able to test the latest version of pyopenssl. Same with aiohttp below
The
rsalibrary has been deprecated and archived. This PR addscryptographyas a the new preferred backend for RSA operationsIn the short term, both
rsaandcryptographywill be listed as dependencies. Soon,rsawill be removed, but still supported as an optional dependency. Eventually, it will be completely removed from the codebase.As a part of this change, I introduced new RSASigner and RSAVerifier wrapper classes, that can use either cryptography or rsa implementations. Previously, the library would only import one or the other, depending on if cryptography was installed. This simplifies the import structure, and puts rsa and cryptography on equal footing
Fixes #912
Towards #1810
Towards #941