You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pickle
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file("credentials.json")
pickle.dumps(credentials)
The object in question seems to be credentials._signer which is either a pickleable pure Python object if cryptography is not installed, or else an unpickleable google.auth.crypt._cryptography_rsa.RSASigner if it is. Specifically, the signer._key object is of type cryptography.hazmat.backends.openssl.rsa._RSAPrivateKey.
I'm not sure how this should be implemented.. Any object that is pickled would need to reconstruct the signer object to work, which requires the key's PEM file. Put another way, it seems to me that the the object needs to be recreated each time.
Environment details
google-auth
version: 2.22.0Steps to reproduce
Install
cryptography
Run:
The object in question seems to be
credentials._signer
which is either a pickleable pure Python object ifcryptography
is not installed, or else an unpickleablegoogle.auth.crypt._cryptography_rsa.RSASigner
if it is. Specifically, the signer._key object is of typecryptography.hazmat.backends.openssl.rsa._RSAPrivateKey
.This conversation on SO seems related: https://stackoverflow.com/questions/39321606/cant-pickle-an-rsa-key-to-send-over-a-socket
This is impacting the Storage SDK's multiprocessing capability: googleapis/python-storage#1116 despite efforts to work around it.
The text was updated successfully, but these errors were encountered: