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
77cachecontrol >= 0.12.6
88google-api-core [grpc ] >= 1.22.1 , < 2.0.0dev ; platform.python_implementation != 'PyPy'
99google-api-python-client >= 1.7.8
10- google-auth == 1.28.1
1110google-cloud-firestore >= 2.1.0 ; platform.python_implementation != 'PyPy'
1211google-cloud-storage >= 1.37.1
Original file line number Diff line number Diff line change 3838 'to integrate Firebase into their services and applications.' )
3939install_requires = [
4040 '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"' ,
4242 '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 ' ,
4545]
4646
4747setup (
Original file line number Diff line number Diff line change 1818import datetime
1919import json
2020import os
21+ import sys
2122import time
2223
2324from google .auth import crypt
@@ -75,13 +76,22 @@ def _merge_jwt_claims(defaults, overrides):
7576 del defaults [key ]
7677 return defaults
7778
79+
80+ def _is_py_35 ():
81+ return sys .version_info .minor == 5
82+
83+
7884def verify_custom_token (custom_token , expected_claims , tenant_id = None ):
7985 assert isinstance (custom_token , bytes )
8086 expected_email = MOCK_SERVICE_ACCOUNT_EMAIL
8187 header = jwt .decode_header (custom_token )
8288 assert header .get ('typ' ) == 'JWT'
8389 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'
8595 assert custom_token .split (b'.' )[2 ] == b''
8696 expected_email = _token_gen .AUTH_EMULATOR_EMAIL
8797 token = jwt .decode (custom_token , verify = False )
You can’t perform that action at this time.
0 commit comments