aboutsummaryrefslogtreecommitdiff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/compute_engine/test_credentials.py12
-rw-r--r--tests/test_iam.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/compute_engine/test_credentials.py b/tests/compute_engine/test_credentials.py
index 8c95e24..4ee6536 100644
--- a/tests/compute_engine/test_credentials.py
+++ b/tests/compute_engine/test_credentials.py
@@ -363,11 +363,11 @@ class TestIDTokenCredentials(object):
signature = base64.b64encode(b"some-signature").decode("utf-8")
responses.add(
responses.POST,
- "https://iam.googleapis.com/v1/projects/-/serviceAccounts/"
- "service-account@example.com:signBlob?alt=json",
+ "https://iamcredentials.googleapis.com/v1/projects/-/"
+ "serviceAccounts/service-account@example.com:signBlob?alt=json",
status=200,
content_type="application/json",
- json={"keyId": "some-key-id", "signature": signature},
+ json={"keyId": "some-key-id", "signedBlob": signature},
)
id_token = "{}.{}.{}".format(
@@ -477,11 +477,11 @@ class TestIDTokenCredentials(object):
signature = base64.b64encode(b"some-signature").decode("utf-8")
responses.add(
responses.POST,
- "https://iam.googleapis.com/v1/projects/-/serviceAccounts/"
- "service-account@example.com:signBlob?alt=json",
+ "https://iamcredentials.googleapis.com/v1/projects/-/"
+ "serviceAccounts/service-account@example.com:signBlob?alt=json",
status=200,
content_type="application/json",
- json={"keyId": "some-key-id", "signature": signature},
+ json={"keyId": "some-key-id", "signedBlob": signature},
)
id_token = "{}.{}.{}".format(
diff --git a/tests/test_iam.py b/tests/test_iam.py
index cb2c26f..fbd3e41 100644
--- a/tests/test_iam.py
+++ b/tests/test_iam.py
@@ -81,7 +81,7 @@ class TestSigner(object):
def test_sign_bytes(self):
signature = b"DEADBEEF"
encoded_signature = base64.b64encode(signature).decode("utf-8")
- request = make_request(http_client.OK, data={"signature": encoded_signature})
+ request = make_request(http_client.OK, data={"signedBlob": encoded_signature})
credentials = make_credentials()
signer = iam.Signer(request, credentials, mock.sentinel.service_account_email)