bump python client

brings in jwt2.0 compat
This commit is contained in:
Leo Hemsted
2020-12-31 12:47:03 +00:00
parent 1da16eda23
commit 156c7aa32a
3 changed files with 12 additions and 12 deletions

View File

@@ -24,7 +24,7 @@ strict-rfc3339==0.7
rfc3987==1.3.8 rfc3987==1.3.8
cachetools==4.2.0 cachetools==4.2.0
notifications-python-client==5.7.0 notifications-python-client==5.7.1
# PaaS # PaaS
awscli-cwlogs==1.4.6 awscli-cwlogs==1.4.6

View File

@@ -26,7 +26,7 @@ strict-rfc3339==0.7
rfc3987==1.3.8 rfc3987==1.3.8
cachetools==4.2.0 cachetools==4.2.0
notifications-python-client==5.7.0 notifications-python-client==5.7.1
# PaaS # PaaS
awscli-cwlogs==1.4.6 awscli-cwlogs==1.4.6
@@ -42,14 +42,14 @@ alembic==1.4.3
amqp==1.4.9 amqp==1.4.9
anyjson==0.3.3 anyjson==0.3.3
attrs==20.3.0 attrs==20.3.0
awscli==1.18.199 awscli==1.18.206
bcrypt==3.2.0 bcrypt==3.2.0
billiard==3.3.0.23 billiard==3.3.0.23
bleach==3.2.1 bleach==3.2.1
blinker==1.4 blinker==1.4
boto==2.49.0 boto==2.49.0
boto3==1.16.39 boto3==1.16.46
botocore==1.19.39 botocore==1.19.46
certifi==2020.12.5 certifi==2020.12.5
chardet==4.0.0 chardet==4.0.0
click==7.1.2 click==7.1.2
@@ -81,7 +81,7 @@ pyrsistent==0.17.3
python-dateutil==2.8.1 python-dateutil==2.8.1
python-editor==1.0.4 python-editor==1.0.4
python-json-logger==2.0.1 python-json-logger==2.0.1
pytz==2020.4 pytz==2020.5
PyYAML==5.3.1 PyYAML==5.3.1
redis==3.5.3 redis==3.5.3
requests==2.25.1 requests==2.25.1

View File

@@ -63,7 +63,7 @@ def test_should_not_allow_request_with_no_iss(client, auth_fn):
'iat': int(time.time()) 'iat': int(time.time())
} }
token = jwt.encode(payload=claims, key=str(uuid.uuid4()), headers=headers).decode() token = jwt.encode(payload=claims, key=str(uuid.uuid4()), headers=headers)
request.headers = {'Authorization': 'Bearer {}'.format(token)} request.headers = {'Authorization': 'Bearer {}'.format(token)}
with pytest.raises(AuthError) as exc: with pytest.raises(AuthError) as exc:
@@ -84,7 +84,7 @@ def test_auth_should_not_allow_request_with_no_iat(client, sample_api_key):
# 'iat': not provided # 'iat': not provided
} }
token = jwt.encode(payload=claims, key=str(uuid.uuid4()), headers=headers).decode() token = jwt.encode(payload=claims, key=str(uuid.uuid4()), headers=headers)
request.headers = {'Authorization': 'Bearer {}'.format(token)} request.headers = {'Authorization': 'Bearer {}'.format(token)}
with pytest.raises(AuthError) as exc: with pytest.raises(AuthError) as exc:
@@ -105,7 +105,7 @@ def test_auth_should_not_allow_request_with_non_hs256_algorithm(client, sample_a
'iat': int(time.time()) 'iat': int(time.time())
} }
token = jwt.encode(payload=claims, key=str(uuid.uuid4()), headers=headers).decode() token = jwt.encode(payload=claims, key=str(uuid.uuid4()), headers=headers)
request.headers = {'Authorization': 'Bearer {}'.format(token)} request.headers = {'Authorization': 'Bearer {}'.format(token)}
with pytest.raises(AuthError) as exc: with pytest.raises(AuthError) as exc:
@@ -128,7 +128,7 @@ def test_admin_auth_should_not_allow_request_with_no_iat(client):
# 'iat': not provided # 'iat': not provided
} }
token = jwt.encode(payload=claims, key=secret, headers=headers).decode() token = jwt.encode(payload=claims, key=secret, headers=headers)
request.headers = {'Authorization': 'Bearer {}'.format(token)} request.headers = {'Authorization': 'Bearer {}'.format(token)}
with pytest.raises(AuthError) as exc: with pytest.raises(AuthError) as exc:
@@ -151,7 +151,7 @@ def test_admin_auth_should_not_allow_request_with_old_iat(client):
'iat': int(time.time()) - 60 'iat': int(time.time()) - 60
} }
token = jwt.encode(payload=claims, key=secret, headers=headers).decode() token = jwt.encode(payload=claims, key=secret, headers=headers)
request.headers = {'Authorization': 'Bearer {}'.format(token)} request.headers = {'Authorization': 'Bearer {}'.format(token)}
with pytest.raises(AuthError) as exc: with pytest.raises(AuthError) as exc:
@@ -174,7 +174,7 @@ def test_auth_should_not_allow_request_with_extra_claims(client, sample_api_key)
'aud': 'notifications.service.gov.uk' # extra claim that we don't support 'aud': 'notifications.service.gov.uk' # extra claim that we don't support
} }
token = jwt.encode(payload=claims, key=key, headers=headers).decode() token = jwt.encode(payload=claims, key=key, headers=headers)
request.headers = {'Authorization': 'Bearer {}'.format(token)} request.headers = {'Authorization': 'Bearer {}'.format(token)}
with pytest.raises(AuthError) as exc: with pytest.raises(AuthError) as exc: