aboutsummaryrefslogtreecommitdiff
path: root/system_tests/test_service_account.py
diff options
context:
space:
mode:
authorBu Sun Kim <8822365+busunkim96@users.noreply.github.com>2020-09-08 15:28:08 -0600
committerGitHub <noreply@github.com>2020-09-08 15:28:08 -0600
commit694d83fd23c0e8c2fde27136d1b3f8f6db6338a6 (patch)
tree4251ff84604868179be0857bff052d8e1005282a /system_tests/test_service_account.py
parent892dc37ea7941c716171372be89ee3387b6c2715 (diff)
downloadgoogle-auth-library-python-694d83fd23c0e8c2fde27136d1b3f8f6db6338a6.tar.gz
fix: migrate signBlob to iamcredentials.googleapis.com (#600)
Migrate signBlob from iam.googleapis.com to iamcredentials.googleapis.com. This API is deprecated and will be shutdown in one year. This is used google.auth.iam.Signer. Added a system_test to sanity check the implementation.
Diffstat (limited to 'system_tests/test_service_account.py')
-rw-r--r--system_tests/test_service_account.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/system_tests/test_service_account.py b/system_tests/test_service_account.py
index 262ce84..498b75b 100644
--- a/system_tests/test_service_account.py
+++ b/system_tests/test_service_account.py
@@ -16,6 +16,7 @@ import pytest
from google.auth import _helpers
from google.auth import exceptions
+from google.auth import iam
from google.oauth2 import service_account
@@ -46,3 +47,19 @@ def test_refresh_success(http_request, credentials, token_info):
"https://www.googleapis.com/auth/userinfo.profile",
]
)
+
+def test_iam_signer(http_request, credentials):
+ credentials = credentials.with_scopes(
+ ["https://www.googleapis.com/auth/iam"]
+ )
+
+ # Verify iamcredentials signer.
+ signer = iam.Signer(
+ http_request,
+ credentials,
+ credentials.service_account_email
+ )
+
+ signed_blob = signer.sign("message")
+
+ assert isinstance(signed_blob, bytes)