Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 5348968

Browse files
authored
Merge pull request #9 from CSCfi/devel
Devel
2 parents 0a043f8 + 4b5386a commit 5348968

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ requests
33
python-swiftclient
44
keystoneauth1
55
git+https://github.com/cscfi/swift-browser-ui.git
6+
certifi

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
'python-swiftclient',
1818
'keystoneauth1',
1919
'gunicorn',
20+
'certifi',
2021
'uvloop',
2122
"swift-browser-ui"
22-
"@ git+https://github.com/cscfi/swift-browser-ui.git@v0.7.1"
23+
"@ git+https://github.com/cscfi/swift-browser-ui.git"
2324
],
2425
extras_require={
2526
'test': ['tox', 'pytest', 'pytest-cov', 'coverage',

swift_upload_runner/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Runner for swift-browser-ui upload and replication operations."""
22

33
__name__ = 'swift_upload_runner'
4-
__version__ = '0.1.2'
4+
__version__ = '0.1.3'
55
__author__ = 'CSC Developers'
66
__license__ = 'MIT License'

swift_upload_runner/auth.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import typing
77
import hmac
88
import time
9+
import secrets
910

1011
import aiohttp.web
1112

@@ -85,7 +86,7 @@ async def test_signature(
8586
byte_message,
8687
digestmod="sha256"
8788
).hexdigest()
88-
if digest == signature:
89+
if secrets.compare_digest(digest, signature):
8990
return True
9091
raise aiohttp.web.HTTPUnauthorized(
9192
reason="Missing valid query signature"

swift_upload_runner/download.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def download_into_queue(
120120
"X-Auth-Token": self.auth.get_token(),
121121
"Accept-Encoding": "identity"
122122
},
123-
stream=True
123+
stream=True,
124+
verify=True
124125
) as req:
125126
print(f"""
126127
Request headers:
@@ -419,7 +420,8 @@ def get_object_listing(
419420
),
420421
headers={
421422
"X-Auth-Token": self.auth.get_token()
422-
}
423+
},
424+
verify=True
423425
) as req:
424426
self.fs = self._parse_archive_fs([
425427
i.split("/") for i in req.text.lstrip().rstrip().split("\n")

0 commit comments

Comments
 (0)