Merge pull request #4170 from freqtrade/dependabot/pip/develop/pyjwt-2.0.0

Bump pyjwt from 1.7.1 to 2.0.0
This commit is contained in:
Matthias 2021-01-08 19:48:04 +01:00 committed by GitHub
commit 61d225a575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ def get_user_from_token(token, secret_key: str, token_type: str = "access"):
return username return username
def create_token(data: dict, secret_key: str, token_type: str = "access") -> bytes: def create_token(data: dict, secret_key: str, token_type: str = "access") -> str:
to_encode = data.copy() to_encode = data.copy()
if token_type == "access": if token_type == "access":
expire = datetime.utcnow() + timedelta(minutes=15) expire = datetime.utcnow() + timedelta(minutes=15)

View File

@ -30,7 +30,7 @@ sdnotify==0.3.2
# API Server # API Server
fastapi==0.63.0 fastapi==0.63.0
uvicorn==0.13.3 uvicorn==0.13.3
pyjwt==1.7.1 pyjwt==2.0.0
# Support for colorized terminal output # Support for colorized terminal output
colorama==0.4.4 colorama==0.4.4

View File

@ -93,7 +93,7 @@ def test_api_auth():
create_token({'identity': {'u': 'Freqtrade'}}, 'secret1234', token_type="NotATokenType") create_token({'identity': {'u': 'Freqtrade'}}, 'secret1234', token_type="NotATokenType")
token = create_token({'identity': {'u': 'Freqtrade'}}, 'secret1234') token = create_token({'identity': {'u': 'Freqtrade'}}, 'secret1234')
assert isinstance(token, bytes) assert isinstance(token, str)
u = get_user_from_token(token, 'secret1234') u = get_user_from_token(token, 'secret1234')
assert u == 'Freqtrade' assert u == 'Freqtrade'