Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
f357187
added warning
daniel-sanche Jan 9, 2026
575113c
added posargs to unit test nox command
daniel-sanche Jan 9, 2026
bef613a
added test
daniel-sanche Jan 9, 2026
15e6e7b
add rsa extra
daniel-sanche Jan 9, 2026
7715f92
updated warning
daniel-sanche Jan 9, 2026
ddacaf2
added TODO
daniel-sanche Jan 9, 2026
5573db6
added docstring warnings
daniel-sanche Jan 9, 2026
07a4f22
remove extra dependency
daniel-sanche Jan 9, 2026
6890572
Merge branch 'main' into warn_rsa
daniel-sanche Jan 9, 2026
c2ceeb4
added default rsa classes
daniel-sanche Jan 9, 2026
d1b3fb6
added shared wrapper class for RSASigner and RSAVerifier
daniel-sanche Jan 9, 2026
ad651ed
changed warning type
daniel-sanche Jan 9, 2026
540f260
added deprecation notices to docstrings
daniel-sanche Jan 9, 2026
a4830fa
Merge branch 'warn_rsa' into remove_rsa_2
daniel-sanche Jan 9, 2026
68410f1
moved warning
daniel-sanche Jan 9, 2026
f89e444
fixed warning type in tests
daniel-sanche Jan 9, 2026
fd429f3
remove rsa as required dependency
daniel-sanche Jan 9, 2026
fd1ae50
fixed errors
daniel-sanche Jan 10, 2026
0895998
added custom exception
daniel-sanche Jan 10, 2026
69bae96
ran blacken
daniel-sanche Jan 10, 2026
a803198
added new test file
daniel-sanche Jan 10, 2026
716bec3
added test file
daniel-sanche Jan 10, 2026
6191d3b
fixed bugs in implementation
daniel-sanche Jan 10, 2026
b7c270b
InvalidValue -> ValueError
daniel-sanche Jan 10, 2026
a1e0389
clean up tests
daniel-sanche Jan 10, 2026
6b17faa
finished tests
daniel-sanche Jan 10, 2026
e88fc1c
added e2e tests
daniel-sanche Jan 10, 2026
d7a3b23
added warning tests
daniel-sanche Jan 10, 2026
d0f1747
added unit tests
daniel-sanche Jan 10, 2026
db7037c
fixed lint
daniel-sanche Jan 10, 2026
556aa32
Merge branch 'main' into remove_rsa_2
daniel-sanche Jan 10, 2026
a9027c4
fixed typos
daniel-sanche Jan 12, 2026
d6ec87f
made cryptography into required dependency
daniel-sanche Jan 12, 2026
6aa7f41
rewrote classes to assume cryptography and rsa are both present
daniel-sanche Jan 12, 2026
a8efb6b
simplified from_string
daniel-sanche Jan 12, 2026
02dace8
updated tests
daniel-sanche Jan 12, 2026
3dd119f
Update google/auth/crypt/rsa.py
daniel-sanche Jan 12, 2026
208299a
Update google/auth/crypt/rsa.py
daniel-sanche Jan 12, 2026
3898071
Update google/auth/crypt/rsa.py
daniel-sanche Jan 12, 2026
754a401
Merge branch 'main' into add_cryptography_dependency
daniel-sanche Jan 12, 2026
7fa0a84
improved init logic
daniel-sanche Jan 13, 2026
2958fe1
fixed lint
daniel-sanche Jan 13, 2026
1ac38ff
improved from_string
daniel-sanche Jan 13, 2026
9a8043f
import rsa only when needed
daniel-sanche Jan 13, 2026
4edfd72
updated dependencies
daniel-sanche Jan 13, 2026
a11cb0f
fixed test
daniel-sanche Jan 13, 2026
fb52796
removed import check in __init__
daniel-sanche Jan 13, 2026
b455d59
fixed lint
daniel-sanche Jan 13, 2026
2416c6f
addressed PR comments
daniel-sanche Jan 15, 2026
c20c1af
Merge branch 'main' into add_cryptography_dependency
daniel-sanche Jan 15, 2026
1edd592
fixed lint
daniel-sanche Jan 15, 2026
1ccbb53
Merge branch 'main' into add_cryptography_dependency
daniel-sanche Jan 15, 2026
ba8b25e
updated cryptography requirement in enterprise_cert_extra
daniel-sanche Jan 15, 2026
6efed1d
Update google/auth/crypt/rsa.py
daniel-sanche Jan 16, 2026
e6e9c26
Merge branch 'add_cryptography_dependency' into remove_rsa_3
daniel-sanche Jan 16, 2026
d3ab2e7
fixed lint
daniel-sanche Jan 16, 2026
971cbd7
fixed mypy
daniel-sanche Jan 16, 2026
61da847
Merge branch 'main' into remove_rsa_3
daniel-sanche Jan 16, 2026
b43f691
remove rsa from constraints file
daniel-sanche Jan 16, 2026
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
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
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
else:
raise ValueError(f"unrecognized private key type: {type(private_key)}")
Expand Down
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.7.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
aiohttp==3.6.2
requests==2.20.0
pyjwt==2.0
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