fora-protocol-sdk 1.0.3__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.
Files changed (50) hide show
  1. fora_protocol_sdk-1.0.3.dist-info/METADATA +58 -0
  2. fora_protocol_sdk-1.0.3.dist-info/RECORD +50 -0
  3. fora_protocol_sdk-1.0.3.dist-info/WHEEL +5 -0
  4. fora_protocol_sdk-1.0.3.dist-info/licenses/LICENSE +201 -0
  5. fora_protocol_sdk-1.0.3.dist-info/top_level.txt +1 -0
  6. fora_sdk/__init__.py +307 -0
  7. fora_sdk/_endpoint_rule.py +63 -0
  8. fora_sdk/_hostref.py +391 -0
  9. fora_sdk/_jsondepth.py +71 -0
  10. fora_sdk/_wire_names.py +22 -0
  11. fora_sdk/acceptance.py +43 -0
  12. fora_sdk/b64.py +54 -0
  13. fora_sdk/client/__init__.py +476 -0
  14. fora_sdk/client/_call.py +306 -0
  15. fora_sdk/client/_read.py +168 -0
  16. fora_sdk/client/_verbs.py +943 -0
  17. fora_sdk/client/content.py +398 -0
  18. fora_sdk/client/errors.py +204 -0
  19. fora_sdk/client/route.py +190 -0
  20. fora_sdk/core.py +560 -0
  21. fora_sdk/crossfield.py +257 -0
  22. fora_sdk/errordetail.py +322 -0
  23. fora_sdk/hashurl.py +17 -0
  24. fora_sdk/hosts.py +248 -0
  25. fora_sdk/httpsig.py +350 -0
  26. fora_sdk/idempotency.py +33 -0
  27. fora_sdk/keyresolver.py +39 -0
  28. fora_sdk/licenseterm.py +441 -0
  29. fora_sdk/money.py +67 -0
  30. fora_sdk/multisig_parse.py +251 -0
  31. fora_sdk/pop.py +273 -0
  32. fora_sdk/py.typed +0 -0
  33. fora_sdk/regschema.py +1427 -0
  34. fora_sdk/resolvers/__init__.py +83 -0
  35. fora_sdk/resolvers/_http.py +410 -0
  36. fora_sdk/resolvers/_ssrf.py +177 -0
  37. fora_sdk/resolvers/errors.py +130 -0
  38. fora_sdk/resolvers/offer_key_cache.py +125 -0
  39. fora_sdk/resolvers/registration_requirements.py +256 -0
  40. fora_sdk/resolvers/wba.py +675 -0
  41. fora_sdk/resolvers/wellknown.py +248 -0
  42. fora_sdk/scopes.py +43 -0
  43. fora_sdk/server_verify.py +623 -0
  44. fora_sdk/signedurl.py +230 -0
  45. fora_sdk/signing_transport.py +202 -0
  46. fora_sdk/sync/__init__.py +270 -0
  47. fora_sdk/thumbprint.py +34 -0
  48. fora_sdk/window.py +63 -0
  49. fora_sdk/wire.py +110 -0
  50. fora_sdk/wire_canon.py +149 -0
@@ -0,0 +1,58 @@
1
+ Metadata-Version: 2.4
2
+ Name: fora-protocol-sdk
3
+ Version: 1.0.3
4
+ Summary: FORA protocol SDK for Python: the IO-free protocol mechanics (thumbprint, signed-URL verification, RFC 9421 request signing and verification, offer and acceptance signatures, cross-field validation), the key and endpoint resolvers and the Connect-unary JSON client.
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://fora-protocol.org
7
+ Project-URL: Source, https://github.com/FORA-Protocol/protocol
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: fora-protocol==1.0.3
12
+ Requires-Dist: cryptography>=44
13
+ Requires-Dist: httpx<0.29,>=0.27
14
+ Requires-Dist: httpcore<2,>=1.0
15
+ Requires-Dist: pydantic>=2.9
16
+ Requires-Dist: rfc8785>=0.1.2
17
+ Requires-Dist: jsonschema>=4.23
18
+ Provides-Extra: test
19
+ Requires-Dist: pytest>=8; extra == "test"
20
+ Requires-Dist: types-jsonschema>=4.23; extra == "test"
21
+ Dynamic: license-file
22
+
23
+ # fora-protocol-sdk
24
+
25
+ FORA protocol SDK for Python. One distribution, the `fora_sdk` package, with two layers:
26
+
27
+ - the IO-free protocol mechanics: thumbprint, signed-URL verification, RFC 9421 request
28
+ signing and verification, offer and acceptance signatures, canonicalization and
29
+ cross-field validation;
30
+ - the IO tiers built on them: the key and endpoint resolvers (`fora_sdk.resolvers`) and
31
+ the Connect-unary JSON client (`fora_sdk.client`, with `fora_sdk.sync` as its blocking
32
+ facade).
33
+
34
+ The generated wire types are a separate distribution, `fora-protocol`: Pydantic v2
35
+ models at `wire.models` and the registered vocabulary at `vocab.*`. This package pins it
36
+ to its own version and installs it as a dependency.
37
+
38
+ ```sh
39
+ pip install fora-protocol-sdk
40
+ ```
41
+
42
+ Python: 3.11 or later. The package ships `py.typed`, so mypy reads its annotations.
43
+
44
+ `httpx` and `httpcore` are installed with every consumer, including one that uses only
45
+ the IO-free mechanics: keeping them non-optional is what makes their version ceilings,
46
+ which guard the resolvers' SSRF seam, bind every install.
47
+
48
+ ```python
49
+ from fora_sdk.thumbprint import thumbprint
50
+ from fora_sdk.sync import Client
51
+ from wire.models import Offer
52
+ ```
53
+
54
+ `fora-protocol` installs the top-level import packages `wire` and `vocab`, so it can
55
+ collide with another distribution that owns either name; install it into an environment
56
+ that does not. Its README explains the tradeoff. Source, tests and the release process
57
+ are in [FORA-Protocol/protocol](https://github.com/FORA-Protocol/protocol) under
58
+ `sdk/python` and `gen/python`. Licensed under Apache-2.0.
@@ -0,0 +1,50 @@
1
+ fora_protocol_sdk-1.0.3.dist-info/licenses/LICENSE,sha256=GctyeCvYvrwywI8_pLR6sz8wLQvDvDJT5tOpstH3gTM,11298
2
+ fora_sdk/__init__.py,sha256=X63cPA7aF_aun3FTHJcgVdLG1K0fKtwsLiOmEWg4IA0,8693
3
+ fora_sdk/_endpoint_rule.py,sha256=nRaSwIKAMGrjh9rENDoTo5gzXueX-BxmIq1Tp79RKD8,3279
4
+ fora_sdk/_hostref.py,sha256=r_gbVbhN2ur-wsSWiHbGpbcOOj5f8qwSycUKesT_9zQ,18795
5
+ fora_sdk/_jsondepth.py,sha256=wHMvOylR7cOAHkbwiLwPq-VjJeQOr5I3rf6NQefk580,2909
6
+ fora_sdk/_wire_names.py,sha256=yfsLgtJB5i3NvEYkSAGliBbbKCxhWV8dmDhkxQr2a9s,1087
7
+ fora_sdk/acceptance.py,sha256=lkhBtLufK63aUwLrI5p0u9sm92-c_v4K9nQOyqrxrg4,1680
8
+ fora_sdk/b64.py,sha256=DChtUM8ttZH8aCRORLKevSdhwNx1AjKuSiil63PXJF8,2495
9
+ fora_sdk/core.py,sha256=_O90D1-wYNaYpkFU0HzIunl-oNRBFqq1sBF5HuxNJQs,23048
10
+ fora_sdk/crossfield.py,sha256=VSgRCLFJFrguOH0FDeL8M71KPhHy5IdYASLah-ddcvE,10851
11
+ fora_sdk/errordetail.py,sha256=LUXgJEoyld_qdifmbAGedZd39_VKYVGvNozEAs-Yayw,14778
12
+ fora_sdk/hashurl.py,sha256=eTceEXApWHpVU_mhl0zRPmhY4wYf3Bu5gxQgWkuRf9U,648
13
+ fora_sdk/hosts.py,sha256=t_ZL4wFTnVCpP5cJmlQxIu7RxuPppVSLukJ3ST5qvoA,12675
14
+ fora_sdk/httpsig.py,sha256=bMt395rlnkOKLTpft4F45oBqtAGGYC_RYP6psxqH5SU,12766
15
+ fora_sdk/idempotency.py,sha256=MBFk5Z76i24DQb8VkG9riZCz9rI9xq_liDSQMwjZr1E,1253
16
+ fora_sdk/keyresolver.py,sha256=8mx5WxmMp0Peh-kxmb1B6dt_oCmXxJfgQMKoGKM8G78,1548
17
+ fora_sdk/licenseterm.py,sha256=qOfd75owOQCZbLS8MppELiSDNYGclh-hhhQmjDXYHtg,19026
18
+ fora_sdk/money.py,sha256=pFxxr2xqV3Woq0FYgUP4xX1qeKP0Qm_F9r_NvrpUbuo,2853
19
+ fora_sdk/multisig_parse.py,sha256=OfWpQ2Db9TaNoxx859mUKDCfZQDddwl5JtDuCKVkcAk,8394
20
+ fora_sdk/pop.py,sha256=aibnVl7CSQIwDzm-AKCw8lNi8ZUcdmPgpp02d0Q7etc,9913
21
+ fora_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ fora_sdk/regschema.py,sha256=N3GjXsxtuEVkXhwHAxToQyuPor-kOFabtbKbzIVRMRM,66980
23
+ fora_sdk/scopes.py,sha256=s9wYp2rmk_QqJv3LbjnVIl-3rGSDIQIjyFGuzozWxcA,1725
24
+ fora_sdk/server_verify.py,sha256=vZLZozHr6Euad7_kwXR6JYb3Wm9LRTvWSTj63boOR4o,26680
25
+ fora_sdk/signedurl.py,sha256=wi17EWBu4WAVDGlZArYPb7VlOTmCrx1R11n1z7CcZKo,8382
26
+ fora_sdk/signing_transport.py,sha256=5bI6GJxTYYDQFdHJSBmmR-1MLuHlZSiFnQfu50eDg5E,8532
27
+ fora_sdk/thumbprint.py,sha256=8hEtZUvMzqENnjpWJL-TNr2CIPd1L8-49eG73f128W0,1477
28
+ fora_sdk/window.py,sha256=F1MEJjfY4y2BNYekG664D678aF6RKlZSPVsgXs6VXME,2566
29
+ fora_sdk/wire.py,sha256=tD_iD44BhDBDyWxx-LdpqHnf-RTqQn62ZGufQpAdFsI,5671
30
+ fora_sdk/wire_canon.py,sha256=MSTxevMwQ36DFHUPyXUWU0nPNzEqBkpzK5B3btHefXI,6880
31
+ fora_sdk/client/__init__.py,sha256=zNuBP5KDK4TpW2ew2Nh0eYsbk0-ObrL_LiqysoC7iWk,21897
32
+ fora_sdk/client/_call.py,sha256=JqjXFFlu_kh7nOGa2FArdALfCBXjiIfSFOWbHv1k3p4,13390
33
+ fora_sdk/client/_read.py,sha256=UjFh_EfyU_wXh1nqlJgLmtrx-hD20199DdETsK9WnBI,7057
34
+ fora_sdk/client/_verbs.py,sha256=xMSxFWLXKHr89wAW4zHIB_06e3XsBFs3npVOXwDNKX0,42302
35
+ fora_sdk/client/content.py,sha256=2rU1tlIrJjgsNQM54BF4zTCpUNGiZhb_E8KRX4FDO1k,18778
36
+ fora_sdk/client/errors.py,sha256=H2-i9dK3T79QiqMqd3VM1_xhKAd_YBQBmuXoScDanoU,9308
37
+ fora_sdk/client/route.py,sha256=zDUP-00Rhnh-QqqJwhhhtQPt_nVQ9_Fvy2i_j9uTq9U,10165
38
+ fora_sdk/resolvers/__init__.py,sha256=9I388jxf-TOYQb51kuvM-8xL8YABJbU2O9ALdKZ_PR0,2608
39
+ fora_sdk/resolvers/_http.py,sha256=NuSPy9bW2RP0ZzvLC3KYXom_ryAhiXd82J-ofCMiKoQ,20499
40
+ fora_sdk/resolvers/_ssrf.py,sha256=qZ-0vLPkOjfJqqrQKTlrS3LbsrflgBk2bgLsv4OmMsg,7533
41
+ fora_sdk/resolvers/errors.py,sha256=CfNsRdHIddOoRp6iqTD6yrLiChQsytAORhehtlUh-HQ,5952
42
+ fora_sdk/resolvers/offer_key_cache.py,sha256=xMjDLkTiMszFOZuV_tuymqSDDvcyLbWbYirGzaXzo58,5622
43
+ fora_sdk/resolvers/registration_requirements.py,sha256=KInljAhD5CgP1jfEEtgiHsa6VTmDTpX2anfUDkZ7rlk,11896
44
+ fora_sdk/resolvers/wba.py,sha256=YTOWXX7Cwu2btnfdrIcbwP7u5BOIGgMycg2bc22AgcM,31271
45
+ fora_sdk/resolvers/wellknown.py,sha256=WAT90MTWuYLzj9yFK27g6iXnZUGLE2W7UOP6bCGScmM,10036
46
+ fora_sdk/sync/__init__.py,sha256=PeuZ4sQaPKCFjNfKNKUN4_tKAm_moVqWgcAzeK4jRCM,11897
47
+ fora_protocol_sdk-1.0.3.dist-info/METADATA,sha256=9IxfS8w_JoYu63e3aZ7K5cwVKk_2g9XqFXJO1CxEG_w,2530
48
+ fora_protocol_sdk-1.0.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
49
+ fora_protocol_sdk-1.0.3.dist-info/top_level.txt,sha256=UuGySyjOda13xXH0BtxMHBdsukHi8QnR6jRCJlTTJ0w,9
50
+ fora_protocol_sdk-1.0.3.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 FORA-Protocol contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ fora_sdk
fora_sdk/__init__.py ADDED
@@ -0,0 +1,307 @@
1
+ """FORA L1 protocol-mechanics helpers (ADR-020 tree sdk/{go,ts,python}/).
2
+
3
+ Stateless, IO-free protocol mechanics — RFC 7638 thumbprint, Ed25519 signed-URL
4
+ verify, RFC 9421 request sign/verify + GET proof-of-possession (both faces),
5
+ offer-acceptance sign/verify, base64url codec, and cross-field (message-CEL)
6
+ validation — byte-parity-guarded against the sdk/go oracle. Clock and key
7
+ resolution are injected (ADR-020 §1/§4); the helpers hold no state and touch no
8
+ IO.
9
+
10
+ Acceptance canonicalization is JCS (RFC 8785): the canonical names are the
11
+ ``*_jcs`` forms from :mod:`fora_sdk.core`; the unsuffixed names are aliases kept
12
+ for continuity (see :mod:`fora_sdk.acceptance`).
13
+
14
+ ``Client`` and ``BrokerClient`` re-exported here are the ASYNC faces, which are the
15
+ core; the blocking facade lives at :mod:`fora_sdk.sync` under the same names and is
16
+ not flattened into this namespace, because two classes called ``Client`` in one
17
+ namespace would make the choice between them a matter of which import won.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ from .acceptance import (
23
+ canonical_acceptance_payload,
24
+ sign_offer_acceptance,
25
+ verify_offer_acceptance,
26
+ )
27
+ from .b64 import b64url_decode, b64url_nopad
28
+ from .client import (
29
+ BrokerClient,
30
+ CallError,
31
+ CallErrorKind,
32
+ CatalogClient,
33
+ Client,
34
+ ClientConfig,
35
+ Content,
36
+ EndpointResolver,
37
+ Validation,
38
+ )
39
+ from .core import (
40
+ ACCEPTANCE_SIGNATURE_ALGORITHM,
41
+ OFFER_SIGNATURE_ALGORITHM,
42
+ DiscoveryResult,
43
+ Mode,
44
+ OfferGroupResult,
45
+ RejectedOffer,
46
+ Result,
47
+ VerifiedOffer,
48
+ Verifier,
49
+ canonical_offer_payload,
50
+ jcs_acceptance_payload,
51
+ jcs_request_acceptance_payload,
52
+ sign_offer_acceptance_jcs,
53
+ sign_offer_jcs,
54
+ sign_request_acceptance_jcs,
55
+ verify_offer_acceptance_jcs,
56
+ verify_request_acceptance_jcs,
57
+ )
58
+ from .crossfield import cross_field_rule_ids
59
+ from .errordetail import (
60
+ ERROR_DETAIL_TYPE,
61
+ REASON_FIELDS,
62
+ catalog_rejection_detail,
63
+ dispute_failure_detail,
64
+ domain_verification_failure_detail,
65
+ error_detail_from,
66
+ parse_error_detail,
67
+ reason,
68
+ registration_failure_detail,
69
+ retrieval_auth_failure_detail,
70
+ transaction_denial_detail,
71
+ usage_report_rejection_detail,
72
+ )
73
+ from .hashurl import hash_url
74
+ from .hosts import (
75
+ BARE_DOMAIN_PATTERN,
76
+ MAX_BARE_DOMAIN_LEN,
77
+ AudienceVerdict,
78
+ check_audience,
79
+ host_anchored,
80
+ host_of,
81
+ is_bare_domain,
82
+ is_bare_host,
83
+ )
84
+ from .httpsig import (
85
+ MultisigVerdict,
86
+ RejectReason,
87
+ ReplayStore,
88
+ append_signature,
89
+ content_digest,
90
+ sign_request,
91
+ verify_multisig_request_server,
92
+ verify_request,
93
+ verify_request_server,
94
+ )
95
+ from .idempotency import generate_idempotency_key, validate_idempotency_key
96
+ from .keyresolver import KeyResolver, StaticKeyResolver
97
+ from .licenseterm import (
98
+ RULE_OBLIGATION_OTHER_REQUIRES_DETAIL,
99
+ RULE_PRICING_UNIT_REGISTERED,
100
+ RULE_QUOTA_METRIC_REGISTERED,
101
+ RULE_RESTRICTION_CANONICAL_DISJOINT,
102
+ RULE_RESTRICTION_TOKEN_REGISTERED,
103
+ EntryVerdict,
104
+ RuleViolation,
105
+ RuleWarning,
106
+ TermVerdict,
107
+ canonical_restriction_token,
108
+ known_restriction_token,
109
+ normalize_license_term,
110
+ normalize_resource_entry,
111
+ validate_license_term,
112
+ validate_resource_entry,
113
+ )
114
+ from .money import canonicalize_money, format_money, parse_money
115
+ from .pop import AGENT_KEY_HEADER, sign_agent_binding, verify_agent_binding
116
+ from .regschema import (
117
+ MAX_REGISTRATION_DATA_BYTES,
118
+ MAX_REGISTRATION_DATA_DEPTH,
119
+ MAX_REGISTRATION_DATA_MEMBERS,
120
+ MAX_REGISTRATION_FIELD_ERROR_PATH_LEN,
121
+ MAX_REGISTRATION_FIELD_ERROR_TEXT_LEN,
122
+ MAX_REGISTRATION_FIELD_ERRORS,
123
+ MAX_REGISTRATION_SCHEMA_BYTES,
124
+ MAX_REGISTRATION_SCHEMA_DEPTH,
125
+ MAX_REGISTRATION_SCHEMA_EVALUATIONS,
126
+ MAX_REGISTRATION_SCHEMA_REF_HOPS,
127
+ REGISTRATION_SCHEMA_DIALECT,
128
+ RegistrationDataVerdict,
129
+ RegistrationSchema,
130
+ SchemaVerdict,
131
+ check_registration_data,
132
+ compile_registration_schema,
133
+ is_safe_schema_pattern,
134
+ )
135
+ from .resolvers import (
136
+ WBA_DIRECTORY_PATH,
137
+ DirectoryUnavailableError,
138
+ EndpointRefusedError,
139
+ KeyExpiredError,
140
+ KeyRevokedError,
141
+ ManifestVersionRefusedError,
142
+ NoEndpointError,
143
+ ResolverError,
144
+ UnknownKeyError,
145
+ WBAKeyResolver,
146
+ WellKnownEndpointResolver,
147
+ WellKnownKeyResolver,
148
+ wba_directory_url,
149
+ )
150
+ from .scopes import apply_scopes, normalize_scopes, scopes_subset
151
+ from .signedurl import sign_ed25519_signed_url, verify_ed25519_signed_url
152
+ from .signing_transport import SignedOutbound, SigningTransport
153
+ from .thumbprint import thumbprint
154
+ from .window import Window, clock_window, monotonic_window
155
+ from .wire import (
156
+ ConnectProtocolVersion,
157
+ ConnectProtocolVersionHeader,
158
+ ContentTypeJSON,
159
+ ContentTypeProto,
160
+ ProtocolVersion,
161
+ RequestIDHeader,
162
+ SignatureAgentHeader,
163
+ WellKnownManifestVersion,
164
+ WellKnownPath,
165
+ manifest_version_refusal,
166
+ )
167
+
168
+ __all__ = [
169
+ "ACCEPTANCE_SIGNATURE_ALGORITHM",
170
+ "AGENT_KEY_HEADER",
171
+ "AudienceVerdict",
172
+ "BARE_DOMAIN_PATTERN",
173
+ "BrokerClient",
174
+ "CallError",
175
+ "CallErrorKind",
176
+ "CatalogClient",
177
+ "Client",
178
+ "ClientConfig",
179
+ "ConnectProtocolVersion",
180
+ "ConnectProtocolVersionHeader",
181
+ "Content",
182
+ "ContentTypeJSON",
183
+ "ContentTypeProto",
184
+ "DirectoryUnavailableError",
185
+ "DiscoveryResult",
186
+ "ERROR_DETAIL_TYPE",
187
+ "EndpointRefusedError",
188
+ "EndpointResolver",
189
+ "EntryVerdict",
190
+ "KeyExpiredError",
191
+ "KeyResolver",
192
+ "KeyRevokedError",
193
+ "MAX_BARE_DOMAIN_LEN",
194
+ "MAX_REGISTRATION_DATA_BYTES",
195
+ "MAX_REGISTRATION_DATA_DEPTH",
196
+ "MAX_REGISTRATION_DATA_MEMBERS",
197
+ "MAX_REGISTRATION_FIELD_ERRORS",
198
+ "MAX_REGISTRATION_FIELD_ERROR_PATH_LEN",
199
+ "MAX_REGISTRATION_FIELD_ERROR_TEXT_LEN",
200
+ "MAX_REGISTRATION_SCHEMA_BYTES",
201
+ "MAX_REGISTRATION_SCHEMA_DEPTH",
202
+ "MAX_REGISTRATION_SCHEMA_EVALUATIONS",
203
+ "MAX_REGISTRATION_SCHEMA_REF_HOPS",
204
+ "ManifestVersionRefusedError",
205
+ "Mode",
206
+ "MultisigVerdict",
207
+ "NoEndpointError",
208
+ "OFFER_SIGNATURE_ALGORITHM",
209
+ "OfferGroupResult",
210
+ "ProtocolVersion",
211
+ "REASON_FIELDS",
212
+ "REGISTRATION_SCHEMA_DIALECT",
213
+ "RULE_OBLIGATION_OTHER_REQUIRES_DETAIL",
214
+ "RULE_PRICING_UNIT_REGISTERED",
215
+ "RULE_QUOTA_METRIC_REGISTERED",
216
+ "RULE_RESTRICTION_CANONICAL_DISJOINT",
217
+ "RULE_RESTRICTION_TOKEN_REGISTERED",
218
+ "RegistrationDataVerdict",
219
+ "RegistrationSchema",
220
+ "RejectReason",
221
+ "RejectedOffer",
222
+ "ReplayStore",
223
+ "RequestIDHeader",
224
+ "ResolverError",
225
+ "Result",
226
+ "RuleViolation",
227
+ "RuleWarning",
228
+ "SchemaVerdict",
229
+ "SignatureAgentHeader",
230
+ "SignedOutbound",
231
+ "SigningTransport",
232
+ "StaticKeyResolver",
233
+ "TermVerdict",
234
+ "UnknownKeyError",
235
+ "Validation",
236
+ "VerifiedOffer",
237
+ "Verifier",
238
+ "WBAKeyResolver",
239
+ "WBA_DIRECTORY_PATH",
240
+ "WellKnownManifestVersion",
241
+ "WellKnownEndpointResolver",
242
+ "WellKnownKeyResolver",
243
+ "WellKnownPath",
244
+ "Window",
245
+ "append_signature",
246
+ "apply_scopes",
247
+ "b64url_decode",
248
+ "b64url_nopad",
249
+ "canonical_acceptance_payload",
250
+ "canonical_offer_payload",
251
+ "canonical_restriction_token",
252
+ "canonicalize_money",
253
+ "catalog_rejection_detail",
254
+ "check_audience",
255
+ "check_registration_data",
256
+ "clock_window",
257
+ "compile_registration_schema",
258
+ "content_digest",
259
+ "cross_field_rule_ids",
260
+ "dispute_failure_detail",
261
+ "domain_verification_failure_detail",
262
+ "error_detail_from",
263
+ "format_money",
264
+ "generate_idempotency_key",
265
+ "hash_url",
266
+ "host_anchored",
267
+ "host_of",
268
+ "is_bare_domain",
269
+ "is_bare_host",
270
+ "is_safe_schema_pattern",
271
+ "manifest_version_refusal",
272
+ "jcs_acceptance_payload",
273
+ "jcs_request_acceptance_payload",
274
+ "known_restriction_token",
275
+ "monotonic_window",
276
+ "normalize_license_term",
277
+ "normalize_resource_entry",
278
+ "normalize_scopes",
279
+ "parse_error_detail",
280
+ "parse_money",
281
+ "reason",
282
+ "registration_failure_detail",
283
+ "retrieval_auth_failure_detail",
284
+ "scopes_subset",
285
+ "sign_agent_binding",
286
+ "sign_ed25519_signed_url",
287
+ "sign_offer_acceptance",
288
+ "sign_offer_acceptance_jcs",
289
+ "sign_offer_jcs",
290
+ "sign_request_acceptance_jcs",
291
+ "sign_request",
292
+ "thumbprint",
293
+ "transaction_denial_detail",
294
+ "usage_report_rejection_detail",
295
+ "validate_idempotency_key",
296
+ "validate_license_term",
297
+ "validate_resource_entry",
298
+ "verify_agent_binding",
299
+ "verify_ed25519_signed_url",
300
+ "verify_multisig_request_server",
301
+ "verify_offer_acceptance",
302
+ "verify_offer_acceptance_jcs",
303
+ "verify_request_acceptance_jcs",
304
+ "verify_request",
305
+ "verify_request_server",
306
+ "wba_directory_url",
307
+ ]