File tree Expand file tree Collapse file tree 5 files changed +15
-15
lines changed
Expand file tree Collapse file tree 5 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ PyYAML==5.2
22Pygments==2.5.2
33Sphinx-Substitution-Extensions==2019.6.15.0
44Sphinx==2.2.2
5- VWS-Python-Mock==2019.9.28.0
5+ VWS-Python-Mock==2019.12.7.1
66autoflake==1.3.1
77check-manifest==0.40
88codecov==2.0.15 # Upload coverage data
99doc8==0.8.0
1010dodgy==0.1.9 # Look for uploaded secrets
11- dulwich==0.19.13
11+ dulwich==0.19.14
1212flake8-commas==2.0.0 # Require silicon valley commas
1313flake8-quotes==2.1.1 # Require single quotes
1414flake8==3.7.9 # Lint
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true
123123
124124[metadata]
125125name = VWS Python
126- description = ' Interact with the Vuforia Web Services (VWS) API.'
126+ description = Interact with the Vuforia Web Services (VWS) API.
127127long_description = file: README.rst
128128keywords = vuforia client
129129license = MIT License
@@ -134,7 +134,7 @@ classifiers =
134134 Programming Language :: Python :: 3.8
135135 License :: OSI Approved :: MIT License
136136 Development Status :: 5 - Production/Stable
137- url = ' https://vws-python.readthedocs.io'
137+ url = https://vws-python.readthedocs.io
138138author = Adam Dangoor
139139140140
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ def rfc_1123_date() -> str:
2828
2929
3030def authorization_header ( # pylint: disable=too-many-arguments
31- access_key : bytes ,
32- secret_key : bytes ,
31+ access_key : str ,
32+ secret_key : str ,
3333 method : str ,
3434 content : bytes ,
3535 content_type : str ,
3636 date : str ,
3737 request_path : str ,
38- ) -> bytes :
38+ ) -> str :
3939 """
4040 Return an `Authorization` header which can be used for a request made to
4141 the VWS API with the given attributes.
@@ -74,11 +74,11 @@ def authorization_header( # pylint: disable=too-many-arguments
7474 ]
7575 string_to_sign = '\n ' .join (components_to_sign )
7676 signature = compute_hmac_base64 (
77- key = secret_key ,
77+ key = secret_key . encode () ,
7878 data = bytes (
7979 string_to_sign ,
8080 encoding = 'utf-8' ,
8181 ),
8282 )
83- auth_header = b 'VWS %s:%s' % ( access_key , signature )
83+ auth_header = f 'VWS { access_key } : { signature . decode () } '
8484 return auth_header
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ def __init__(
3636 client_secret_key: A VWS client secret key.
3737 base_vwq_url: The base URL for the VWQ API.
3838 """
39- self ._client_access_key = client_access_key . encode ()
40- self ._client_secret_key = client_secret_key . encode ()
39+ self ._client_access_key = client_access_key
40+ self ._client_secret_key = client_secret_key
4141 self ._base_vwq_url = base_vwq_url
4242
4343 def query (
Original file line number Diff line number Diff line change 1919
2020
2121def _target_api_request (
22- server_access_key : bytes ,
23- server_secret_key : bytes ,
22+ server_access_key : str ,
23+ server_secret_key : str ,
2424 method : str ,
2525 content : bytes ,
2626 request_path : str ,
@@ -92,8 +92,8 @@ def __init__(
9292 server_secret_key: A VWS server secret key.
9393 base_vws_url: The base URL for the VWS API.
9494 """
95- self ._server_access_key = server_access_key . encode ()
96- self ._server_secret_key = server_secret_key . encode ()
95+ self ._server_access_key = server_access_key
96+ self ._server_secret_key = server_secret_key
9797 self ._base_vws_url = base_vws_url
9898
9999 def _make_request (
You can’t perform that action at this time.
0 commit comments