Skip to content

Commit 7681aaa

Browse files
chore(deps): bump pyjwt from 1.7.1 to 2.4.0 (#85)
* chore(deps): bump pyjwt from 1.7.1 to 2.4.0 Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 1.7.1 to 2.4.0. - [Release notes](https://github.com/jpadilla/pyjwt/releases) - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst) - [Commits](jpadilla/pyjwt@1.7.1...2.4.0) --- updated-dependencies: - dependency-name: pyjwt dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Update tests for PyJWT>v2.0 Remove newline Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Anthony Engelstad <aengelstad@gmail.com>
1 parent 81f420c commit 7681aaa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pylint
88
pytest
99
pytest-cov
1010
responses
11-
pyjwt==1.7.1
11+
pyjwt==2.4.0
1212
boto3
1313
aws_requests_auth
1414
openapi-spec-validator==0.2.9

tests/test_auth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def testCreds(self):
127127
"""
128128
sa = StaxAuth("ApiAuth", self.config)
129129
token = jwt.encode({"sub": "unittest"}, "secret", algorithm="HS256")
130-
jwt_token = jwt.decode(token, verify=False)
130+
jwt_token = jwt.decode(token, options={"verify_signature": False}, algorithms=["HS256"])
131131
self.stub_cognito_creds(sa, jwt_token.get("sub"))
132132
creds = sa.sts_from_cognito_identity_pool(
133133
jwt_token.get("sub"), self.cognito_client
@@ -143,7 +143,7 @@ def testCredsClient(self):
143143

144144
# Test Invalid Credentials
145145
token = jwt.encode({"sub": "unittest"}, "secret", algorithm="HS256")
146-
jwt_token = jwt.decode(token, verify=False)
146+
jwt_token = jwt.decode(token, options={"verify_signature": False}, algorithms=["HS256"])
147147
with self.assertRaises(InvalidCredentialsException):
148148
sa.sts_from_cognito_identity_pool(jwt_token.get("sub"))
149149

@@ -309,7 +309,7 @@ def testApiTokenAuth(self):
309309
StaxConfig = Config()
310310
StaxConfig.expiration = None
311311
token = jwt.encode({"sub": "valid_token"}, "secret", algorithm="HS256")
312-
jwt_token = jwt.decode(token, verify=False)
312+
jwt_token = jwt.decode(token, options={"verify_signature": False}, algorithms=["HS256"])
313313
self.stub_cognito_creds(sa, jwt_token.get("sub"))
314314
self.stub_aws_srp(sa, "username")
315315

@@ -384,7 +384,7 @@ def testRootAuth(self):
384384
StaxConfig = self.config
385385
StaxConfig.expiration = None
386386
token = jwt.encode({"sub": "valid_token"}, "secret", algorithm="HS256")
387-
jwt_token = jwt.decode(token, verify=False)
387+
jwt_token = jwt.decode(token, options={"verify_signature": False}, algorithms=["HS256"])
388388
self.stub_cognito_creds(sa, jwt_token.get("sub"))
389389
self.stub_aws_srp(sa, "username")
390390

@@ -407,7 +407,7 @@ def testApiAuth(self):
407407
StaxConfig.secret_key = "password"
408408

409409
token = jwt.encode({"sub": "valid_token"}, "secret", algorithm="HS256")
410-
jwt_token = jwt.decode(token, verify=False)
410+
jwt_token = jwt.decode(token, options={"verify_signature": False}, algorithms=["HS256"])
411411
self.stub_cognito_creds(sa, jwt_token.get("sub"))
412412
self.stub_aws_srp(sa, "username")
413413
StaxConfig._auth(srp_client=self.aws_srp_client, cognito_client=self.cognito_client)

0 commit comments

Comments
 (0)