Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .librarian/state.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
libraries:
- id: google-auth
version: 2.48.0
version: 2.49.0-dev0
last_generated_commit: 102d9f92ac6ed649a61efd9b208e4d1de278e9bb
apis: []
source_roots:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

[1]: https://pypi.org/project/google-auth/#history

## [2.49.0-dev0](https://github.com/googleapis/google-auth-library-python/compare/v2.48.0...v2.49.0-dev0) (2026-01-26)


### Bug Fixes

* remove deprecated rsa dependency ([e98cf69284d3620619a70b54fb0b9533caf11878](https://github.com/googleapis/google-auth-library-python/commit/e98cf69284d3620619a70b54fb0b9533caf11878))

## [2.48.0](https://github.com/googleapis/google-auth-library-python/compare/v2.47.0...v2.48.0) (2026-01-22)


Expand Down
7 changes: 6 additions & 1 deletion google/auth/crypt/rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

from google.auth import _helpers
from google.auth.crypt import _cryptography_rsa
from google.auth.crypt import _python_rsa
from google.auth.crypt import base

RSA_KEY_MODULE_PREFIX = "rsa.key"
Expand All @@ -37,6 +36,7 @@ class RSAVerifier(base.Verifier):
public_key (Union["rsa.key.PublicKey", cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey]):
The public key used to verify signatures.
Raises:
ImportError: if called with an rsa.key.PublicKey, when the rsa library is not installed
ValueError: if an unrecognized public key is provided
"""

Expand All @@ -45,6 +45,8 @@ def __init__(self, public_key):
if isinstance(public_key, RSAPublicKey):
impl_lib = _cryptography_rsa
elif module_str.startswith(RSA_KEY_MODULE_PREFIX):
from google.auth.crypt import _python_rsa

impl_lib = _python_rsa
Comment on lines +48 to 50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The extra blank line on line 49 is unnecessary and violates PEP 8's guidance on vertical whitespace. Removing it will make the code more compact and consistent.

Suggested change
from google.auth.crypt import _python_rsa
impl_lib = _python_rsa
from google.auth.crypt import _python_rsa
impl_lib = _python_rsa
References
  1. PEP 8 (E303) advises against using too many blank lines. Extra blank lines should be used sparingly to indicate logical sections, which is not the case here. (link)

else:
raise ValueError(f"unrecognized public key type: {type(public_key)}")
Expand Down Expand Up @@ -85,6 +87,7 @@ class RSASigner(base.Signer, base.FromServiceAccountMixin):
public key or certificate.

Raises:
ImportError: if called with an rsa.key.PrivateKey, when the rsa library is not installed
ValueError: if an unrecognized public key is provided
"""

Expand All @@ -93,6 +96,8 @@ def __init__(self, private_key, key_id=None):
if isinstance(private_key, RSAPrivateKey):
impl_lib = _cryptography_rsa
elif module_str.startswith(RSA_KEY_MODULE_PREFIX):
from google.auth.crypt import _python_rsa

impl_lib = _python_rsa
Comment on lines +99 to 101
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the other change in this file, the extra blank line on line 100 is unnecessary and violates PEP 8's guidance on vertical whitespace. It should be removed for consistency.

Suggested change
from google.auth.crypt import _python_rsa
impl_lib = _python_rsa
from google.auth.crypt import _python_rsa
impl_lib = _python_rsa
References
  1. PEP 8 (E303) advises against using too many blank lines. Extra blank lines should be used sparingly to indicate logical sections, which is not the case here. (link)

else:
raise ValueError(f"unrecognized private key type: {type(private_key)}")
Expand Down
2 changes: 1 addition & 1 deletion google/auth/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "2.48.0"
__version__ = "2.49.0-dev0"
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
DEPENDENCIES = (
"pyasn1-modules>=0.2.1",
cryptography_base_require,
# TODO: remove rsa from dependencies in next release (replaced with cryptography)i
# https://github.com/googleapis/google-auth-library-python/issues/1810
"rsa>=3.1.4,<5",
)

requests_extra_require = ["requests >= 2.20.0, < 3.0.0"]
Expand Down Expand Up @@ -73,6 +70,9 @@
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1722): `test_aiohttp_requests` depend on
# aiohttp < 3.10.0 which is a bug. Investigate and remove the pinned aiohttp version.
"aiohttp < 3.10.0",
# rsa library was removed as a dependency, but we still have some code paths that support it
# TODO: remove dependency when google.auth.crypt._python_rsa is removed
"rsa>=3.1.4,<5",
]

extras = {
Expand Down
1 change: 0 additions & 1 deletion testing/constraints-3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# Then this file should have foo==1.14.0
pyasn1-modules==0.2.1
setuptools==40.3.0
rsa==3.1.4
cryptography==38.0.3
aiohttp==3.6.2
requests==2.20.0
Expand Down
2 changes: 1 addition & 1 deletion tests/crypt/test_rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from cryptography.hazmat import backends
from cryptography.hazmat.primitives import serialization
import pytest
import rsa as rsa_lib
import rsa as rsa_lib # type: ignore

from google.auth.crypt import _cryptography_rsa
from google.auth.crypt import _python_rsa
Expand Down
Loading