-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused production requirements #93
Conversation
Splits dependencies for production and development
timewsync/__init__.py
Outdated
@@ -123,7 +128,7 @@ def main(): | |||
log.addHandler(info_handler) | |||
|
|||
# Error logging | |||
red_formatter = logging.Formatter(Fore.RED + "%(levelname)s: %(message)s" + Fore.RESET) | |||
red_formatter = logging.Formatter("\u001b[31m" + "%(levelname)s: %(message)s" + "\u001b[0m") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, if we have colorama as a dependency anyways, we might as well use Fore
for better readability imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you are right. I was thinking about removing colorama altogether but did like the colored text which of course needs to work on Windows as well (without gibberish).
I'll change that back now.
timewsync/auth.py
Outdated
@@ -57,6 +58,6 @@ def generate_jwt(priv_key: jwk.JWK, user_id: int) -> str: | |||
""" | |||
payload = {"userID": user_id} | |||
|
|||
token = jwt.generate_jwt(payload, priv_key, "RS256", lifetime=datetime.timedelta(minutes=1)) | |||
token = jwt.encode(payload, priv_key, algorithm="RS256", headers={"alg": "RS256", "typ": "JWT"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
token = jwt.encode(payload, priv_key, algorithm="RS256", headers={"alg": "RS256", "typ": "JWT"}) | |
token = jwt.encode(payload, priv_key, algorithm="RS256") |
Are you sure these headers need to be specified? Some preliminary testing on my local machine has shown that these headers are automatically added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right!
This was because of failing tests, but the reason was something unrelated.
- Uses keys in PEM format - Update tests
- pytest (reason: moved to requirements-dev.txt) - py (reasons: maintenance mode, unused) - attrs (reason: unused) - pluggy (reason: moved to requirements-dev.txt) - iniconfig (reason: moved to requirements-dev.txt) - black (reason: moved to requirements-dev.txt) - jwcrypto 1.5 -> 1.5.6 (reason: improved security) - python_jwt -> pyjwt (reason: deprecated) - six (reason: unused, also Python 2 support got dropped long ago)
Removes unused dependencies from the project #36.
Splits dependencies for production and development into
requirements.txt
andrequirements-dev.txt
, respectively.Please use
requirements-dev.txt
for development and testing.Switches from
python_jwt
topyjwt
, because the former is deprecated.The following packets in
requirements.txt
are removed/changed:This droppes support for Python 2, which had end-of-life for a long time.