Skip to content

Commit

Permalink
unused token removed. Package jwt no longer needed (removed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Jul 20, 2021
1 parent 7d150b9 commit 31cf1af
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
deps: ## Install dependencies
python -m pip install --upgrade pip
python -m pip install black flake8 flit pylint tox tox-gh-actions semantic_version polib
python -m pip install pyjwt click pyserial requests
python -m pip install click pyserial requests

cenv: ## Create the virtual-environment and update dependencies
python3 -m venv venv
Expand Down
17 changes: 1 addition & 16 deletions apio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
import click
import requests


from apio import util

requests.packages.urllib3.disable_warnings()


Expand All @@ -24,12 +21,9 @@ def api_request(command, organization="FPGAwars"):
# -- Create the URL for accesing the github API
cmd_url = f"https://api.github.com/repos/{organization}/{command}"

# -- Get the headers (Autorization token)
headers = _get_headers()

# -- Do the request!
try:
req = requests.get(cmd_url, headers)
req = requests.get(cmd_url)
result = req.json()
req.raise_for_status()

Expand Down Expand Up @@ -62,12 +56,3 @@ def api_request(command, organization="FPGAwars"):
sys.exit(1)

return result


def _get_headers():
enc = (
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNfdG9rZW4iOiJ0"
+ "b2tlbiBhNTk2OTUwNjFhYzRkMjBkZjEwNTFlZDljOWZjNGI4M2Q0NzAyYzA3I"
+ "n0.POR6Iae_pSt0m6h-AaRi1X6QaRcnnfl9aZbTSV0BUJw"
)
return {"Authorization": util.decode(enc).get("public_token")}
7 changes: 0 additions & 7 deletions apio/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from os.path import isdir, isfile, join, dirname, exists, normpath
from pathlib import Path

import jwt
import click
import semantic_version
from serial.tools.list_ports import comports
Expand Down Expand Up @@ -713,12 +712,6 @@ def decorate(*args, **kwargs):
return decorate


def decode(text):
"""DOC: TODO"""

return jwt.decode(text, "secret", algorithm="HS256")


def get_serial_ports():
"""DOC: TODO"""

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ requires = [
'click',
'semantic_version>=2.5.0,<3',
'requests>=2.4.0,<3',
'pyjwt>=1.5.3,<2',
'colorama',
'pyserial>=3,<4',
'wheel>=0.35.0,<1'
Expand Down

0 comments on commit 31cf1af

Please sign in to comment.