Skip to content

Commit

Permalink
Merge branch 'upgrade-todo-app'
Browse files Browse the repository at this point in the history
PR #2052

* upgrade-todo-app:
  Fix PyJWT (`import jwt`) code to work with latest version
  Upgrade 3rd-party Python dependencies to latest available version
  • Loading branch information
jamesls committed Dec 13, 2023
2 parents e9161aa + 6f6afb5 commit f365304
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/source/samples/todo-app/code/chalicelib/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_jwt_token(username, password, record, secret):
record['hash'],
password.encode('utf-8'),
record['salt'].value,
record['rounds']
int(record['rounds'])
)
expected = record['hashed'].value
if hmac.compare_digest(actual, expected):
Expand All @@ -25,7 +25,7 @@ def get_jwt_token(username, password, record, secret):
'jti': unique_id,
# NOTE: We can also add 'exp' if we want tokens to expire.
}
return jwt.encode(payload, secret, algorithm='HS256').decode('utf-8')
return jwt.encode(payload, secret, algorithm='HS256')
raise UnauthorizedError('Invalid password')


Expand Down
4 changes: 2 additions & 2 deletions docs/source/samples/todo-app/code/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
chalice==1.15.1
pytest==5.4.3
chalice==1.29.0
pytest==7.4.0
6 changes: 3 additions & 3 deletions docs/source/samples/todo-app/code/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
boto3==1.14.18
botocore==1.17.18
PyJWT==2.4.0
boto3==1.27.0
botocore==1.30.0
PyJWT==2.7.0

0 comments on commit f365304

Please sign in to comment.