This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import sys | |
import anticrlf | |
formatter = anticrlf.LogFormatter( | |
"%(asctime)s - %(name)s - %(levelname)s: Line %(lineno)s | %(message)s" # replace it for another format | |
) | |
formatter.replacements["\n"] = "\\x0A" # OPTIONAL: \x0a is a equivalent of \n in bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta, timezone | |
from jose import jwt # or import jwt | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.hazmat.backends import default_backend | |
# --- Generate private and public key --- | |
key = rsa.generate_private_key( |