diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e71f265..56faf8efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://pypi.org/project/google-auth/#history +### [1.20.1](https://www.github.com/googleapis/google-auth-library-python/compare/v1.20.0...v1.20.1) (2020-08-06) + + +### Bug Fixes + +* reduce refresh clock skew to 10 seconds ([#581](https://www.github.com/googleapis/google-auth-library-python/issues/581)) ([42321ba](https://www.github.com/googleapis/google-auth-library-python/commit/42321bafd38a8bd806f4d01bfa0eda3b5a961667)) +* set Content-Type header in the request to signBlob API to avoid Invalid JSON payload error ([#439](https://www.github.com/googleapis/google-auth-library-python/issues/439)) ([20f82e2](https://www.github.com/googleapis/google-auth-library-python/commit/20f82e22b7e8c6c7fdd29e08eaf7b4cf2abdcf37)) + ## [1.20.0](https://www.github.com/googleapis/google-auth-library-python/compare/v1.19.2...v1.20.0) (2020-07-23) diff --git a/google/auth/_helpers.py b/google/auth/_helpers.py index ecb88ffda..21c987a73 100644 --- a/google/auth/_helpers.py +++ b/google/auth/_helpers.py @@ -22,7 +22,7 @@ from six.moves import urllib -CLOCK_SKEW_SECS = 300 # 5 minutes in seconds +CLOCK_SKEW_SECS = 10 # 10 seconds CLOCK_SKEW = datetime.timedelta(seconds=CLOCK_SKEW_SECS) diff --git a/google/auth/iam.py b/google/auth/iam.py index bd0500457..d83b25180 100644 --- a/google/auth/iam.py +++ b/google/auth/iam.py @@ -69,7 +69,7 @@ def _make_signing_request(self, message): method = "POST" url = _SIGN_BLOB_URI.format(self._service_account_email) - headers = {} + headers = {"Content-Type": "application/json"} body = json.dumps( {"bytesToSign": base64.b64encode(message).decode("utf-8")} ).encode("utf-8") diff --git a/setup.py b/setup.py index 5b192b10a..cfa7b0a85 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ with io.open("README.rst", "r") as fh: long_description = fh.read() -version = "1.20.0" +version = "1.20.1" setup( name="google-auth", diff --git a/tests/test_iam.py b/tests/test_iam.py index 4367fe7a8..cb2c26f73 100644 --- a/tests/test_iam.py +++ b/tests/test_iam.py @@ -89,6 +89,8 @@ def test_sign_bytes(self): returned_signature = signer.sign("123") assert returned_signature == signature + kwargs = request.call_args.kwargs + assert kwargs["headers"]["Content-Type"] == "application/json" def test_sign_bytes_failure(self): request = make_request(http_client.UNAUTHORIZED)