From 71cb0118419ba07d386199befa3ac2efd9cdad3b Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 17 Aug 2021 10:58:28 -0600 Subject: [PATCH 1/3] chore: set release version to 2.0.0 (#840) * chore: release 2.0.0 * Update CHANGELOG.md * chore: set version number to 2.0.0 Follow up to #829 Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- google/auth/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/auth/version.py b/google/auth/version.py index db6d3e9e7..2343e4018 100644 --- a/google/auth/version.py +++ b/google/auth/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.0.0b1" +__version__ = "2.0.0" From 4e0fb1cee78ee56b878b6e12be3b3c58df242b05 Mon Sep 17 00:00:00 2001 From: bojeil-google Date: Tue, 17 Aug 2021 15:56:39 -0700 Subject: [PATCH 2/3] fix: aws path normalization in windows (#842) Path normalization for the canonical_uri was broken in windows. This is because we were using `os.path.normpath`. This normalizes "/" paths to "\\" in Windows OS. Confirmed the fix is working in Windows. --- google/auth/aws.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/google/auth/aws.py b/google/auth/aws.py index 2f2a1359b..c8deee707 100644 --- a/google/auth/aws.py +++ b/google/auth/aws.py @@ -45,6 +45,7 @@ import os import re import urllib +from urllib.parse import urljoin from google.auth import _helpers from google.auth import environment_vars @@ -112,13 +113,17 @@ def get_request_options( additional_headers = additional_headers or {} uri = urllib.parse.urlparse(url) + # Normalize the URL path. This is needed for the canonical_uri. + # os.path.normpath can't be used since it normalizes "/" paths + # to "\\" in Windows OS. + normalized_uri = urllib.parse.urlparse(urljoin(url, uri.path)) # Validate provided URL. if not uri.hostname or uri.scheme != "https": raise ValueError("Invalid AWS service URL") header_map = _generate_authentication_header_map( host=uri.hostname, - canonical_uri=os.path.normpath(uri.path or "/"), + canonical_uri=normalized_uri.path or "/", canonical_querystring=_get_canonical_querystring(uri.query), method=method, region=self._region_name, From d6eea6986f78dc9288106bb44ed55efbb842828c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 Aug 2021 15:16:48 -0400 Subject: [PATCH 3/3] chore: release 2.0.1 (#845) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ google/auth/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952355f4c..82da8c6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-auth/#history +### [2.0.1](https://www.github.com/googleapis/google-auth-library-python/compare/v2.0.0...v2.0.1) (2021-08-17) + + +### Bug Fixes + +* normalize AWS paths correctly on windows ([#842](https://www.github.com/googleapis/google-auth-library-python/issues/842)) ([4e0fb1c](https://www.github.com/googleapis/google-auth-library-python/commit/4e0fb1cee78ee56b878b6e12be3b3c58df242b05)) + ## [2.0.0](https://www.github.com/googleapis/google-auth-library-python/compare/v2.0.0-b1...v2.0.0) (2021-08-16) diff --git a/google/auth/version.py b/google/auth/version.py index 2343e4018..1a390124f 100644 --- a/google/auth/version.py +++ b/google/auth/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.0.0" +__version__ = "2.0.1"