Repository: googleapis/python-storage

Issue:
use converted expiration parameter for signed_query_params to generate_signed_url_v2
Issue created from the comment https://github.com/googleapis/google-cloud-python/pull/9889#issuecomment-612694371

suspected line of code.
            https://github.com/googleapis/python-storage/blob/5c04eefe2599f13cf37b91cf60bd242e64b97bd7/google/cloud/storage/_signing.py#L387

/cc @frankyn 

Discussion:
gcf-merge-on-green[bot]: Your PR has attempted to merge for 3 hours. Please check that all required checks have passed, you have an automerge label, and that all your reviewers have approved the PR
gcf-merge-on-green[bot]: Your PR has attempted to merge for 3 hours. Please check that all required checks have passed, you have an automerge label, and that all your reviewers have approved the PR

Patch:
diff --git a/google/cloud/storage/_signing.py b/google/cloud/storage/_signing.py
index 38610b6..ae22484 100644
--- a/google/cloud/storage/_signing.py
+++ b/google/cloud/storage/_signing.py
@@ -82,7 +82,7 @@ def get_signed_query_params_v2(credentials, expiration, string_to_sign):
     service_account_name = credentials.signer_email
     return {
         "GoogleAccessId": service_account_name,
-        "Expires": str(expiration),
+        "Expires": expiration,
         "Signature": signature,
     }
 
@@ -384,7 +384,7 @@ def generate_signed_url_v2(
         signature = _sign_message(string_to_sign, access_token, service_account_email)
         signed_query_params = {
             "GoogleAccessId": service_account_email,
-            "Expires": str(expiration),
+            "Expires": expiration_stamp,
             "Signature": signature,
         }
     else:


Test patch:
diff --git a/tests/unit/test__signing.py b/tests/unit/test__signing.py
index 7b58a27..2907429 100644
--- a/tests/unit/test__signing.py
+++ b/tests/unit/test__signing.py
@@ -252,7 +252,7 @@ class Test_get_signed_query_params_v2(unittest.TestCase):
 
         expected = {
             "GoogleAccessId": account_name,
-            "Expires": str(expiration),
+            "Expires": expiration,
             "Signature": base64.b64encode(sig_bytes),
         }
         self.assertEqual(result, expected)