fora-protocol 1.0.8__tar.gz → 1.2.0__tar.gz

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 (195) hide show
  1. {fora_protocol-1.0.8/fora_protocol.egg-info → fora_protocol-1.2.0}/PKG-INFO +13 -2
  2. fora_protocol-1.0.8/PKG-INFO → fora_protocol-1.2.0/README.md +11 -13
  3. fora_protocol-1.0.8/README.md → fora_protocol-1.2.0/fora_protocol.egg-info/PKG-INFO +24 -0
  4. fora_protocol-1.2.0/fora_protocol.egg-info/SOURCES.txt +192 -0
  5. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/pyproject.toml +11 -7
  6. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_comment_first_paragraph.py +1 -1
  7. fora_protocol-1.2.0/tests/test_jsonschema.py +135 -0
  8. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.ReportingPolicy.schema.json +42 -0
  9. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.ReportingPolicy.schema.strict.json +43 -0
  10. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetReportingPolicyRequest.schema.json +62 -0
  11. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetReportingPolicyRequest.schema.strict.json +64 -0
  12. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetReportingPolicyResponse.schema.json +62 -0
  13. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetReportingPolicyResponse.schema.strict.json +64 -0
  14. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetTenantFeeRateRequest.schema.json +50 -0
  15. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetTenantFeeRateRequest.schema.strict.json +52 -0
  16. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetTenantFeeRateResponse.schema.json +50 -0
  17. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.SetTenantFeeRateResponse.schema.strict.json +52 -0
  18. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.TenantFeeRate.schema.json +30 -0
  19. fora_protocol-1.2.0/wire/jsonschema/fora.admin.v1.TenantFeeRate.schema.strict.json +31 -0
  20. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AcceptableRestriction.schema.json +45 -0
  21. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AcceptableRestriction.schema.strict.json +46 -0
  22. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AccountRegistration.schema.json +14 -0
  23. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AccountRegistration.schema.strict.json +15 -0
  24. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentAcceptance.schema.json +22 -0
  25. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentAcceptance.schema.strict.json +23 -0
  26. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentAcceptancePayload.schema.json +29 -0
  27. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentAcceptancePayload.schema.strict.json +30 -0
  28. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentRequestAcceptance.schema.json +78 -0
  29. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentRequestAcceptance.schema.strict.json +81 -0
  30. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentRequestAcceptanceItem.schema.json +21 -0
  31. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentRequestAcceptanceItem.schema.strict.json +22 -0
  32. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentRequestAcceptancePayload.schema.json +53 -0
  33. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AgentRequestAcceptancePayload.schema.strict.json +55 -0
  34. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AttributionDetail.schema.json +36 -0
  35. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AttributionDetail.schema.strict.json +37 -0
  36. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AuthorizedExchange.schema.json +53 -0
  37. fora_protocol-1.2.0/wire/jsonschema/fora.v1.AuthorizedExchange.schema.strict.json +54 -0
  38. fora_protocol-1.2.0/wire/jsonschema/fora.v1.BrokerTransactionResponse.schema.json +766 -0
  39. fora_protocol-1.2.0/wire/jsonschema/fora.v1.BrokerTransactionResponse.schema.strict.json +783 -0
  40. fora_protocol-1.2.0/wire/jsonschema/fora.v1.CatalogContributor.schema.json +19 -0
  41. fora_protocol-1.2.0/wire/jsonschema/fora.v1.CatalogContributor.schema.strict.json +20 -0
  42. fora_protocol-1.2.0/wire/jsonschema/fora.v1.CatalogRejection.schema.json +46 -0
  43. fora_protocol-1.2.0/wire/jsonschema/fora.v1.CatalogRejection.schema.strict.json +47 -0
  44. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Cost.schema.json +25 -0
  45. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Cost.schema.strict.json +26 -0
  46. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Delegation.schema.json +85 -0
  47. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Delegation.schema.strict.json +86 -0
  48. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DiscoveryRequest.schema.json +379 -0
  49. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DiscoveryRequest.schema.strict.json +385 -0
  50. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DiscoveryResponse.schema.json +903 -0
  51. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DiscoveryResponse.schema.strict.json +917 -0
  52. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DisputeFailure.schema.json +34 -0
  53. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DisputeFailure.schema.strict.json +35 -0
  54. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DisputeRequest.schema.json +90 -0
  55. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DisputeRequest.schema.strict.json +91 -0
  56. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DisputeResponse.schema.json +85 -0
  57. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DisputeResponse.schema.strict.json +86 -0
  58. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationChallenge.schema.json +40 -0
  59. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationChallenge.schema.strict.json +41 -0
  60. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationConfirmation.schema.json +53 -0
  61. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationConfirmation.schema.strict.json +54 -0
  62. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationFailure.schema.json +35 -0
  63. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationFailure.schema.strict.json +36 -0
  64. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationRequest.schema.json +43 -0
  65. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationRequest.schema.strict.json +44 -0
  66. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationResult.schema.json +34 -0
  67. fora_protocol-1.2.0/wire/jsonschema/fora.v1.DomainVerificationResult.schema.strict.json +35 -0
  68. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ErrorDetail.schema.json +415 -0
  69. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ErrorDetail.schema.strict.json +425 -0
  70. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ExchangeOutcome.schema.json +82 -0
  71. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ExchangeOutcome.schema.strict.json +84 -0
  72. fora_protocol-1.2.0/wire/jsonschema/fora.v1.GetAccountStatusRequest.schema.json +34 -0
  73. fora_protocol-1.2.0/wire/jsonschema/fora.v1.GetAccountStatusRequest.schema.strict.json +35 -0
  74. fora_protocol-1.2.0/wire/jsonschema/fora.v1.GetAccountStatusResponse.schema.json +74 -0
  75. fora_protocol-1.2.0/wire/jsonschema/fora.v1.GetAccountStatusResponse.schema.strict.json +76 -0
  76. fora_protocol-1.2.0/wire/jsonschema/fora.v1.JsonWebKey.schema.json +44 -0
  77. fora_protocol-1.2.0/wire/jsonschema/fora.v1.JsonWebKey.schema.strict.json +45 -0
  78. fora_protocol-1.2.0/wire/jsonschema/fora.v1.KeyRevocationList.schema.json +21 -0
  79. fora_protocol-1.2.0/wire/jsonschema/fora.v1.KeyRevocationList.schema.strict.json +22 -0
  80. fora_protocol-1.2.0/wire/jsonschema/fora.v1.License.schema.json +32 -0
  81. fora_protocol-1.2.0/wire/jsonschema/fora.v1.License.schema.strict.json +33 -0
  82. fora_protocol-1.2.0/wire/jsonschema/fora.v1.LicenseTerm.schema.json +364 -0
  83. fora_protocol-1.2.0/wire/jsonschema/fora.v1.LicenseTerm.schema.strict.json +370 -0
  84. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Obligation.schema.json +95 -0
  85. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Obligation.schema.strict.json +97 -0
  86. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Offer.schema.json +759 -0
  87. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Offer.schema.strict.json +771 -0
  88. fora_protocol-1.2.0/wire/jsonschema/fora.v1.OfferGroup.schema.json +848 -0
  89. fora_protocol-1.2.0/wire/jsonschema/fora.v1.OfferGroup.schema.strict.json +861 -0
  90. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Preview.schema.json +41 -0
  91. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Preview.schema.strict.json +42 -0
  92. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Pricing.schema.json +88 -0
  93. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Pricing.schema.strict.json +89 -0
  94. fora_protocol-1.2.0/wire/jsonschema/fora.v1.PushResourcesRequest.schema.json +587 -0
  95. fora_protocol-1.2.0/wire/jsonschema/fora.v1.PushResourcesRequest.schema.strict.json +596 -0
  96. fora_protocol-1.2.0/wire/jsonschema/fora.v1.PushResourcesResponse.schema.json +45 -0
  97. fora_protocol-1.2.0/wire/jsonschema/fora.v1.PushResourcesResponse.schema.strict.json +46 -0
  98. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Quota.schema.json +54 -0
  99. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Quota.schema.strict.json +55 -0
  100. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RateLimitInfo.schema.json +33 -0
  101. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RateLimitInfo.schema.strict.json +34 -0
  102. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RefreshCatalogRequest.schema.json +27 -0
  103. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RefreshCatalogRequest.schema.strict.json +28 -0
  104. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RefreshCatalogResponse.schema.json +18 -0
  105. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RefreshCatalogResponse.schema.strict.json +19 -0
  106. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegisterRequest.schema.json +45 -0
  107. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegisterRequest.schema.strict.json +46 -0
  108. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegisterResponse.schema.json +35 -0
  109. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegisterResponse.schema.strict.json +36 -0
  110. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegistrationFailure.schema.json +68 -0
  111. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegistrationFailure.schema.strict.json +70 -0
  112. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegistrationFieldError.schema.json +24 -0
  113. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RegistrationFieldError.schema.strict.json +25 -0
  114. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RemoveResourcesRequest.schema.json +73 -0
  115. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RemoveResourcesRequest.schema.strict.json +75 -0
  116. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RemoveResourcesResponse.schema.json +20 -0
  117. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RemoveResourcesResponse.schema.strict.json +21 -0
  118. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ReportingObligation.schema.json +41 -0
  119. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ReportingObligation.schema.strict.json +42 -0
  120. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RequestAuthFailure.schema.json +31 -0
  121. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RequestAuthFailure.schema.strict.json +32 -0
  122. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RequestConstraints.schema.json +114 -0
  123. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RequestConstraints.schema.strict.json +116 -0
  124. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Requester.schema.json +161 -0
  125. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Requester.schema.strict.json +163 -0
  126. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceAttestation.schema.json +38 -0
  127. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceAttestation.schema.strict.json +39 -0
  128. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceEntry.schema.json +536 -0
  129. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceEntry.schema.strict.json +544 -0
  130. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceIdentity.schema.json +102 -0
  131. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceIdentity.schema.strict.json +103 -0
  132. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceQuery.schema.json +269 -0
  133. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceQuery.schema.strict.json +273 -0
  134. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceRef.schema.json +26 -0
  135. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceRef.schema.strict.json +27 -0
  136. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceResponse.schema.json +929 -0
  137. fora_protocol-1.2.0/wire/jsonschema/fora.v1.ResourceResponse.schema.strict.json +944 -0
  138. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Restriction.schema.json +59 -0
  139. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Restriction.schema.strict.json +60 -0
  140. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RetrievalAuthFailure.schema.json +40 -0
  141. fora_protocol-1.2.0/wire/jsonschema/fora.v1.RetrievalAuthFailure.schema.strict.json +41 -0
  142. fora_protocol-1.2.0/wire/jsonschema/fora.v1.SubscriptionQuotaInfo.schema.json +44 -0
  143. fora_protocol-1.2.0/wire/jsonschema/fora.v1.SubscriptionQuotaInfo.schema.strict.json +45 -0
  144. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionDenial.schema.json +82 -0
  145. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionDenial.schema.strict.json +83 -0
  146. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionItem.schema.json +797 -0
  147. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionItem.schema.strict.json +811 -0
  148. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionRequest.schema.json +1077 -0
  149. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionRequest.schema.strict.json +1097 -0
  150. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionResponse.schema.json +732 -0
  151. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionResponse.schema.strict.json +748 -0
  152. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionResultItem.schema.json +644 -0
  153. fora_protocol-1.2.0/wire/jsonschema/fora.v1.TransactionResultItem.schema.strict.json +658 -0
  154. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UpstreamRefusal.schema.json +442 -0
  155. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UpstreamRefusal.schema.strict.json +453 -0
  156. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Usage.schema.json +88 -0
  157. fora_protocol-1.2.0/wire/jsonschema/fora.v1.Usage.schema.strict.json +90 -0
  158. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageAsset.schema.json +22 -0
  159. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageAsset.schema.strict.json +23 -0
  160. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageReport.schema.json +173 -0
  161. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageReport.schema.strict.json +177 -0
  162. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageReportRejection.schema.json +34 -0
  163. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageReportRejection.schema.strict.json +35 -0
  164. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageReportResponse.schema.json +30 -0
  165. fora_protocol-1.2.0/wire/jsonschema/fora.v1.UsageReportResponse.schema.strict.json +31 -0
  166. fora_protocol-1.2.0/wire/jsonschema/fora.v1.WBAFile.schema.json +64 -0
  167. fora_protocol-1.2.0/wire/jsonschema/fora.v1.WBAFile.schema.strict.json +66 -0
  168. fora_protocol-1.2.0/wire/jsonschema/fora.v1.WellKnownManifest.schema.json +311 -0
  169. fora_protocol-1.2.0/wire/jsonschema/fora.v1.WellKnownManifest.schema.strict.json +315 -0
  170. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/wire/models.py +313 -161
  171. fora_protocol-1.2.0/wire/schemas.py +53 -0
  172. fora_protocol-1.0.8/fora_protocol.egg-info/SOURCES.txt +0 -28
  173. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/LICENSE +0 -0
  174. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/fora_protocol.egg-info/dependency_links.txt +0 -0
  175. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/fora_protocol.egg-info/requires.txt +0 -0
  176. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/fora_protocol.egg-info/top_level.txt +0 -0
  177. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/setup.cfg +0 -0
  178. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_forward_compat.py +0 -0
  179. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_money_pattern.py +0 -0
  180. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_money_roundtrip.py +0 -0
  181. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_numeric_wire_forms.py +0 -0
  182. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_parity.py +0 -0
  183. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_snake_fields.py +0 -0
  184. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_unique_subclass.py +0 -0
  185. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/tests/test_wire_policy.py +0 -0
  186. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/vocab/functiontokens.py +0 -0
  187. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/vocab/geographytokens.py +0 -0
  188. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/vocab/pricingunits.py +0 -0
  189. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/vocab/py.typed +0 -0
  190. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/vocab/quotametrics.py +0 -0
  191. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/vocab/usertypes.py +0 -0
  192. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/wire/base.py +0 -0
  193. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/wire/names.py +0 -0
  194. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/wire/py.typed +0 -0
  195. {fora_protocol-1.0.8 → fora_protocol-1.2.0}/wire/unique.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fora-protocol
3
- Version: 1.0.8
4
- Summary: Generated types export for Python: Pydantic v2 models (wire.models, extending wire.base.WireModel) + registered vocabulary constants (vocab.*), generated from the proto via JSON Schema.
3
+ Version: 1.2.0
4
+ Summary: Generated types export for Python: Pydantic v2 models (wire.models, extending wire.base.WireModel), registered vocabulary constants (vocab.*) and the published per-message JSON Schemas (wire.schemas.load), generated from the proto via JSON Schema.
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://fora-protocol.org
7
7
  Project-URL: Source, https://github.com/FORA-Protocol/protocol
@@ -30,6 +30,13 @@ Contents:
30
30
  string patterns, length/item bounds. Nested messages reference the same model
31
31
  (`LicenseTerm.license` is a `License`), so the whole tree hydrates as typed models.
32
32
  **Cross-field rules are NOT here** — enforced server-side by the Exchange/Broker.
33
+ - `wire/schemas.py` — **`load(name, strict=False)`** and **`names()`**: the published JSON
34
+ Schemas (draft 2020-12), one self-contained file per message, shipped as package data
35
+ under `wire/jsonschema/`. `strict=True` selects the variant that refuses unknown fields
36
+ at every depth; a conformance check uses it. The files are generated into
37
+ [`gen/jsonschema/`](../jsonschema) (in this repository `wire/jsonschema` is a symlink to
38
+ it), whose README records how they treat field naming, `google.protobuf.Struct` and
39
+ 64-bit integers. **Hand-written loader; needs no validator library.**
33
40
  - `vocab/` — registered vocabulary constants per axis (`pricingunits`, …) with
34
41
  `is_registered()`, plus the accepted aliases authored beside the tokens (`ALIASES`,
35
42
  `canonical()` — an exact lookup; the SDK folds case before it looks up).
@@ -40,6 +47,10 @@ from wire.base import WireModel # subclass this to customize ALL models
40
47
 
41
48
  term = LicenseTerm.model_validate(incoming_json) # raises on shape/per-field violations
42
49
  assert isinstance(term.license, License) # full nested hierarchy, typed
50
+
51
+ from jsonschema import Draft202012Validator # any draft 2020-12 validator
52
+ from wire import schemas
53
+ Draft202012Validator(schemas.load("fora.v1.LicenseTerm", strict=True)).validate(incoming_json)
43
54
  ```
44
55
 
45
56
  Install (from this directory): `pip install .`
@@ -1,16 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: fora-protocol
3
- Version: 1.0.8
4
- Summary: Generated types export for Python: Pydantic v2 models (wire.models, extending wire.base.WireModel) + registered vocabulary constants (vocab.*), generated from the proto via JSON Schema.
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.9
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
- Requires-Dist: pydantic>=2.0
12
- Dynamic: license-file
13
-
14
1
  # Generated Python types export
15
2
 
16
3
  Generated from [`proto/`](../../proto) via JSON Schema. **Do not edit by hand** —
@@ -30,6 +17,13 @@ Contents:
30
17
  string patterns, length/item bounds. Nested messages reference the same model
31
18
  (`LicenseTerm.license` is a `License`), so the whole tree hydrates as typed models.
32
19
  **Cross-field rules are NOT here** — enforced server-side by the Exchange/Broker.
20
+ - `wire/schemas.py` — **`load(name, strict=False)`** and **`names()`**: the published JSON
21
+ Schemas (draft 2020-12), one self-contained file per message, shipped as package data
22
+ under `wire/jsonschema/`. `strict=True` selects the variant that refuses unknown fields
23
+ at every depth; a conformance check uses it. The files are generated into
24
+ [`gen/jsonschema/`](../jsonschema) (in this repository `wire/jsonschema` is a symlink to
25
+ it), whose README records how they treat field naming, `google.protobuf.Struct` and
26
+ 64-bit integers. **Hand-written loader; needs no validator library.**
33
27
  - `vocab/` — registered vocabulary constants per axis (`pricingunits`, …) with
34
28
  `is_registered()`, plus the accepted aliases authored beside the tokens (`ALIASES`,
35
29
  `canonical()` — an exact lookup; the SDK folds case before it looks up).
@@ -40,6 +34,10 @@ from wire.base import WireModel # subclass this to customize ALL models
40
34
 
41
35
  term = LicenseTerm.model_validate(incoming_json) # raises on shape/per-field violations
42
36
  assert isinstance(term.license, License) # full nested hierarchy, typed
37
+
38
+ from jsonschema import Draft202012Validator # any draft 2020-12 validator
39
+ from wire import schemas
40
+ Draft202012Validator(schemas.load("fora.v1.LicenseTerm", strict=True)).validate(incoming_json)
43
41
  ```
44
42
 
45
43
  Install (from this directory): `pip install .`
@@ -1,3 +1,16 @@
1
+ Metadata-Version: 2.4
2
+ Name: fora-protocol
3
+ Version: 1.2.0
4
+ Summary: Generated types export for Python: Pydantic v2 models (wire.models, extending wire.base.WireModel), registered vocabulary constants (vocab.*) and the published per-message JSON Schemas (wire.schemas.load), generated from the proto via JSON Schema.
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.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pydantic>=2.0
12
+ Dynamic: license-file
13
+
1
14
  # Generated Python types export
2
15
 
3
16
  Generated from [`proto/`](../../proto) via JSON Schema. **Do not edit by hand** —
@@ -17,6 +30,13 @@ Contents:
17
30
  string patterns, length/item bounds. Nested messages reference the same model
18
31
  (`LicenseTerm.license` is a `License`), so the whole tree hydrates as typed models.
19
32
  **Cross-field rules are NOT here** — enforced server-side by the Exchange/Broker.
33
+ - `wire/schemas.py` — **`load(name, strict=False)`** and **`names()`**: the published JSON
34
+ Schemas (draft 2020-12), one self-contained file per message, shipped as package data
35
+ under `wire/jsonschema/`. `strict=True` selects the variant that refuses unknown fields
36
+ at every depth; a conformance check uses it. The files are generated into
37
+ [`gen/jsonschema/`](../jsonschema) (in this repository `wire/jsonschema` is a symlink to
38
+ it), whose README records how they treat field naming, `google.protobuf.Struct` and
39
+ 64-bit integers. **Hand-written loader; needs no validator library.**
20
40
  - `vocab/` — registered vocabulary constants per axis (`pricingunits`, …) with
21
41
  `is_registered()`, plus the accepted aliases authored beside the tokens (`ALIASES`,
22
42
  `canonical()` — an exact lookup; the SDK folds case before it looks up).
@@ -27,6 +47,10 @@ from wire.base import WireModel # subclass this to customize ALL models
27
47
 
28
48
  term = LicenseTerm.model_validate(incoming_json) # raises on shape/per-field violations
29
49
  assert isinstance(term.license, License) # full nested hierarchy, typed
50
+
51
+ from jsonschema import Draft202012Validator # any draft 2020-12 validator
52
+ from wire import schemas
53
+ Draft202012Validator(schemas.load("fora.v1.LicenseTerm", strict=True)).validate(incoming_json)
30
54
  ```
31
55
 
32
56
  Install (from this directory): `pip install .`
@@ -0,0 +1,192 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ fora_protocol.egg-info/PKG-INFO
5
+ fora_protocol.egg-info/SOURCES.txt
6
+ fora_protocol.egg-info/dependency_links.txt
7
+ fora_protocol.egg-info/requires.txt
8
+ fora_protocol.egg-info/top_level.txt
9
+ tests/test_comment_first_paragraph.py
10
+ tests/test_forward_compat.py
11
+ tests/test_jsonschema.py
12
+ tests/test_money_pattern.py
13
+ tests/test_money_roundtrip.py
14
+ tests/test_numeric_wire_forms.py
15
+ tests/test_parity.py
16
+ tests/test_snake_fields.py
17
+ tests/test_unique_subclass.py
18
+ tests/test_wire_policy.py
19
+ vocab/functiontokens.py
20
+ vocab/geographytokens.py
21
+ vocab/pricingunits.py
22
+ vocab/py.typed
23
+ vocab/quotametrics.py
24
+ vocab/usertypes.py
25
+ wire/base.py
26
+ wire/models.py
27
+ wire/names.py
28
+ wire/py.typed
29
+ wire/schemas.py
30
+ wire/unique.py
31
+ wire/jsonschema/fora.admin.v1.ReportingPolicy.schema.json
32
+ wire/jsonschema/fora.admin.v1.ReportingPolicy.schema.strict.json
33
+ wire/jsonschema/fora.admin.v1.SetReportingPolicyRequest.schema.json
34
+ wire/jsonschema/fora.admin.v1.SetReportingPolicyRequest.schema.strict.json
35
+ wire/jsonschema/fora.admin.v1.SetReportingPolicyResponse.schema.json
36
+ wire/jsonschema/fora.admin.v1.SetReportingPolicyResponse.schema.strict.json
37
+ wire/jsonschema/fora.admin.v1.SetTenantFeeRateRequest.schema.json
38
+ wire/jsonschema/fora.admin.v1.SetTenantFeeRateRequest.schema.strict.json
39
+ wire/jsonschema/fora.admin.v1.SetTenantFeeRateResponse.schema.json
40
+ wire/jsonschema/fora.admin.v1.SetTenantFeeRateResponse.schema.strict.json
41
+ wire/jsonschema/fora.admin.v1.TenantFeeRate.schema.json
42
+ wire/jsonschema/fora.admin.v1.TenantFeeRate.schema.strict.json
43
+ wire/jsonschema/fora.v1.AcceptableRestriction.schema.json
44
+ wire/jsonschema/fora.v1.AcceptableRestriction.schema.strict.json
45
+ wire/jsonschema/fora.v1.AccountRegistration.schema.json
46
+ wire/jsonschema/fora.v1.AccountRegistration.schema.strict.json
47
+ wire/jsonschema/fora.v1.AgentAcceptance.schema.json
48
+ wire/jsonschema/fora.v1.AgentAcceptance.schema.strict.json
49
+ wire/jsonschema/fora.v1.AgentAcceptancePayload.schema.json
50
+ wire/jsonschema/fora.v1.AgentAcceptancePayload.schema.strict.json
51
+ wire/jsonschema/fora.v1.AgentRequestAcceptance.schema.json
52
+ wire/jsonschema/fora.v1.AgentRequestAcceptance.schema.strict.json
53
+ wire/jsonschema/fora.v1.AgentRequestAcceptanceItem.schema.json
54
+ wire/jsonschema/fora.v1.AgentRequestAcceptanceItem.schema.strict.json
55
+ wire/jsonschema/fora.v1.AgentRequestAcceptancePayload.schema.json
56
+ wire/jsonschema/fora.v1.AgentRequestAcceptancePayload.schema.strict.json
57
+ wire/jsonschema/fora.v1.AttributionDetail.schema.json
58
+ wire/jsonschema/fora.v1.AttributionDetail.schema.strict.json
59
+ wire/jsonschema/fora.v1.AuthorizedExchange.schema.json
60
+ wire/jsonschema/fora.v1.AuthorizedExchange.schema.strict.json
61
+ wire/jsonschema/fora.v1.BrokerTransactionResponse.schema.json
62
+ wire/jsonschema/fora.v1.BrokerTransactionResponse.schema.strict.json
63
+ wire/jsonschema/fora.v1.CatalogContributor.schema.json
64
+ wire/jsonschema/fora.v1.CatalogContributor.schema.strict.json
65
+ wire/jsonschema/fora.v1.CatalogRejection.schema.json
66
+ wire/jsonschema/fora.v1.CatalogRejection.schema.strict.json
67
+ wire/jsonschema/fora.v1.Cost.schema.json
68
+ wire/jsonschema/fora.v1.Cost.schema.strict.json
69
+ wire/jsonschema/fora.v1.Delegation.schema.json
70
+ wire/jsonschema/fora.v1.Delegation.schema.strict.json
71
+ wire/jsonschema/fora.v1.DiscoveryRequest.schema.json
72
+ wire/jsonschema/fora.v1.DiscoveryRequest.schema.strict.json
73
+ wire/jsonschema/fora.v1.DiscoveryResponse.schema.json
74
+ wire/jsonschema/fora.v1.DiscoveryResponse.schema.strict.json
75
+ wire/jsonschema/fora.v1.DisputeFailure.schema.json
76
+ wire/jsonschema/fora.v1.DisputeFailure.schema.strict.json
77
+ wire/jsonschema/fora.v1.DisputeRequest.schema.json
78
+ wire/jsonschema/fora.v1.DisputeRequest.schema.strict.json
79
+ wire/jsonschema/fora.v1.DisputeResponse.schema.json
80
+ wire/jsonschema/fora.v1.DisputeResponse.schema.strict.json
81
+ wire/jsonschema/fora.v1.DomainVerificationChallenge.schema.json
82
+ wire/jsonschema/fora.v1.DomainVerificationChallenge.schema.strict.json
83
+ wire/jsonschema/fora.v1.DomainVerificationConfirmation.schema.json
84
+ wire/jsonschema/fora.v1.DomainVerificationConfirmation.schema.strict.json
85
+ wire/jsonschema/fora.v1.DomainVerificationFailure.schema.json
86
+ wire/jsonschema/fora.v1.DomainVerificationFailure.schema.strict.json
87
+ wire/jsonschema/fora.v1.DomainVerificationRequest.schema.json
88
+ wire/jsonschema/fora.v1.DomainVerificationRequest.schema.strict.json
89
+ wire/jsonschema/fora.v1.DomainVerificationResult.schema.json
90
+ wire/jsonschema/fora.v1.DomainVerificationResult.schema.strict.json
91
+ wire/jsonschema/fora.v1.ErrorDetail.schema.json
92
+ wire/jsonschema/fora.v1.ErrorDetail.schema.strict.json
93
+ wire/jsonschema/fora.v1.ExchangeOutcome.schema.json
94
+ wire/jsonschema/fora.v1.ExchangeOutcome.schema.strict.json
95
+ wire/jsonschema/fora.v1.GetAccountStatusRequest.schema.json
96
+ wire/jsonschema/fora.v1.GetAccountStatusRequest.schema.strict.json
97
+ wire/jsonschema/fora.v1.GetAccountStatusResponse.schema.json
98
+ wire/jsonschema/fora.v1.GetAccountStatusResponse.schema.strict.json
99
+ wire/jsonschema/fora.v1.JsonWebKey.schema.json
100
+ wire/jsonschema/fora.v1.JsonWebKey.schema.strict.json
101
+ wire/jsonschema/fora.v1.KeyRevocationList.schema.json
102
+ wire/jsonschema/fora.v1.KeyRevocationList.schema.strict.json
103
+ wire/jsonschema/fora.v1.License.schema.json
104
+ wire/jsonschema/fora.v1.License.schema.strict.json
105
+ wire/jsonschema/fora.v1.LicenseTerm.schema.json
106
+ wire/jsonschema/fora.v1.LicenseTerm.schema.strict.json
107
+ wire/jsonschema/fora.v1.Obligation.schema.json
108
+ wire/jsonschema/fora.v1.Obligation.schema.strict.json
109
+ wire/jsonschema/fora.v1.Offer.schema.json
110
+ wire/jsonschema/fora.v1.Offer.schema.strict.json
111
+ wire/jsonschema/fora.v1.OfferGroup.schema.json
112
+ wire/jsonschema/fora.v1.OfferGroup.schema.strict.json
113
+ wire/jsonschema/fora.v1.Preview.schema.json
114
+ wire/jsonschema/fora.v1.Preview.schema.strict.json
115
+ wire/jsonschema/fora.v1.Pricing.schema.json
116
+ wire/jsonschema/fora.v1.Pricing.schema.strict.json
117
+ wire/jsonschema/fora.v1.PushResourcesRequest.schema.json
118
+ wire/jsonschema/fora.v1.PushResourcesRequest.schema.strict.json
119
+ wire/jsonschema/fora.v1.PushResourcesResponse.schema.json
120
+ wire/jsonschema/fora.v1.PushResourcesResponse.schema.strict.json
121
+ wire/jsonschema/fora.v1.Quota.schema.json
122
+ wire/jsonschema/fora.v1.Quota.schema.strict.json
123
+ wire/jsonschema/fora.v1.RateLimitInfo.schema.json
124
+ wire/jsonschema/fora.v1.RateLimitInfo.schema.strict.json
125
+ wire/jsonschema/fora.v1.RefreshCatalogRequest.schema.json
126
+ wire/jsonschema/fora.v1.RefreshCatalogRequest.schema.strict.json
127
+ wire/jsonschema/fora.v1.RefreshCatalogResponse.schema.json
128
+ wire/jsonschema/fora.v1.RefreshCatalogResponse.schema.strict.json
129
+ wire/jsonschema/fora.v1.RegisterRequest.schema.json
130
+ wire/jsonschema/fora.v1.RegisterRequest.schema.strict.json
131
+ wire/jsonschema/fora.v1.RegisterResponse.schema.json
132
+ wire/jsonschema/fora.v1.RegisterResponse.schema.strict.json
133
+ wire/jsonschema/fora.v1.RegistrationFailure.schema.json
134
+ wire/jsonschema/fora.v1.RegistrationFailure.schema.strict.json
135
+ wire/jsonschema/fora.v1.RegistrationFieldError.schema.json
136
+ wire/jsonschema/fora.v1.RegistrationFieldError.schema.strict.json
137
+ wire/jsonschema/fora.v1.RemoveResourcesRequest.schema.json
138
+ wire/jsonschema/fora.v1.RemoveResourcesRequest.schema.strict.json
139
+ wire/jsonschema/fora.v1.RemoveResourcesResponse.schema.json
140
+ wire/jsonschema/fora.v1.RemoveResourcesResponse.schema.strict.json
141
+ wire/jsonschema/fora.v1.ReportingObligation.schema.json
142
+ wire/jsonschema/fora.v1.ReportingObligation.schema.strict.json
143
+ wire/jsonschema/fora.v1.RequestAuthFailure.schema.json
144
+ wire/jsonschema/fora.v1.RequestAuthFailure.schema.strict.json
145
+ wire/jsonschema/fora.v1.RequestConstraints.schema.json
146
+ wire/jsonschema/fora.v1.RequestConstraints.schema.strict.json
147
+ wire/jsonschema/fora.v1.Requester.schema.json
148
+ wire/jsonschema/fora.v1.Requester.schema.strict.json
149
+ wire/jsonschema/fora.v1.ResourceAttestation.schema.json
150
+ wire/jsonschema/fora.v1.ResourceAttestation.schema.strict.json
151
+ wire/jsonschema/fora.v1.ResourceEntry.schema.json
152
+ wire/jsonschema/fora.v1.ResourceEntry.schema.strict.json
153
+ wire/jsonschema/fora.v1.ResourceIdentity.schema.json
154
+ wire/jsonschema/fora.v1.ResourceIdentity.schema.strict.json
155
+ wire/jsonschema/fora.v1.ResourceQuery.schema.json
156
+ wire/jsonschema/fora.v1.ResourceQuery.schema.strict.json
157
+ wire/jsonschema/fora.v1.ResourceRef.schema.json
158
+ wire/jsonschema/fora.v1.ResourceRef.schema.strict.json
159
+ wire/jsonschema/fora.v1.ResourceResponse.schema.json
160
+ wire/jsonschema/fora.v1.ResourceResponse.schema.strict.json
161
+ wire/jsonschema/fora.v1.Restriction.schema.json
162
+ wire/jsonschema/fora.v1.Restriction.schema.strict.json
163
+ wire/jsonschema/fora.v1.RetrievalAuthFailure.schema.json
164
+ wire/jsonschema/fora.v1.RetrievalAuthFailure.schema.strict.json
165
+ wire/jsonschema/fora.v1.SubscriptionQuotaInfo.schema.json
166
+ wire/jsonschema/fora.v1.SubscriptionQuotaInfo.schema.strict.json
167
+ wire/jsonschema/fora.v1.TransactionDenial.schema.json
168
+ wire/jsonschema/fora.v1.TransactionDenial.schema.strict.json
169
+ wire/jsonschema/fora.v1.TransactionItem.schema.json
170
+ wire/jsonschema/fora.v1.TransactionItem.schema.strict.json
171
+ wire/jsonschema/fora.v1.TransactionRequest.schema.json
172
+ wire/jsonschema/fora.v1.TransactionRequest.schema.strict.json
173
+ wire/jsonschema/fora.v1.TransactionResponse.schema.json
174
+ wire/jsonschema/fora.v1.TransactionResponse.schema.strict.json
175
+ wire/jsonschema/fora.v1.TransactionResultItem.schema.json
176
+ wire/jsonschema/fora.v1.TransactionResultItem.schema.strict.json
177
+ wire/jsonschema/fora.v1.UpstreamRefusal.schema.json
178
+ wire/jsonschema/fora.v1.UpstreamRefusal.schema.strict.json
179
+ wire/jsonschema/fora.v1.Usage.schema.json
180
+ wire/jsonschema/fora.v1.Usage.schema.strict.json
181
+ wire/jsonschema/fora.v1.UsageAsset.schema.json
182
+ wire/jsonschema/fora.v1.UsageAsset.schema.strict.json
183
+ wire/jsonschema/fora.v1.UsageReport.schema.json
184
+ wire/jsonschema/fora.v1.UsageReport.schema.strict.json
185
+ wire/jsonschema/fora.v1.UsageReportRejection.schema.json
186
+ wire/jsonschema/fora.v1.UsageReportRejection.schema.strict.json
187
+ wire/jsonschema/fora.v1.UsageReportResponse.schema.json
188
+ wire/jsonschema/fora.v1.UsageReportResponse.schema.strict.json
189
+ wire/jsonschema/fora.v1.WBAFile.schema.json
190
+ wire/jsonschema/fora.v1.WBAFile.schema.strict.json
191
+ wire/jsonschema/fora.v1.WellKnownManifest.schema.json
192
+ wire/jsonschema/fora.v1.WellKnownManifest.schema.strict.json
@@ -1,15 +1,16 @@
1
1
  # Packaging for the generated FORA Python types export (mirrors gen/ts/package.json).
2
- # wire/models.py and vocab/* are generated from proto/ by scripts/gen-sdk-types.sh — do
3
- # not edit them by hand. Only this file, README.md, and the hand-written wire/base.py
4
- # seam are authored.
2
+ # wire/models.py, wire/unique.py, vocab/* and the schemas under wire/jsonschema/ are
3
+ # generated from proto/ by scripts/gen-sdk-types.sh (and buf) — do not edit them by hand.
4
+ # Only this file, README.md, and the hand-written wire/base.py, wire/names.py and
5
+ # wire/schemas.py are authored.
5
6
  [build-system]
6
7
  requires = ["setuptools>=77"] # license-files (PEP 639)
7
8
  build-backend = "setuptools.build_meta"
8
9
 
9
10
  [project]
10
11
  name = "fora-protocol"
11
- version = "1.0.8"
12
- description = "Generated types export for Python: Pydantic v2 models (wire.models, extending wire.base.WireModel) + registered vocabulary constants (vocab.*), generated from the proto via JSON Schema."
12
+ version = "1.2.0"
13
+ description = "Generated types export for Python: Pydantic v2 models (wire.models, extending wire.base.WireModel), registered vocabulary constants (vocab.*) and the published per-message JSON Schemas (wire.schemas.load), generated from the proto via JSON Schema."
13
14
  readme = "README.md"
14
15
  requires-python = ">=3.9"
15
16
  license = "Apache-2.0"
@@ -31,7 +32,10 @@ namespaces = true
31
32
  include = ["wire*", "vocab*"]
32
33
 
33
34
  # The inline-types marker, one per namespace package (a namespace package has no
34
- # __init__.py to carry it), in the wheel and the sdist.
35
+ # __init__.py to carry it), in the wheel and the sdist. wire/jsonschema/ holds the
36
+ # published JSON Schemas wire.schemas.load reads. In the repository it is a symlink to
37
+ # gen/jsonschema/ (one generated copy, drift-gated there); the sdist stores the files
38
+ # themselves, so the wheel built from it carries them too.
35
39
  [tool.setuptools.package-data]
36
- wire = ["py.typed"]
40
+ wire = ["py.typed", "jsonschema/*.json"]
37
41
  vocab = ["py.typed"]
@@ -44,7 +44,7 @@ TITLE_FIELDS = ("Offer", "ResourceEntry", "UsageAsset")
44
44
  #: completeness; these name the cases a reader can check against the .proto by eye.
45
45
  FIRST_PARAGRAPH_HEADS = (
46
46
  ("Offer", "signature", "REQUIRED. Hex-encoded detached Ed25519 signature over the canonical"),
47
- ("Requester", "scopes", "Entitlement scopes. Declare what the requester can access."),
47
+ ("Requester", "scopes", "Entitlement scopes: the requester's own statement"),
48
48
  ("License", "uri", "Canonical identity of the license document (RFC 3986)."),
49
49
  ("ResourceQuery", "supported_profiles", "Domain extension profiles the caller understands."),
50
50
  ("Pricing", "unit", 'Metering basis — the "per what" of PER_UNIT pricing.'),
@@ -0,0 +1,135 @@
1
+ """The published JSON Schemas (gen/jsonschema/), read through the package loader.
2
+
3
+ wire.schemas.load is how a Python consumer reaches the schemas at the pinned version, so
4
+ every assertion here goes through it. The validator is jsonschema's draft 2020-12 engine,
5
+ the dialect the schemas declare.
6
+
7
+ What is pinned:
8
+ - the loader resolves every contract message in both variants, and refuses a name it
9
+ does not ship;
10
+ - the strict variant refuses an unknown field at the top level and nested, and refuses
11
+ a camelCase alias, while the default variant accepts both (forward compatibility);
12
+ - google.protobuf.Struct (`ext`) stays open in the strict variant, at any depth;
13
+ - buf.validate constraints fail the schema: an empty required string, an omitted
14
+ required field, a numeric bound in either 64-bit integer form;
15
+ - both variants reach Go protovalidate's verdict on every case of the conformance
16
+ corpus, the same oracle the generated Pydantic and Zod models are held to.
17
+
18
+ Run: PYTHONPATH=gen/python python3 -m pytest gen/python/tests/test_jsonschema.py -q
19
+ """
20
+ import copy
21
+ import json
22
+ import pathlib
23
+
24
+ import pytest
25
+ from jsonschema import Draft202012Validator
26
+
27
+ from wire import schemas
28
+
29
+ ROOT = pathlib.Path(__file__).resolve().parents[3]
30
+ CASES = json.loads((ROOT / "conformance" / "corpus" / "cases.json").read_text())
31
+ BY_BARE = {n.rsplit(".", 1)[1]: n for n in schemas.names()}
32
+
33
+ OFFER = next(c["json"] for c in CASES if c["id"] == "Offer/valid")
34
+ RESPONSE = {"exchange": "exchange.example", "offers": [OFFER]}
35
+
36
+
37
+ def accepts(name, instance, strict):
38
+ schema = schemas.load(name, strict=strict)
39
+ Draft202012Validator.check_schema(schema)
40
+ return Draft202012Validator(schema).is_valid(instance)
41
+
42
+
43
+ def with_offer(**extra):
44
+ body = copy.deepcopy(RESPONSE)
45
+ body["offers"][0].update(extra)
46
+ return body
47
+
48
+
49
+ def test_loader_resolves_every_message_in_both_variants():
50
+ names = schemas.names()
51
+ assert "fora.v1.ResourceResponse" in names
52
+ assert "fora.admin.v1.ReportingPolicy" in names
53
+ for name in names:
54
+ assert schemas.load(name)["$id"] == f"{name}.schema.json"
55
+ assert schemas.load(name, strict=True)["$id"] == f"{name}.schema.strict.json"
56
+
57
+
58
+ def test_loader_refuses_an_unknown_name():
59
+ with pytest.raises(KeyError):
60
+ schemas.load("fora.v1.NoSuchMessage")
61
+ with pytest.raises(KeyError):
62
+ schemas.load("../jsonschema/fora.v1.ResourceResponse")
63
+
64
+
65
+ def test_loader_returns_a_fresh_copy():
66
+ schemas.load("fora.v1.ResourceResponse")["properties"].clear()
67
+ assert "exchange" in schemas.load("fora.v1.ResourceResponse")["properties"]
68
+
69
+
70
+ def test_valid_message_passes_both_variants():
71
+ assert accepts("fora.v1.ResourceResponse", RESPONSE, strict=False)
72
+ assert accepts("fora.v1.ResourceResponse", RESPONSE, strict=True)
73
+
74
+
75
+ @pytest.mark.parametrize(
76
+ "body",
77
+ [
78
+ {**RESPONSE, "unknown_field": 1}, # top level
79
+ with_offer(unknown_field=1), # inside a nested message
80
+ {**RESPONSE, "offerGroups": []}, # the camelCase alias of offer_groups
81
+ ],
82
+ ids=["top-level", "nested", "camelCase-alias"],
83
+ )
84
+ def test_strict_refuses_an_unknown_field_and_default_accepts_it(body):
85
+ assert not accepts("fora.v1.ResourceResponse", body, strict=True)
86
+ assert accepts("fora.v1.ResourceResponse", body, strict=False)
87
+
88
+
89
+ def test_strict_keeps_struct_open_at_any_depth():
90
+ ext = {"vendor": {"nested": {"deeper": [1, "two"]}}, "flag": True}
91
+ body = with_offer(ext=ext)
92
+ body["ext"] = ext
93
+ assert accepts("fora.v1.ResourceResponse", body, strict=True)
94
+
95
+
96
+ @pytest.mark.parametrize("strict", [False, True], ids=["default", "strict"])
97
+ def test_empty_required_string_fails(strict):
98
+ # exchange carries a non-empty pattern: Go protovalidate rejects "".
99
+ assert not accepts("fora.v1.ResourceResponse", {"exchange": ""}, strict)
100
+ # proto-JSON omits a zero value, so omission is the same "" and fails too.
101
+ assert not accepts("fora.v1.ResourceResponse", {}, strict)
102
+
103
+
104
+ @pytest.mark.parametrize("strict", [False, True], ids=["default", "strict"])
105
+ @pytest.mark.parametrize(
106
+ "limit,valid",
107
+ [("1", True), (1, True), ("9007199254740993", True), ("0", False), (0, False),
108
+ ("-1", False), ("1.5", False), ("one", False)],
109
+ )
110
+ def test_int64_accepts_both_forms_and_enforces_the_bound_on_each(limit, valid, strict):
111
+ # Quota.limit is int64 with gte 1. Canonical proto-JSON emits it as a decimal string;
112
+ # the SDKs send a JSON number.
113
+ quota = {"limit": limit, "metric": "accesses", "window": "QUOTA_WINDOW_DAILY"}
114
+ assert accepts("fora.v1.Quota", quota, strict) is valid
115
+
116
+
117
+ @pytest.mark.parametrize("strict", [False, True], ids=["default", "strict"])
118
+ def test_bounded_double_has_no_string_bypass(strict):
119
+ # quantity_tolerance is a double bounded to [0, 1]; the string form is not accepted,
120
+ # so "1000" cannot get past the bound.
121
+ base = {"tenant_id": "t"}
122
+ assert accepts("fora.admin.v1.ReportingPolicy", {**base, "quantity_tolerance": 0.5}, strict)
123
+ assert not accepts("fora.admin.v1.ReportingPolicy", {**base, "quantity_tolerance": 2}, strict)
124
+ assert not accepts("fora.admin.v1.ReportingPolicy", {**base, "quantity_tolerance": "1000"}, strict)
125
+
126
+
127
+ @pytest.mark.parametrize("strict", [False, True], ids=["default", "strict"])
128
+ @pytest.mark.parametrize("case", CASES, ids=[c["id"] for c in CASES])
129
+ def test_schema_matches_go_verdict(case, strict):
130
+ name = BY_BARE[case["message"]]
131
+ accepted = accepts(name, case["json"], strict)
132
+ assert accepted == case["valid"], (
133
+ f"{case['id']}: {name} ({'strict' if strict else 'default'}) accepted={accepted} "
134
+ f"but Go verdict valid={case['valid']} (rules={case.get('rules')})"
135
+ )
@@ -0,0 +1,42 @@
1
+ {
2
+ "$id": "fora.admin.v1.ReportingPolicy.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "description": "ReportingPolicy is the reporting-policy payload shared by\n SetReportingPolicy's request and response. The field rules live here once, so\n the write and the echoed read-back stay in lockstep.",
5
+ "properties": {
6
+ "quantity_tolerance": {
7
+ "description": "DEPRECATED, ignored. This used to set the accepted relative deviation\n between the estimated and the reported quantity, and a report outside it was\n refused. A usage report is never refused for its quantity: the reported\n quantity is unrestricted, and monitoring how far reports fall from\n estimates is the Exchange operator's own business, not part of the\n protocol. An Exchange MUST NOT refuse a report on this setting. The field and\n its bounds are retained because removing them would break the wire\n contract.",
8
+ "maximum": 1,
9
+ "minimum": 0,
10
+ "type": "number"
11
+ },
12
+ "required_fields": {
13
+ "description": "Report field names the usage-report validator requires. The wire constrains\n only the token shape; which names are meaningful is defined by the receiving\n Exchange and may change without a contract change. Names are a set: repeats\n are rejected. Empty means no required fields.",
14
+ "items": {
15
+ "maxLength": 64,
16
+ "minLength": 1,
17
+ "pattern": "^[A-Za-z0-9._:*-]+$",
18
+ "type": "string"
19
+ },
20
+ "maxItems": 32,
21
+ "type": "array",
22
+ "uniqueItems": true
23
+ },
24
+ "tenant_id": {
25
+ "description": "The tenant whose reporting policy is being replaced.",
26
+ "maxLength": 255,
27
+ "minLength": 1,
28
+ "type": "string"
29
+ },
30
+ "window_seconds": {
31
+ "description": "Reporting window in seconds. Applies to obligations minted after this call;\n obligations already issued keep the window they were minted with. Capped at\n one year. Omitted: the receiving Exchange's default applies.",
32
+ "exclusiveMinimum": 0,
33
+ "maximum": 31536000,
34
+ "type": "integer"
35
+ }
36
+ },
37
+ "required": [
38
+ "tenant_id"
39
+ ],
40
+ "title": "Reporting Policy",
41
+ "type": "object"
42
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$id": "fora.admin.v1.ReportingPolicy.schema.strict.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "additionalProperties": false,
5
+ "description": "ReportingPolicy is the reporting-policy payload shared by\n SetReportingPolicy's request and response. The field rules live here once, so\n the write and the echoed read-back stay in lockstep.",
6
+ "properties": {
7
+ "quantity_tolerance": {
8
+ "description": "DEPRECATED, ignored. This used to set the accepted relative deviation\n between the estimated and the reported quantity, and a report outside it was\n refused. A usage report is never refused for its quantity: the reported\n quantity is unrestricted, and monitoring how far reports fall from\n estimates is the Exchange operator's own business, not part of the\n protocol. An Exchange MUST NOT refuse a report on this setting. The field and\n its bounds are retained because removing them would break the wire\n contract.",
9
+ "maximum": 1,
10
+ "minimum": 0,
11
+ "type": "number"
12
+ },
13
+ "required_fields": {
14
+ "description": "Report field names the usage-report validator requires. The wire constrains\n only the token shape; which names are meaningful is defined by the receiving\n Exchange and may change without a contract change. Names are a set: repeats\n are rejected. Empty means no required fields.",
15
+ "items": {
16
+ "maxLength": 64,
17
+ "minLength": 1,
18
+ "pattern": "^[A-Za-z0-9._:*-]+$",
19
+ "type": "string"
20
+ },
21
+ "maxItems": 32,
22
+ "type": "array",
23
+ "uniqueItems": true
24
+ },
25
+ "tenant_id": {
26
+ "description": "The tenant whose reporting policy is being replaced.",
27
+ "maxLength": 255,
28
+ "minLength": 1,
29
+ "type": "string"
30
+ },
31
+ "window_seconds": {
32
+ "description": "Reporting window in seconds. Applies to obligations minted after this call;\n obligations already issued keep the window they were minted with. Capped at\n one year. Omitted: the receiving Exchange's default applies.",
33
+ "exclusiveMinimum": 0,
34
+ "maximum": 31536000,
35
+ "type": "integer"
36
+ }
37
+ },
38
+ "required": [
39
+ "tenant_id"
40
+ ],
41
+ "title": "Reporting Policy",
42
+ "type": "object"
43
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "$defs": {
3
+ "fora.admin.v1.ReportingPolicy": {
4
+ "description": "ReportingPolicy is the reporting-policy payload shared by\n SetReportingPolicy's request and response. The field rules live here once, so\n the write and the echoed read-back stay in lockstep.",
5
+ "properties": {
6
+ "quantity_tolerance": {
7
+ "description": "DEPRECATED, ignored. This used to set the accepted relative deviation\n between the estimated and the reported quantity, and a report outside it was\n refused. A usage report is never refused for its quantity: the reported\n quantity is unrestricted, and monitoring how far reports fall from\n estimates is the Exchange operator's own business, not part of the\n protocol. An Exchange MUST NOT refuse a report on this setting. The field and\n its bounds are retained because removing them would break the wire\n contract.",
8
+ "maximum": 1,
9
+ "minimum": 0,
10
+ "type": "number"
11
+ },
12
+ "required_fields": {
13
+ "description": "Report field names the usage-report validator requires. The wire constrains\n only the token shape; which names are meaningful is defined by the receiving\n Exchange and may change without a contract change. Names are a set: repeats\n are rejected. Empty means no required fields.",
14
+ "items": {
15
+ "maxLength": 64,
16
+ "minLength": 1,
17
+ "pattern": "^[A-Za-z0-9._:*-]+$",
18
+ "type": "string"
19
+ },
20
+ "maxItems": 32,
21
+ "type": "array",
22
+ "uniqueItems": true
23
+ },
24
+ "tenant_id": {
25
+ "description": "The tenant whose reporting policy is being replaced.",
26
+ "maxLength": 255,
27
+ "minLength": 1,
28
+ "type": "string"
29
+ },
30
+ "window_seconds": {
31
+ "description": "Reporting window in seconds. Applies to obligations minted after this call;\n obligations already issued keep the window they were minted with. Capped at\n one year. Omitted: the receiving Exchange's default applies.",
32
+ "exclusiveMinimum": 0,
33
+ "maximum": 31536000,
34
+ "type": "integer"
35
+ }
36
+ },
37
+ "required": [
38
+ "tenant_id"
39
+ ],
40
+ "title": "Reporting Policy",
41
+ "type": "object"
42
+ }
43
+ },
44
+ "$id": "fora.admin.v1.SetReportingPolicyRequest.schema.json",
45
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
46
+ "properties": {
47
+ "policy": {
48
+ "$ref": "#/$defs/fora.admin.v1.ReportingPolicy",
49
+ "description": "The reporting policy to apply. Required — an absent payload would otherwise\n skip validation of its fields."
50
+ },
51
+ "ver": {
52
+ "default": "",
53
+ "description": "FORA protocol version — \"1.0\". Stamped by the sender from a single\n constant; advisory on receive. See \"Protocol version\" in fora.proto.",
54
+ "type": "string"
55
+ }
56
+ },
57
+ "required": [
58
+ "policy"
59
+ ],
60
+ "title": "Set Reporting Policy Request",
61
+ "type": "object"
62
+ }