From bc5375f4c88f7e6ad1afbe7667c49d9a846e9757 Mon Sep 17 00:00:00 2001 From: HemangChothani <50404902+HemangChothani@users.noreply.github.com> Date: Wed, 12 Feb 2020 22:56:01 +0530 Subject: [PATCH] fix(storage): fix system test and change scope for iam access token (#47) * fix(storage): change scope for iam access token * fix: narrow scope * fix: trailing commas * chore: blacken Co-authored-by: Christopher Wilcox --- tests/system.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/system.py b/tests/system.py index 188089d94..995b984ed 100644 --- a/tests/system.py +++ b/tests/system.py @@ -968,8 +968,8 @@ def _create_signed_read_url_helper( method=method, client=Config.CLIENT, version=version, - service_account_email=None, - access_token=None, + service_account_email=service_account_email, + access_token=access_token, ) headers = {} @@ -1046,7 +1046,10 @@ def test_create_signed_read_url_v2_w_access_token(self): client = iam_credentials_v1.IAMCredentialsClient() service_account_email = Config.CLIENT._credentials.service_account_email name = client.service_account_path("-", service_account_email) - scope = ["https://www.googleapis.com/auth/devstorage.read_write"] + scope = [ + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/iam", + ] response = client.generate_access_token(name, scope) self._create_signed_read_url_helper( service_account_email=service_account_email, @@ -1057,7 +1060,10 @@ def test_create_signed_read_url_v4_w_access_token(self): client = iam_credentials_v1.IAMCredentialsClient() service_account_email = Config.CLIENT._credentials.service_account_email name = client.service_account_path("-", service_account_email) - scope = ["https://www.googleapis.com/auth/devstorage.read_write"] + scope = [ + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/iam", + ] response = client.generate_access_token(name, scope) self._create_signed_read_url_helper( version="v4",