File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,5 @@ pytest-localserver >= 0.4.1
7
7
cachecontrol >= 0.12.6
8
8
google-api-core [grpc ] >= 1.22.1 , < 2.0.0dev ; platform.python_implementation != 'PyPy'
9
9
google-api-python-client >= 1.7.8
10
- google-auth == 1.28.1
11
10
google-cloud-firestore >= 2.1.0 ; platform.python_implementation != 'PyPy'
12
11
google-cloud-storage >= 1.37.1
Original file line number Diff line number Diff line change 38
38
'to integrate Firebase into their services and applications.' )
39
39
install_requires = [
40
40
'cachecontrol>=0.12.6' ,
41
- 'google-api-core[grpc] >= 1.14.0 , < 2.0.0dev; platform.python_implementation != "PyPy"' ,
41
+ 'google-api-core[grpc] >= 1.22.1 , < 2.0.0dev; platform.python_implementation != "PyPy"' ,
42
42
'google-api-python-client >= 1.7.8' ,
43
- 'google-cloud-firestore>=1.4 .0; platform.python_implementation != "PyPy"' ,
44
- 'google-cloud-storage>=1.18.0 ' ,
43
+ 'google-cloud-firestore>=2.1 .0; platform.python_implementation != "PyPy"' ,
44
+ 'google-cloud-storage>=1.37.1 ' ,
45
45
]
46
46
47
47
setup (
Original file line number Diff line number Diff line change 18
18
import datetime
19
19
import json
20
20
import os
21
+ import sys
21
22
import time
22
23
23
24
from google .auth import crypt
@@ -75,13 +76,22 @@ def _merge_jwt_claims(defaults, overrides):
75
76
del defaults [key ]
76
77
return defaults
77
78
79
+
80
+ def _is_py_35 ():
81
+ return sys .version_info .minor == 5
82
+
83
+
78
84
def verify_custom_token (custom_token , expected_claims , tenant_id = None ):
79
85
assert isinstance (custom_token , bytes )
80
86
expected_email = MOCK_SERVICE_ACCOUNT_EMAIL
81
87
header = jwt .decode_header (custom_token )
82
88
assert header .get ('typ' ) == 'JWT'
83
89
if _is_emulated ():
84
- assert header .get ('alg' ) == 'none'
90
+ # Setting alg requires https://github.com/googleapis/google-auth-library-python/pull/729
91
+ # which is only available in latest google-auth versions that's supported on Python 3.6
92
+ # and up. Skip the test on Python 3.5 for now.
93
+ if not _is_py_35 ():
94
+ assert header .get ('alg' ) == 'none'
85
95
assert custom_token .split (b'.' )[2 ] == b''
86
96
expected_email = _token_gen .AUTH_EMULATOR_EMAIL
87
97
token = jwt .decode (custom_token , verify = False )
You can’t perform that action at this time.
0 commit comments