Add Signing.singer_email (#89)
diff --git a/google/auth/app_engine.py b/google/auth/app_engine.py
index 566475e..608651d 100644
--- a/google/auth/app_engine.py
+++ b/google/auth/app_engine.py
@@ -110,3 +110,8 @@
@_helpers.copy_docstring(credentials.Signing)
def sign_bytes(self, message):
return app_identity.sign_blob(message)
+
+ @property
+ @_helpers.copy_docstring(credentials.Signing)
+ def signer_email(self):
+ return self.service_account_email
diff --git a/google/auth/credentials.py b/google/auth/credentials.py
index 470f1a4..360dc0e 100644
--- a/google/auth/credentials.py
+++ b/google/auth/credentials.py
@@ -229,3 +229,10 @@
# pylint: disable=missing-raises-doc,redundant-returns-doc
# (pylint doesn't recognize that this is abstract)
raise NotImplementedError('Sign bytes must be implemented.')
+
+ @abc.abstractproperty
+ def signer_email(self):
+ """Optional[str]: An email address that identifies the signer."""
+ # pylint: disable=missing-raises-doc
+ # (pylint doesn't recognize that this is abstract)
+ raise NotImplementedError('Signer email must be implemented.')
diff --git a/google/auth/jwt.py b/google/auth/jwt.py
index 0884b3d..dfaf2e6 100644
--- a/google/auth/jwt.py
+++ b/google/auth/jwt.py
@@ -463,6 +463,11 @@
"""
return self._signer.sign(message)
+ @property
+ @_helpers.copy_docstring(credentials.Signing)
+ def signer_email(self):
+ return self._issuer
+
def before_request(self, request, method, url, headers):
"""Performs credential-specific before request logic.