Skip to content
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

fix: upgrade FastAPI #389

Merged
merged 2 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ aiohttp==3.8.1
aiosignal==1.2.0
alembic==1.5.6
anyio==3.6.1
asgiref==3.5.2
asn1crypto==1.5.1
async-timeout==4.0.2
attrs==22.1.0
base58==2.1.1
bitarray==2.6.0
boto3==1.17.12
botocore==1.20.112
certifi==2022.6.15
certifi==2022.9.14
cffi==1.15.1
chardet==4.0.0
charset-normalizer==2.1.0
charset-normalizer==2.1.1
click==8.1.3
coincurve==14.0.0
cytoolz==0.12.0
Expand All @@ -25,9 +24,8 @@ eth-keys==0.3.4
eth-rlp==0.2.1
eth-typing==2.3.0
eth-utils==1.9.5
fastapi==0.75.2
fastapi==0.85.0
frozenlist==1.3.1
greenlet==1.1.2
gunicorn==20.1.0
h11==0.13.0
hexbytes==0.3.0
Expand All @@ -36,13 +34,13 @@ ipfshttpclient==0.7.0
jmespath==0.10.0
jsonschema==3.2.0
lru-dict==1.1.8
Mako==1.2.1
Mako==1.2.2
MarkupSafe==2.1.1
multiaddr==0.0.9
multidict==6.0.2
netaddr==0.8.0
parsimonious==0.8.1
protobuf==3.20.1
protobuf==3.20.2
psycopg2-binary==2.9.3
pycparser==2.21
pycryptodome==3.15.0
Expand All @@ -58,13 +56,13 @@ rlp==2.0.1
s3transfer==0.3.7
shared-memory-dict==0.5.0
six==1.16.0
sniffio==1.2.0
SQLAlchemy==1.4.40
starlette==0.17.1
sniffio==1.3.0
SQLAlchemy==1.4.41
starlette==0.20.4
toolz==0.12.0
typing_extensions==4.3.0
urllib3==1.26.11
uvicorn==0.17.6
urllib3==1.26.12
uvicorn==0.18.3
varint==1.0.2
web3==5.20.1
websockets==9.1
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ eth-keyfile==0.5.1
pysha3==1.0.2
coincurve==14.0.0
pydantic==1.8.2
fastapi==0.75.2
uvicorn==0.17.6
fastapi==0.85.0
uvicorn==0.18.3
gunicorn==20.1.0
boto3==1.17.12
alembic==1.5.6
Expand Down
22 changes: 11 additions & 11 deletions tests/test_utils_check_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_normal_1_1(self, db):

# test function
account, decrypted_eoa_password = check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
eoa_password=E2EEUtils.encrypt(self.eoa_password)
Expand All @@ -79,7 +79,7 @@ def test_normal_1_2(self, db):

# test function
account, decrypted_eoa_password = check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
eoa_password=self.eoa_password
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_normal_2_1(self, db):

# test function
account, decrypted_eoa_password = check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
auth_token=self.auth_token
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_normal_2_2(self, freezer, db):
# test function
freezer.move_to('2022-07-15 12:34:56')
account, decrypted_eoa_password = check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
auth_token=self.auth_token
Expand All @@ -162,7 +162,7 @@ def test_error_1(self, db):
# test function
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
eoa_password=E2EEUtils.encrypt(self.eoa_password)
Expand All @@ -183,7 +183,7 @@ def test_error_2(self, db):
# test function
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"]
)
Expand All @@ -203,7 +203,7 @@ def test_error_3_1(self, db):
# test function
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
eoa_password=E2EEUtils.encrypt("incorrect_password") # incorrect password
Expand All @@ -225,7 +225,7 @@ def test_error_3_2(self, db):
# test function
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
eoa_password="incorrect_password" # incorrect password
Expand All @@ -246,7 +246,7 @@ def test_error_4_1(self, db):
# test function
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
auth_token=self.eoa_password
Expand All @@ -273,7 +273,7 @@ def test_error_4_2(self, db):
# test function
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
auth_token="incorrect_token" # incorrect token
Expand Down Expand Up @@ -302,7 +302,7 @@ def test_error_4_3(self, freezer, db):
freezer.move_to('2022-07-15 12:34:56')
with pytest.raises(AuthorizationError):
check_auth(
request=Request(scope={"type": "http"}),
request=Request(scope={"type": "http", "client": ("192.168.1.1", 50000)}),
db=db,
issuer_address=test_account["address"],
auth_token=self.auth_token
Expand Down