http-message-signatures 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- http_message_signatures/_algorithms.py +2 -2
- http_message_signatures/resolvers.py +1 -1
- http_message_signatures/signatures.py +5 -2
- {http_message_signatures-0.5.0.dist-info → http_message_signatures-0.7.0.dist-info}/METADATA +25 -18
- http_message_signatures-0.7.0.dist-info/RECORD +13 -0
- {http_message_signatures-0.5.0.dist-info → http_message_signatures-0.7.0.dist-info}/WHEEL +1 -2
- {http_message_signatures-0.5.0.dist-info → http_message_signatures-0.7.0.dist-info/licenses}/LICENSE +0 -24
- http_message_signatures-0.7.0.dist-info/licenses/NOTICE +10 -0
- http_message_signatures/version.py +0 -16
- http_message_signatures-0.5.0.dist-info/RECORD +0 -14
- http_message_signatures-0.5.0.dist-info/top_level.txt +0 -1
@@ -91,9 +91,9 @@ class ECDSA_P256_SHA256(HTTPSignatureAlgorithm, PEMKeyLoader):
|
|
91
91
|
raise HTTPMessageSignaturesException("Unexpected public key type")
|
92
92
|
if self.private_key and not isinstance(self.private_key, ec.EllipticCurvePrivateKey):
|
93
93
|
raise HTTPMessageSignaturesException("Unexpected private key type")
|
94
|
-
if self.public_key and
|
94
|
+
if self.public_key and not isinstance(self.public_key.curve, ec.SECP256R1):
|
95
95
|
raise HTTPMessageSignaturesException("Unexpected elliptic curve type in public key")
|
96
|
-
if self.private_key and
|
96
|
+
if self.private_key and not isinstance(self.private_key.curve, ec.SECP256R1):
|
97
97
|
raise HTTPMessageSignaturesException("Unexpected elliptic curve type in private key")
|
98
98
|
self.signature_algorithm = ec.ECDSA(hashes.SHA256())
|
99
99
|
|
@@ -26,7 +26,7 @@ class HTTPSignatureComponentResolver:
|
|
26
26
|
self.message_type = "request"
|
27
27
|
if hasattr(message, "status_code"):
|
28
28
|
self.message_type = "response"
|
29
|
-
self.url = message.url
|
29
|
+
self.url = str(message.url)
|
30
30
|
self.headers = CaseInsensitiveDict(message.headers)
|
31
31
|
|
32
32
|
def resolve(self, component_node: http_sfv.Item):
|
@@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)
|
|
14
14
|
|
15
15
|
|
16
16
|
class HTTPSignatureHandler:
|
17
|
-
signature_metadata_parameters = {"alg", "created", "expires", "keyid", "nonce"}
|
17
|
+
signature_metadata_parameters = {"alg", "created", "expires", "keyid", "nonce", "tag"}
|
18
18
|
|
19
19
|
def __init__(
|
20
20
|
self,
|
@@ -46,7 +46,7 @@ class HTTPSignatureHandler:
|
|
46
46
|
raise HTTPMessageSignaturesException(f'Component ID "{component_key}" contains newline character')
|
47
47
|
if component_key in sig_elements:
|
48
48
|
raise HTTPMessageSignaturesException(
|
49
|
-
f'Component ID "{component_key}" appeared multiple times in
|
49
|
+
f'Component ID "{component_key}" appeared multiple times in signature input'
|
50
50
|
)
|
51
51
|
sig_elements[component_key] = component_value
|
52
52
|
sig_params_node = http_sfv.InnerList(covered_component_ids)
|
@@ -79,6 +79,7 @@ class HTTPMessageSigner(HTTPSignatureHandler):
|
|
79
79
|
expires: Optional[datetime.datetime] = None,
|
80
80
|
nonce: Optional[str] = None,
|
81
81
|
label: Optional[str] = None,
|
82
|
+
tag: Optional[str] = None,
|
82
83
|
include_alg: bool = True,
|
83
84
|
covered_component_ids: Sequence[str] = ("@method", "@authority", "@target-uri"),
|
84
85
|
):
|
@@ -93,6 +94,8 @@ class HTTPMessageSigner(HTTPSignatureHandler):
|
|
93
94
|
signature_params["expires"] = int(expires.timestamp())
|
94
95
|
if nonce:
|
95
96
|
signature_params["nonce"] = nonce
|
97
|
+
if tag:
|
98
|
+
signature_params["tag"] = tag
|
96
99
|
if include_alg:
|
97
100
|
signature_params["alg"] = self.signature_algorithm.algorithm_id
|
98
101
|
covered_component_nodes = self._parse_covered_component_ids(covered_component_ids)
|
{http_message_signatures-0.5.0.dist-info → http_message_signatures-0.7.0.dist-info}/METADATA
RENAMED
@@ -1,13 +1,15 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: http-message-signatures
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.7.0
|
4
4
|
Summary: An implementation of the IETF HTTP Message Signatures draft standard
|
5
|
-
|
5
|
+
Project-URL: Homepage, https://github.com/pyauth/http-message-signatures
|
6
6
|
Author: Andrey Kislyuk
|
7
7
|
Author-email: kislyuk@gmail.com
|
8
|
+
Maintainer: Andrey Kislyuk
|
9
|
+
Maintainer-email: kislyuk@gmail.com
|
8
10
|
License: Apache Software License
|
9
|
-
|
10
|
-
|
11
|
+
License-File: LICENSE
|
12
|
+
License-File: NOTICE
|
11
13
|
Classifier: Intended Audience :: Developers
|
12
14
|
Classifier: License :: OSI Approved :: Apache Software License
|
13
15
|
Classifier: Operating System :: MacOS :: MacOS X
|
@@ -18,24 +20,26 @@ Classifier: Programming Language :: Python :: 3.9
|
|
18
20
|
Classifier: Programming Language :: Python :: 3.10
|
19
21
|
Classifier: Programming Language :: Python :: 3.11
|
20
22
|
Classifier: Programming Language :: Python :: 3.12
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
21
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
22
|
-
|
23
|
-
Requires-Dist:
|
24
|
-
Requires-Dist:
|
25
|
+
Requires-Python: >=3.8
|
26
|
+
Requires-Dist: cryptography>=36.0.2
|
27
|
+
Requires-Dist: http-sfv>=0.9.3
|
25
28
|
Provides-Extra: tests
|
26
|
-
Requires-Dist:
|
27
|
-
Requires-Dist: coverage
|
28
|
-
Requires-Dist:
|
29
|
-
Requires-Dist:
|
30
|
-
Requires-Dist:
|
31
|
-
Requires-Dist:
|
32
|
-
Requires-Dist:
|
29
|
+
Requires-Dist: build; extra == 'tests'
|
30
|
+
Requires-Dist: coverage; extra == 'tests'
|
31
|
+
Requires-Dist: flake8; extra == 'tests'
|
32
|
+
Requires-Dist: mypy; extra == 'tests'
|
33
|
+
Requires-Dist: requests; extra == 'tests'
|
34
|
+
Requires-Dist: ruff; extra == 'tests'
|
35
|
+
Requires-Dist: wheel; extra == 'tests'
|
36
|
+
Description-Content-Type: text/x-rst
|
33
37
|
|
34
38
|
http-message-signatures: An implementation of RFC 9421, the IETF HTTP Message Signatures standard
|
35
39
|
=================================================================================================
|
36
40
|
|
37
41
|
*http-message-signatures* is an implementation of the IETF
|
38
|
-
`RFC 9421 HTTP Message Signatures <https://datatracker.ietf.org/doc/rfc9421/>`_
|
42
|
+
`RFC 9421 HTTP Message Signatures <https://datatracker.ietf.org/doc/rfc9421/>`_ standard in
|
39
43
|
Python.
|
40
44
|
|
41
45
|
Installation
|
@@ -107,7 +111,7 @@ digest etc.)
|
|
107
111
|
|
108
112
|
Authors
|
109
113
|
-------
|
110
|
-
* Andrey Kislyuk
|
114
|
+
* `Andrey Kislyuk <https://kislyuk.com>`
|
111
115
|
|
112
116
|
Links
|
113
117
|
-----
|
@@ -124,4 +128,7 @@ Please report bugs, issues, feature requests, etc. on `GitHub <https://github.co
|
|
124
128
|
|
125
129
|
License
|
126
130
|
-------
|
127
|
-
Licensed under the terms of the
|
131
|
+
Copyright 2017-2024, Andrey Kislyuk and http-message-signatures contributors. Licensed under the terms of the
|
132
|
+
`Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_. Distribution of attribution information,
|
133
|
+
LICENSE and NOTICE files with source copies of this package and derivative works is **REQUIRED** as specified by the
|
134
|
+
Apache License.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
http_message_signatures/__init__.py,sha256=uGQgs5h8d16QPBbquDHzgD0SC1vF-Y8vXFWQtDHw3PE,439
|
2
|
+
http_message_signatures/_algorithms.py,sha256=XW1yajZqG8XmL_SaoWSp_ya-yfENCBt7A3F02Yf3ZXg,6468
|
3
|
+
http_message_signatures/algorithms.py,sha256=CXHOcleb8dkdTSUxTdNfl-d0XkVxSXGmf9ugKe_xGaY,190
|
4
|
+
http_message_signatures/exceptions.py,sha256=kEF1-8-ACSQL97vfIo_bwv-Hh8pdtjXjRDbsrFKlgA4,260
|
5
|
+
http_message_signatures/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
http_message_signatures/resolvers.py,sha256=6w01CdK-QA8JEQlj6JB7axk1cK5xs74HX_6QVyq0rVE,3265
|
7
|
+
http_message_signatures/signatures.py,sha256=BXFGNYcq4zPDkmfZ7WSKT-MhxMZB3acpiapJEzX-zTg,9286
|
8
|
+
http_message_signatures/structures.py,sha256=xCz9W4Rmjj541GgGdjZeKNObxLFqN8mdZFrsOg9g9Yc,1575
|
9
|
+
http_message_signatures-0.7.0.dist-info/METADATA,sha256=jgFNOEijhUfolXlnPoVtSolNKfo-wMoqMz4o9gmaw8Y,6293
|
10
|
+
http_message_signatures-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
11
|
+
http_message_signatures-0.7.0.dist-info/licenses/LICENSE,sha256=h-3wDrOtt7Mou9MC2Hz07aB0PwvDbGAYnVLAXlFqBAI,9144
|
12
|
+
http_message_signatures-0.7.0.dist-info/licenses/NOTICE,sha256=uffnI3KUzenxf-zvcOBEIbaShnRk1fMnvgSzdy1C2M0,634
|
13
|
+
http_message_signatures-0.7.0.dist-info/RECORD,,
|
{http_message_signatures-0.5.0.dist-info → http_message_signatures-0.7.0.dist-info/licenses}/LICENSE
RENAMED
@@ -165,27 +165,3 @@ incurred by, or claims asserted against, such Contributor by reason of your
|
|
165
165
|
accepting any such warranty or additional liability.
|
166
166
|
|
167
167
|
END OF TERMS AND CONDITIONS
|
168
|
-
|
169
|
-
APPENDIX: How to apply the Apache License to your work
|
170
|
-
|
171
|
-
To apply the Apache License to your work, attach the following boilerplate
|
172
|
-
notice, with the fields enclosed by brackets "[]" replaced with your own
|
173
|
-
identifying information. (Don't include the brackets!) The text should be
|
174
|
-
enclosed in the appropriate comment syntax for the file format. We also
|
175
|
-
recommend that a file or class name and description of purpose be included on
|
176
|
-
the same "printed page" as the copyright notice for easier identification within
|
177
|
-
third-party archives.
|
178
|
-
|
179
|
-
Copyright [yyyy] [name of copyright owner]
|
180
|
-
|
181
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
182
|
-
you may not use this file except in compliance with the License.
|
183
|
-
You may obtain a copy of the License at
|
184
|
-
|
185
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
186
|
-
|
187
|
-
Unless required by applicable law or agreed to in writing, software
|
188
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
189
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
190
|
-
See the License for the specific language governing permissions and
|
191
|
-
limitations under the License.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
http-message-signatures is a free open source implementation of the
|
2
|
+
IETF HTTP Message Signatures standard, RFC 9421. This project is
|
3
|
+
staffed by volunteers. If you are using http-message-signatures in a
|
4
|
+
for-profit project, please contribute to its development and
|
5
|
+
maintenance using the "Sponsor" button on the GitHub project page,
|
6
|
+
https://github.com/pyauth/http-message-signatures. If you are looking
|
7
|
+
for support with commercial applications based on
|
8
|
+
http-message-signatures, please donate and contact its developers
|
9
|
+
using the issue tracker on the http-message-signatures project page or
|
10
|
+
the contact information listed in README.rst.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# file generated by setuptools_scm
|
2
|
-
# don't change, don't track in version control
|
3
|
-
TYPE_CHECKING = False
|
4
|
-
if TYPE_CHECKING:
|
5
|
-
from typing import Tuple, Union
|
6
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
7
|
-
else:
|
8
|
-
VERSION_TUPLE = object
|
9
|
-
|
10
|
-
version: str
|
11
|
-
__version__: str
|
12
|
-
__version_tuple__: VERSION_TUPLE
|
13
|
-
version_tuple: VERSION_TUPLE
|
14
|
-
|
15
|
-
__version__ = version = '0.5.0'
|
16
|
-
__version_tuple__ = version_tuple = (0, 5, 0)
|
@@ -1,14 +0,0 @@
|
|
1
|
-
http_message_signatures/__init__.py,sha256=uGQgs5h8d16QPBbquDHzgD0SC1vF-Y8vXFWQtDHw3PE,439
|
2
|
-
http_message_signatures/_algorithms.py,sha256=BhYboDD1becIFsvflpfr7kwr1nOzV9rjezkbl3iAjCg,6452
|
3
|
-
http_message_signatures/algorithms.py,sha256=CXHOcleb8dkdTSUxTdNfl-d0XkVxSXGmf9ugKe_xGaY,190
|
4
|
-
http_message_signatures/exceptions.py,sha256=kEF1-8-ACSQL97vfIo_bwv-Hh8pdtjXjRDbsrFKlgA4,260
|
5
|
-
http_message_signatures/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
http_message_signatures/resolvers.py,sha256=h-kdnS1Ie3Xv5z22GrE_HkAHHONJ66W3kkEbReGLGLE,3260
|
7
|
-
http_message_signatures/signatures.py,sha256=CwIWQ4kHittEQxMnaPxL7EizS3pKZ6G2SjwAWan0Xno,9189
|
8
|
-
http_message_signatures/structures.py,sha256=xCz9W4Rmjj541GgGdjZeKNObxLFqN8mdZFrsOg9g9Yc,1575
|
9
|
-
http_message_signatures/version.py,sha256=aeBju2l8GTMwAhIRG_c2Q_oVPFacRkZZwGtxmvFCGPQ,411
|
10
|
-
http_message_signatures-0.5.0.dist-info/LICENSE,sha256=c7p036pSC0mkAbXSFFmoUjoUbzt1GKgz7qXvqFEwv2g,10273
|
11
|
-
http_message_signatures-0.5.0.dist-info/METADATA,sha256=ts9Kx-nNSh7Fmy--q0421OcMFWS32hGOOFBmC2vcOW8,5859
|
12
|
-
http_message_signatures-0.5.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
13
|
-
http_message_signatures-0.5.0.dist-info/top_level.txt,sha256=9-VThl-09OI1yQ1ejs76InY3ENi24isY60cUUZrviiw,24
|
14
|
-
http_message_signatures-0.5.0.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
http_message_signatures
|