openbadgeslib 4.6.2__tar.gz → 4.6.3__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 (185) hide show
  1. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/Changelog.txt +645 -0
  2. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/PKG-INFO +3 -3
  3. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/README.md +1 -1
  4. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/_jsonmodel.py +19 -3
  5. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/_jws/__init__.py +4 -1
  6. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/_jws/utils.py +7 -3
  7. openbadgeslib-4.6.3/openbadgeslib/_safejson.py +138 -0
  8. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/keys.py +5 -4
  9. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob1/badge.py +5 -1
  10. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob1/verifier.py +17 -3
  11. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/__init__.py +3 -2
  12. openbadgeslib-4.6.3/openbadgeslib/ob3/_canon_guard.py +1038 -0
  13. openbadgeslib-4.6.3/openbadgeslib/ob3/_structure_screen.py +364 -0
  14. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/clr.py +73 -4
  15. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/__init__.py +9 -7
  16. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/credential.py +8 -1
  17. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/did.py +8 -22
  18. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/ldp.py +461 -66
  19. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/status.py +6 -5
  20. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/verifier.py +28 -6
  21. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/codes.py +16 -2
  22. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/offer.py +11 -2
  23. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_verifier.py +6 -2
  24. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/util.py +146 -17
  25. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/verify.py +10 -3
  26. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib.egg-info/PKG-INFO +3 -3
  27. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib.egg-info/SOURCES.txt +9 -0
  28. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib.egg-info/requires.txt +1 -1
  29. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/pyproject.toml +58 -13
  30. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_docs.py +60 -1
  31. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_jsonmodel.py +43 -0
  32. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_keys.py +6 -4
  33. openbadgeslib-4.6.3/tests/test_ob3_canon_guard_dataset.py +92 -0
  34. openbadgeslib-4.6.3/tests/test_ob3_ldp_canon_guard.py +1776 -0
  35. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_ldp_context_validation.py +1 -1
  36. openbadgeslib-4.6.3/tests/test_ob3_ldp_ecdsa_sd_dos.py +1258 -0
  37. openbadgeslib-4.6.3/tests/test_ob3_ldp_structure_screen.py +1473 -0
  38. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_oid4vci_protocol.py +49 -0
  39. openbadgeslib-4.6.3/tests/test_safejson.py +120 -0
  40. openbadgeslib-4.6.3/tests/test_untrusted_input.py +788 -0
  41. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_util.py +304 -0
  42. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/CONTRIBUTING.md +0 -0
  43. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/GOVERNANCE.md +0 -0
  44. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/LICENSE.txt +0 -0
  45. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/MANIFEST.in +0 -0
  46. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/SECURITY.md +0 -0
  47. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/docs/README.md +0 -0
  48. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/__init__.py +0 -0
  49. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/_jws/exceptions.py +0 -0
  50. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/_ob1_api.py +0 -0
  51. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/_python_support.py +0 -0
  52. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/badge_model.py +0 -0
  53. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/baking.py +0 -0
  54. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/cli_common.py +0 -0
  55. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/config.ini.example +0 -0
  56. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/confparser.py +0 -0
  57. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/errors.py +0 -0
  58. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/issue.py +0 -0
  59. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/logs.py +0 -0
  60. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/mail.py +0 -0
  61. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob1/__init__.py +0 -0
  62. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob1/signer.py +0 -0
  63. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob2/__init__.py +0 -0
  64. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob2/models.py +0 -0
  65. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob2/signer.py +0 -0
  66. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob2/verifier.py +0 -0
  67. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/_context_validation.py +0 -0
  68. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/clr_context_2.0.1.json +0 -0
  69. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/credentials-v2.json +0 -0
  70. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/ob-v3p0-context-3.0.1.json +0 -0
  71. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/ob-v3p0-context-3.0.2.json +0 -0
  72. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/ob-v3p0-context-3.0.3.json +0 -0
  73. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/ob-v3p0-extensions.json +0 -0
  74. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/security-data-integrity-v2.json +0 -0
  75. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/contexts/security-multikey-v1.json +0 -0
  76. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/eudi.py +0 -0
  77. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/publish.py +0 -0
  78. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/signer.py +0 -0
  79. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/status_list.py +0 -0
  80. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/ob3/status_registry.py +0 -0
  81. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/__init__.py +0 -0
  82. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/errors.py +0 -0
  83. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/formats.py +0 -0
  84. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/handler.py +0 -0
  85. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/memory_store.py +0 -0
  86. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/metadata.py +0 -0
  87. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/nonce.py +0 -0
  88. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/reconcile.py +0 -0
  89. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/sqlite_store.py +0 -0
  90. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/oid4vci/store.py +0 -0
  91. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_cli.py +0 -0
  92. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_init.py +0 -0
  93. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_keygenerator.py +0 -0
  94. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_publish.py +0 -0
  95. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_signer.py +0 -0
  96. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/openbadges_status.py +0 -0
  97. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib/py.typed +0 -0
  98. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib.egg-info/dependency_links.txt +0 -0
  99. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib.egg-info/entry_points.txt +0 -0
  100. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/openbadgeslib.egg-info/top_level.txt +0 -0
  101. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/setup.cfg +0 -0
  102. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/config1.ini +0 -0
  103. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conformance/Dockerfile.ob3 +0 -0
  104. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conformance/README.md +0 -0
  105. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conformance/conftest.py +0 -0
  106. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conformance/docker-compose.yml +0 -0
  107. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conformance/relax-danubetech-checksums.awk +0 -0
  108. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conformance/test_official_validators.py +0 -0
  109. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/conftest.py +0 -0
  110. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/ob_schemas/README.md +0 -0
  111. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/ob_schemas/ob_v3p0_achievementcredential_schema.json +0 -0
  112. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/ob_schemas/ob_v3p0_profile_schema.json +0 -0
  113. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/ob_schemas/refresh.sh +0 -0
  114. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/vc_di_eddsa/README.md +0 -0
  115. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/vc_di_eddsa/credentials-examples-v2.json +0 -0
  116. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/vc_di_eddsa/doc-hash.txt +0 -0
  117. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/vc_di_eddsa/key-pair.json +0 -0
  118. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/vc_di_eddsa/proof-config-hash.txt +0 -0
  119. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/fixtures/vc_di_eddsa/signed-credential.json +0 -0
  120. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/images/sample1.png +0 -0
  121. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/images/sample1.svg +0 -0
  122. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/images/userimage01.svg +0 -0
  123. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/ldp_helpers.py +0 -0
  124. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/logo Python Espan/314/203a.svg" +0 -0
  125. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/logo Python Espa/303/261a.svg" +0 -0
  126. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_b64url.py +0 -0
  127. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_baking.py +0 -0
  128. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_cli_json.py +0 -0
  129. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_cli_smoke.py +0 -0
  130. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_confparser.py +0 -0
  131. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_eddsa.py +0 -0
  132. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_errors.py +0 -0
  133. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_examples.py +0 -0
  134. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_issue.py +0 -0
  135. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_issue_credential.py +0 -0
  136. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_jws.py +0 -0
  137. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_key_operation.py +0 -0
  138. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_mail.py +0 -0
  139. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob1_badge_io.py +0 -0
  140. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob1_deprecation.py +0 -0
  141. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob1_signer.py +0 -0
  142. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob1_verifier.py +0 -0
  143. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob2_cli.py +0 -0
  144. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob2_error_branches.py +0 -0
  145. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob2_models.py +0 -0
  146. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob2_signer.py +0 -0
  147. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob2_verifier.py +0 -0
  148. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_clr.py +0 -0
  149. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_conformance_schema.py +0 -0
  150. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_contexts.py +0 -0
  151. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_credential.py +0 -0
  152. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_did.py +0 -0
  153. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_did_doc.py +0 -0
  154. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_endorsement.py +0 -0
  155. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_eudi_oid4vci.py +0 -0
  156. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_eudi_sd_jwt.py +0 -0
  157. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_eudi_type_metadata.py +0 -0
  158. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_eudi_x5c.py +0 -0
  159. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_ldp.py +0 -0
  160. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_ldp_cli.py +0 -0
  161. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_ldp_ecdsa_sd.py +0 -0
  162. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_ldp_errors.py +0 -0
  163. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_ldp_sign.py +0 -0
  164. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_publish_cli.py +0 -0
  165. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_signer.py +0 -0
  166. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_signer_cli_ldp.py +0 -0
  167. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_status.py +0 -0
  168. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_status_list.py +0 -0
  169. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_status_registry.py +0 -0
  170. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_ob3_verifier.py +0 -0
  171. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_oid4vci_config.py +0 -0
  172. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_oid4vci_reservations.py +0 -0
  173. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_oid4vci_store.py +0 -0
  174. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_openbadges_cli.py +0 -0
  175. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_public_api.py +0 -0
  176. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_python_support.py +0 -0
  177. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_sign_ecc.pem +0 -0
  178. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_sign_rsa.pem +0 -0
  179. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_signer_batch.py +0 -0
  180. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_verifier_cli_coverage.py +0 -0
  181. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_verify.py +0 -0
  182. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_verify_ecc.pem +0 -0
  183. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/test_verify_rsa.pem +0 -0
  184. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/withoutxmlheader.svg +0 -0
  185. {openbadgeslib-4.6.2 → openbadgeslib-4.6.3}/tests/withxmlheader.svg +0 -0
@@ -4,6 +4,651 @@ OpenBadgesLib - Changelog
4
4
  Newest first. Dates are ISO 8601 (YYYY-MM-DD).
5
5
 
6
6
 
7
+ * v4.6.3 - 2026-10-21
8
+
9
+ - fix(jws): the native JWS engine (OB1 and OB2 signed badges) answers a
10
+ hostile token with its own error, and so does everything that parses JSON
11
+ an attacker controls through it. A protected header nested past the
12
+ parser's recursion limit (a 3.6 KB token on Python 3.10 and 3.11) raised a
13
+ bare RecursionError out of `OB2Verifier.verify`, `verify_badge(..., '2')`
14
+ and the OB1 signature check, before any signature was looked at. The
15
+ shared JSON loader (`_jws.utils.from_json`) is now bounded by the new
16
+ `openbadgeslib/_safejson.py`: more than 128 levels of nesting, a lone
17
+ surrogate (the `\ud800` escape of an ASCII document, which cannot be
18
+ encoded to UTF-8) and a number that is not finite (`1e999`, `NaN`) are
19
+ refused as a ValueError, which the callers already map to a signature
20
+ failure or a failed verdict, and `verify_block` types a str token that
21
+ holds a lone surrogate. Nothing legitimate nests that deep or carries
22
+ those values.
23
+
24
+ - fix(ob1): a hostile OpenBadges 1.0 badge is a verdict, not a traceback.
25
+ `BadgeSigned.read_from_file` raised a bare RecursionError for a body
26
+ nested past the parser's limit and a UnicodeEncodeError for a lone
27
+ surrogate in `recipient.identity` or `salt`, and `Verifier.check_expiration`
28
+ an OverflowError for an `expires` of -1e300 or -10**30 (the signature had
29
+ already verified, so `get_badge_status` raised instead of returning its
30
+ VerifyInfo). The CLI printed a traceback for each. They are now
31
+ AssertionFormatIncorrect, and an unformattable expiry reads as an invalid
32
+ timestamp. A body whose `expires` is `1e999`, `NaN` or `Infinity` is
33
+ refused at parse (it used to read as "never expires"). And
34
+ `get_badge_status` returns its VerifyInfo when a server answers a badge,
35
+ issuer or revocation URL with a malformed response (a chunked body that
36
+ ends inside a chunk raised `http.client.IncompleteRead` out of it).
37
+
38
+ - fix(ob2): a timestamp with no UTC `datetime` no longer ends in an
39
+ OverflowError. `9999-12-31T23:59:59-05:00` is 10000-01-01T04:59:59Z and
40
+ `0001-01-01T00:00:00+05:00` precedes year 1: valid ISO 8601, comparable,
41
+ and accepted by the parser, but `Assertion.to_dict()` converted them to
42
+ UTC, so a hosted assertion carrying one as `issuedOn` or `expires` raised
43
+ OverflowError out of `OB2Verifier.verify` after the library had fetched the
44
+ attacker's `id` URL, and `OB2Signer.sign` and `OpenBadgeCredential.to_vc()`
45
+ raised it for a datetime like it. The date helper the OB2 and OB3 models
46
+ share still accepts every aware timestamp, as 4.6.2 did (a credential's
47
+ `validFrom`/`validUntil` and a proof's `created`/`expires` too), and the one
48
+ place that converts to UTC now writes such an instant with its own offset
49
+ (`9999-12-31T23:59:59-05:00`), which names the same instant. Every other
50
+ value is written as before, except that a year below 1000 is zero-padded
51
+ whatever the platform (glibc's strftime left it bare: `1-01-01T00:00:00Z`
52
+ for `0001-01-01T00:00:00Z`). A remote CryptographicKey whose
53
+ `publicKeyPem` holds a lone surrogate raised UnicodeEncodeError, even on
54
+ the hosted path that is documented never to fail the verdict; it is an
55
+ OB2VerificationError now.
56
+
57
+ - security(ob3): a hostile JWT-VC is an OB3VerificationError, whatever its
58
+ header or payload carries. PyJWT's own header checks (a non-string `kid`,
59
+ an invalid `crit`) raise InvalidTokenError, DecodeError's parent, which
60
+ `OB3Verifier.verify`, `verify_endorsement_jwt`, the status-list proof check
61
+ and `verify_badge` did not catch (the CLI printed a traceback); a str token
62
+ holding a lone surrogate raised UnicodeEncodeError; a signed payload
63
+ (self-signed by the attacker's did:key) with `creditsAvailable` or
64
+ `creditsEarned` of 400 digits raised OverflowError, and one with a
65
+ `credentialStatus` `statusListIndex` or `statusSize` of `Infinity` (`1e999`)
66
+ raised OverflowError in `check_credential_status`. On Python 3.14 and
67
+ later a header or payload value nested between what the parser takes
68
+ (about 116 000 levels) and what `repr()` takes (about 70 000) turned a
69
+ parsed token into a RecursionError the moment an error message formatted
70
+ it. The header and the payload PyJWT returns are now held to the shared
71
+ bound (_safejson: 128 levels, no lone surrogate, no non-finite number)
72
+ before anything reads them, `issuer_did_from_token` and
73
+ `issuer_did_from_document` likewise, the status list document and the
74
+ did:web document go through the bounded loader, and a number outside the
75
+ range of a float is a malformed credential. `creditsAvailable: Infinity`,
76
+ which used to verify, no longer does.
77
+
78
+ - security(ldp): a hostile Data Integrity document is an OB3VerificationError
79
+ before any signature or context work. A `proof.cryptosuite` that is a JSON
80
+ array or object raised a bare TypeError out of `OB3LdpVerifier.verify`,
81
+ `verify_data_integrity_proof` and `verify_badge`; a lone surrogate in any
82
+ string (the `\ud800` escape of an ASCII document) raised
83
+ UnicodeEncodeError when the document was hashed; `verify_data_integrity_proof`
84
+ (the CLR route) deep-copied a dict nested about 900 levels, raising
85
+ RecursionError; and a document nested 100 000 levels deep (160 KB, within
86
+ the size cap) cost seconds of CPU in the context walk, which rebuilds an
87
+ O(depth) path per node, before any signature was looked at. The document is
88
+ now held to the shared bound (_safejson: 128 levels, no lone surrogate, no
89
+ non-finite number) on parse and at the top of `verify_data_integrity_proof`,
90
+ and only a string cryptosuite is looked up.
91
+
92
+ - fix(cli): `openbadges-verifier --json` prints exactly one strictly valid
93
+ JSON object. A verified credential whose `creditsAvailable` was `1e999` or
94
+ `NaN` made it print `Infinity` or `NaN`, which JSON.parse, jq and serde
95
+ reject. Such a credential no longer verifies (see the ob3 entry above), and
96
+ any other non-finite float the payload ever carries is printed as null. A
97
+ hostile OB1 body, or a JWT whose header PyJWT rejects, now ends in the
98
+ one-object verdict and exit status 1 instead of a traceback.
99
+
100
+ - fix(oid4vci): a lone surrogate in a value the endpoints take from a
101
+ request is an ordinary wrong value, not a 500. A pre-authorized code,
102
+ `tx_code` or access token decoded from JSON (`"\ud800"`) raised
103
+ UnicodeEncodeError out of `handle_token_request` and
104
+ `handle_credential_request`, and a PIN-gated grant skipped its failed-attempt
105
+ counter on that path. They are hashed with `surrogatepass`: the value
106
+ matches nothing, so it is the same `invalid_grant` / `invalid_token` as any
107
+ wrong one, in the same time, and a wrong `tx_code` is counted.
108
+ `build_credential_offer` refuses a recipient that is not valid Unicode with
109
+ IssuanceError before it reserves a status slot (sqlite3 refused the str at
110
+ `save_grant`).
111
+
112
+ - security(util): `download_file` enforces its documented 60-second budget.
113
+ `MAX_DOWNLOAD_SECONDS` was checked only between reads, and a read of 64 KiB
114
+ loops recv until it is satisfied, so a server that sent one byte every few
115
+ seconds of the body, of a response header or of the status line (each recv
116
+ inside the 30-second socket timeout) held the call open for as long as it
117
+ liked, and with it every caller that fetches an attacker-chosen URL: a
118
+ did:web issuer, a credentialStatus list, the OB1/OB2 badge, issuer and
119
+ revocation URLs. Every recv of the response, headers included (the size
120
+ lines of a chunked body too) and across redirects, now spends the one
121
+ budget, and the call raises the ValueError it always documented. Connecting,
122
+ the TLS handshake and DNS resolution are still bounded per operation (30
123
+ seconds), not by the budget. A malformed response, such as a chunked body
124
+ that ends inside a chunk, is still `http.client.IncompleteRead`, an
125
+ HTTPException that is neither a ValueError nor an OSError (as in 4.6.2);
126
+ the docstring now lists what `download_file` raises.
127
+
128
+ - security(deps): the `cryptography` floor rises from 45 to 50.
129
+ `cryptography>=45` named 45.0.0, which is yanked on PyPI, and every
130
+ release before 50.0.0 carries a known advisory (CVE-2026-26007,
131
+ CVE-2026-34073, CVE-2026-39892, CVE-2026-69247, CVE-2026-69248,
132
+ CVE-2026-69249 and, in the OpenSSL bundled in the wheels,
133
+ GHSA-537c-gmf6-5ccf), so an install that lands on the floor (a lockfile
134
+ built with the lowest versions, a constraints file, a pinned image) got a
135
+ package a scanner flags. The weekly scan never saw it: it audits what a
136
+ fresh install resolves, which is the newest release. One advisory is
137
+ reachable from this library: CVE-2026-69249, fixed in 49.0.0, makes path
138
+ building exponential over duplicate self-signed intermediates, and
139
+ `verify_badge_sd_jwt(x5c_trust_anchors=…)` builds the path over the `x5c`
140
+ chain of the untrusted badge before it checks the signature. A 4 KB token
141
+ with six chain entries stalled the call for over 45 s on 45.0.0 and takes
142
+ 0.1 s on 50.0.0; there is no integrity impact, and the default
143
+ `pubkey_pem` path never builds a path. The others are not reachable here:
144
+ openvc-core validates with the client verifier and no peer name and binds
145
+ the issuer by exact SAN match, a SECT key parses but every verifier
146
+ refuses it before it operates, and nothing calls the PKCS#7 decryption or
147
+ passes a non-contiguous buffer. 50.0.0 rather than 49.0.0 because it is
148
+ the first release with nothing to report, so the floor itself audits
149
+ clean. Installing with `--only-binary` needs a wheel: 49.0.0 and later
150
+ publish none for macOS x86_64 or 32-bit Windows (an Intel Mac already
151
+ resolved to 50.x and built it with Rust), so those platforms need a Rust
152
+ toolchain or a 64-bit Python. Upgrade with `pip install -U cryptography`.
153
+
154
+ - ci: the weekly Audit workflow has a second job, "pip-audit (declared
155
+ floors)". It installs the exact floor of every runtime dependency of the
156
+ package and of the `ldp`, `eudi`, `ldp-sd` and `oid4vci` extras, read out
157
+ of pyproject.toml, then fails on a yanked floor and on any advisory
158
+ against it. pip-audit runs in its own environment, so the advisories of
159
+ its own dependencies are not counted against the package.
160
+
161
+ - security(ldp): RDF canonicalization of a Data Integrity document is
162
+ bounded in work, in CPU time and in the cost of the JSON-LD to RDF
163
+ conversion before it. RDFC-1.0 resolves blank nodes its first-degree hash
164
+ cannot tell apart by trying their permutations, recursively, and the
165
+ verifier runs it BEFORE it can check the signature, on a document nobody
166
+ has authenticated. The 256 KiB document cap did not bound that and pyld
167
+ 3.3.0 has no cap of its own: a credential of 1.2 to 2.2 KB that passes
168
+ context validation (an `evidence` clique of eight labelled blank nodes,
169
+ a tree of eight identical children two deep, two identical parents with
170
+ nine identical children each) cost one verification 15 to 40 seconds of
171
+ CPU (CPython 3.14, a quiet laptop), a ring of 400 labelled nodes (21 KB)
172
+ 13 s, and a slightly larger one minutes; the proof options,
173
+ canonicalized too, are attacker input as well. `OB3LdpVerifier`,
174
+ `verify_data_integrity_proof`, `OB3LdpSigner` and
175
+ `add_data_integrity_proof` now canonicalize through
176
+ `ob3/_canon_guard.py`: pyld's own URDNA2015, run with a per-call subclass
177
+ that charges every Hash N-Degree Quads call and every permutation step to
178
+ one budget shared by the document and its proof options, refusing before
179
+ the work when a group of indistinguishable nodes cannot fit. The budget
180
+ is 250,000 model units, about 100 times what a real credential spends
181
+ (at most ~2,400 over 53 real documents; the repo's copy of 1EdTech's
182
+ "Complete OpenBadgeCredential" example spends 1,124) and 1.5 times the
183
+ largest legitimate shape known (an identifier-only subject with 1,400
184
+ identical blank Results). Symmetry on purpose is where it stops: two
185
+ identical blank parents with five identical blank children each pass
186
+ (48,000 units), with six they are refused (297,000), and so is a clique
187
+ of six labelled blank nodes (1.08 million; five pass, 115,000), counted
188
+ on the tests' modelled credential as the root (on 1EdTech's Complete
189
+ example the same shapes cost 41,000, 350,000, 117,000 and 1.08 million: the
190
+ verdicts are the same). The
191
+ budget comes with one CPU-time allowance of 1.0 s inside URDNA2015, read
192
+ from the thread's own CPU clock (a request queued behind another, or a
193
+ loaded host, is not charged for waiting). The clock is the bound that
194
+ holds everywhere: on CPython 3.11 and 3.12 a window of
195
+ document sizes (a circulant graph of 80 to 160 nodes, 8 to 15 KB, moving
196
+ with the caller's stack depth) costs 5 to 10 times more CPU per unit than
197
+ the model says. Each of the shapes above is refused with
198
+ `OB3VerificationError` ("refusing to canonicalize the credential";
199
+ `ErrorSigningFile` on the signing side) after 0.05 to 0.22 s of CPU on
200
+ CPython 3.10 to 3.15, 0.9 s at most inside that window (in our sweeps;
201
+ the allowance caps it at 1.1 s), and 1.04 to 1.11 s on every interpreter
202
+ with the unit budget out of the way. That is a poison graph on its own.
203
+ The allowance covers URDNA2015 only, and a document that also carries a
204
+ flood of the typed nodes of the structure entry below, which costs 1.0 to
205
+ 1.4 s of CPU before canonicalization starts, pays both: 1,260 typed nodes
206
+ and a 148-node circulant (102 KB) cost `OB3LdpVerifier.verify` 1.2 to 1.6
207
+ s, and 2.1 to 2.3 s on CPython 3.11 to 3.15 and 2.4 to 2.5 s on 3.10 when
208
+ the unit budget does not trip first (as in the 3.11/3.12 window, where a
209
+ review reached the deadline with it in force and measured 2.24 s). The
210
+ whole suite,
211
+ including the W3C vectors and the Complete example, spends at most 0.5%
212
+ of the budget with byte-identical canonical output. The conversion
213
+ before it has a cost no hook can meter: pyld compares every new value of
214
+ a node property with the ones already there, N^2/2 comparisons for N
215
+ distinct values (8,000 `tag` values, 57 KB, took 12 s), and the same for
216
+ N nodes that all `@reverse` into one node (6,000 spread over 80 parents,
217
+ about 240 KB, took 6 to 11 s). The comparisons are counted on the
218
+ expanded document the way pyld makes them, `@reverse` and repeated values
219
+ included, and a document over 1,000,000 of them, summed over every
220
+ property of every node of the document and its proof options (one
221
+ property of 1,414 distinct values, or two of about 1,000), is refused
222
+ before pyld builds the node map (0.35 to 0.5 s of CPU at the limit). A
223
+ credential issued with 4.6.2 that has more distinct values than that in one
224
+ property (1,500 tags or evidence entries, say; 4.6.2 verified one in 0.6 to
225
+ 3.5 s of CPU) therefore no longer verifies: it is refused with "the
226
+ document puts too many values on its node properties", which names the
227
+ property and the node.
228
+ No pyld state is patched, so other users of pyld are unaffected. pyld's
229
+ JSON-LD processor keeps its context caches in plain LRU caches shared by
230
+ the whole process, which are not thread-safe; the path keeps them apart
231
+ per thread (next entry). The guard
232
+ is fitted to pyld 3.3.0 and fails closed if the installed pyld is not the
233
+ one it was calibrated on (another major version, a changed hook, a
234
+ canary document that no longer canonicalizes to the known output, in the
235
+ known work range, with the known permutation steps). That refusal is
236
+ `OB3GuardUnavailable`, a subclass of `OB3VerificationError`, so a
237
+ deployment can alert on "the guard is down" apart from "this credential
238
+ is bad"; its text names the pyld found, what was expected and the
239
+ remedy (pin `pyld==3.3.0`, or upgrade openbadgeslib). pip checks the
240
+ `pyld<4` of `[ldp]` and `[ldp-sd]` only when it resolves, not on a later
241
+ `pip install -U pyld`; past the ceiling this refusal is what protects you.
242
+ pyld 4.0 is unreleased and breaking, and its toRDF drops statements 3.x
243
+ keeps: an IRI containing any of `< > " { } | \ ^` or a backquote, or two
244
+ `#`, as a subject, object, predicate, `@type`, graph name or list member,
245
+ and a literal whose `@language` is not shaped like a BCP 47 tag; and it
246
+ changes the bytes of literals (an `xsd:token` is whitespace-folded, a TAB
247
+ is not escaped). `add_data_integrity_proof` (and so `OB3LdpSigner`) now
248
+ refuses a document over 256 KiB, measured as its compact UTF-8 form,
249
+ before any JSON-LD work, where it used to canonicalize first and
250
+ `OB3LdpSigner` checked the size of its output afterwards. A document
251
+ pyld cannot expand now fails with pyld's message (cut at 300 characters)
252
+ after "could not canonicalize the credential:" instead of "Could not
253
+ convert input to RDF dataset".
254
+ ecdsa-sd-2023 is delegated to openvc-core, which canonicalizes with an
255
+ unbounded pyld of its own: the dataset it will canonicalize is first
256
+ canonicalized here within the same budget (the way openvc-core makes it:
257
+ see the next bullet), which refuses the shapes above before the delegate
258
+ runs, and the number of statements is capped too. Both screen what the
259
+ delegate is handed; neither bounds what it then spends.
260
+
261
+ - security(ldp): the Data Integrity path is thread-safe, and one hostile
262
+ request does not hold the others up. pyld's JSON-LD processor keeps its
263
+ resolved contexts and its inverse contexts in two plain LRU caches shared
264
+ by the whole process, which concurrent calls corrupt, and a corrupted cache
265
+ fails every later verification and signature of the process until it
266
+ restarts: 4.6.2 failed 459 of 480 verifications run by 8 threads on CPython
267
+ 3.14 and 182 of 480 on 3.10. One process-wide lock around the pyld calls
268
+ cures that and makes every thread wait for whoever holds it, and a document
269
+ that passes every screen (42 KB of 1,200 typed nodes, say) spends about a
270
+ second of CPU in pyld's linear JSON-LD phase, 98% of it with the lock held:
271
+ a legitimate verification that takes 5 ms alone waited a median 1.1 s
272
+ behind one such request, 4.4 s behind four and 17 s behind sixteen (CPython
273
+ 3.14, one verification every 20 ms; a signature waits the same). So the
274
+ caches are kept apart instead. `expand`, `compact` and `to_rdf` of the path
275
+ now run on a resolved-context cache that belongs to the calling thread
276
+ (through the `contextResolver` option pyld takes for internal use) instead
277
+ of pyld's shared one, and a compaction keeps the inverse contexts it
278
+ derives for itself. The canonical output does not change (the caches only
279
+ remember work) and the guard's canary now proves that pyld answers from the
280
+ cache it is handed, failing closed with `OB3GuardUnavailable` if a pyld
281
+ does not (as it now does before context validation, not after). A thread's
282
+ cache is bounded like pyld's (100 contexts; about 1 to 2 MiB once a
283
+ credential has been through, per thread, where pyld's held it once), is
284
+ built by the thread's first call (6.2 ms for a small credential instead of
285
+ 4.4) and is dropped by any call that raises, a refusal included, so the
286
+ next call on that thread starts cold. `PYLD_LOCK` is left for what still
287
+ uses pyld's shared caches: pyld writes every inverse context it derives
288
+ into its own process-wide cache, so deriving one takes the lock (about 50
289
+ microseconds; 8 times per legitimate verification, about 1,300 per hostile
290
+ request of the kind above, which holds it for 8% of its second), as do the
291
+ build of the guard and fork(). The openvc-core delegate of ecdsa-sd-2023
292
+ uses pyld's shared caches too, so it is covered only where the library
293
+ holds `PYLD_LOCK` around it, and so is any other call into pyld made in the
294
+ process. With one such hostile request in flight a legitimate verification
295
+ now takes 12 to 14 ms at the median and 21 to 24 ms at p99; with four, 13
296
+ to 29 ms and about 0.5 s; with sixteen, 37 to 47 ms and 0.4 to 0.9 s, the
297
+ slowest single one 1 to 2 s (CPython 3.10, 3.12 and 3.14, best of three
298
+ runs of 12 s; behind the lock, 0.9 to 1.1 s, 3.8 to 5.0 s and 15 to 19 s at
299
+ the median). What is left of the p99 is that lock: a thread that finds it
300
+ taken has to win the GIL back from the CPU-bound ones, up to 60 ms each
301
+ time. With the lock taken out (not safe) the p99 is 95 ms with four hostile
302
+ requests and 0.7 s with sixteen, and 66 and 248 ms when the other threads
303
+ only burn CPU in pure Python. A deployment with a process per request
304
+ (gunicorn sync workers, a process pool) never had the problem. An exception
305
+ out of a pyld call, an interrupt included (a signal handler that raises a
306
+ timeout, KeyboardInterrupt), no longer leaves a half-updated cache behind:
307
+ the thread's cache is dropped, and pyld's shared inverse-context cache,
308
+ which an interrupt can tear (a stale key at the head of the LRU makes every
309
+ later eviction fail, for good: reproduced on CPython 3.10 within a few
310
+ thousand interrupts of a verification) is emptied in place if the exception
311
+ comes out of its derivation, or if a call made without the lock tore it:
312
+ the next derivation here finds the stale key, fails that one verification
313
+ and empties it, where every later call used to fail until the process
314
+ restarted. fork() waits for the lock and releases it on both sides, as
315
+ `logging` does for its own, so a child is not born with a half-written
316
+ cache, and a fork taken inside the lock no longer ends in "cannot release
317
+ un-acquired lock". Not covered: a signal handler that verifies a credential
318
+ on the thread it interrupted (never supported), and CPython 3.14.8, where
319
+ any `with lock:` can leak the lock when an asynchronous exception arrives
320
+ between acquiring it and entering the block (a plain Lock, an RLock and
321
+ acquire/try/finally alike, hundreds of times in 3,000 interrupts; 3.10 to
322
+ 3.13 and 3.15 do not): the lock is now held for tens of microseconds a
323
+ derivation instead of a whole verification, which narrows the window, and a
324
+ leaked one stops the next derivation of every other thread until the
325
+ process restarts. The CPU deadline reads `time.thread_time`, which on
326
+ Windows is GetThreadTimes and advances once per scheduler tick (CPython
327
+ reports 15.625 ms; not measured here, there is no Windows host): a span is
328
+ over- or under-charged by up to a tick, a refusal comes a tick or two after
329
+ the allowance, and no real document (1 to 100 ms, in two spans) is refused
330
+ for it; the tests run with a clock quantized that way. A platform without a
331
+ per-thread clock falls back to `process_time`, which counts every thread of
332
+ the process, so there a legitimate canonicalization could be refused under
333
+ load (it fails closed). What the Data Integrity hardening of this release
334
+ costs a legitimate user, against 4.6.2 (CPython 3.14 and 3.10; a loop of
335
+ `verify()` or `add_data_integrity_proof()` with one deep copy per call;
336
+ best of three 6-second runs): verifying a small credential 257 to 205
337
+ operations per second on one thread (-20%; 3.10: -19%) and 270 to 200 on
338
+ eight (-26%), 1EdTech's Complete example 22.9 to 19.3 (-16%), signing with
339
+ `add_data_integrity_proof` 935 to 509 (-46%; 3.10: -45%), about 0.9 ms more
340
+ per signature and 1 ms more per verification (the structure screen, an
341
+ extra expansion to count the duplicate checks, the metered URDNA2015 and,
342
+ for the signer, the context validation of what it signed). The per-thread
343
+ caches cost nothing in steady state: the same as the single lock on one
344
+ thread, 1 to 8% less on eight threads that only do legitimate work, where
345
+ 4.6.2 returned errors (57 of about 400 verifications of the Complete
346
+ example over three 6-second runs on CPython 3.10, 11 of about 420 on 3.14).
347
+
348
+ - security(ldp): an ecdsa-sd-2023 credential is screened, counted and
349
+ indexed on the dataset openvc-core's verify canonicalizes, within the
350
+ work budget. `OB3LdpVerifier` checks that the `validFrom`, `validUntil`
351
+ and `credentialStatus` statements of a presentation are mandatory, and to
352
+ index them it canonicalized the document once more, after the signature
353
+ check, with openvc-core's private helpers: an unmetered pyld, on a
354
+ dataset that was not the one openvc-core's verify reads (it turned the
355
+ `urn:bnid:` IRIs of the document into blank nodes; verify does not). A
356
+ crafted credential of a few KB, signed with a key of the attacker's own
357
+ (the default `OB3LdpVerifier()` accepts any did:key issuer), cost tens of
358
+ seconds of CPU and more, and the screen above never saw it. The graph
359
+ that has to be screened and indexed is not the one the JSON expands to,
360
+ though. openvc-core writes the dataset as N-Quads text, parses the text
361
+ back, canonicalizes what the parse made of it, then parses the canonical
362
+ text and writes it again, and pyld's N-Quads escaping and parsing are
363
+ not inverse on a literal that holds a backslash followed by `t`, `n` or
364
+ `r` (it reads back as a backslash and a TAB, a newline or a carriage
365
+ return, which is also what the backslash followed by the real character
366
+ reads as). Two literals the JSON tells apart can be one to openvc-core,
367
+ and the blank nodes that carry them can no longer be told apart: a
368
+ clique of eight blank nodes named by eight spellings of one string (a
369
+ backslash and `t`, or a backslash and a TAB, three times over) is
370
+ harmless to a canonicalizer that reads the JSON and costs openvc-core
371
+ 22 to 29 s of CPU for a 2 KB document with no key at all (CPython 3.12
372
+ and 3.14). The statement count, the work budget and the
373
+ mandatory-statement check now replay openvc-core's pipeline step for
374
+ step, the URDNA2015 step under the guard (`ob3._canon_guard.
375
+ canonize_dataset`), and read the document as presented, never
376
+ deskolemized. The lines are computed once, before the delegate runs, and
377
+ read again by the lifecycle check after the signature. A credential
378
+ openvc-core issued, derived and verifies is accepted whatever its
379
+ literals look like (40 of 40, six blank nodes with a `\theta` in each
380
+ evidence name and a credentialStatus without id), and one whose issuer
381
+ left the members of a status entry selective is refused every time. A
382
+ credential openvc-core cannot canonicalize (a Unicode line separator
383
+ U+2028 or U+2029, U+0085, VT, FF, FS, GS or RS in a literal, a `>` in an
384
+ IRI: its N-Quads parser breaks the line there) is refused before the
385
+ delegate, naming that limit, instead of by the delegate's JsonLdError.
386
+ What stays openvc-core's: a backslash followed by `t`, `n` or `r` and
387
+ the same followed by the real character are one string to it and sign as
388
+ one, so a holder can re-spell such a literal of a presentation without
389
+ breaking the signature, and a credential openvc-core issued with one
390
+ does not verify under a canonicalizer that follows RDFC-1.0 (the W3C
391
+ algorithm) to the letter.
392
+
393
+ - security(ldp): the ecdsa-sd-2023 delegate runs under the pyld lock.
394
+ openvc-core's verify calls pyld on its own, outside the lock the rest of
395
+ the Data Integrity path takes, and pyld's context caches are shared by
396
+ the process and are not thread-safe: verified from 16 threads, valid
397
+ credentials were refused at random (1 to 10 of 60 to 100 verifications in
398
+ 4 s on CPython 3.10, 3.14 and 3.15), and on 3.12 to 3.14 the caches were
399
+ sometimes left corrupted for good, so that every later verification or
400
+ signature in the process failed, eddsa-rdfc-2022 ones included, until
401
+ a restart. The delegate now takes the same lock as every other pyld call
402
+ of the path. The price is that it holds up the other verifications and
403
+ signatures of the process for as long as it works: a few milliseconds for
404
+ a legitimate credential, at most what the cap below allows for a hostile
405
+ one (the delegate's half of what that credential costs in all: 1.2 s on
406
+ CPython 3.10, 0.6 to 0.8 s on 3.11 to 3.15). A legitimate verification that arrives behind one
407
+ such credential took 0.11 to 0.17 s at the median and 0.8 to 1.5 s at the
408
+ 99th percentile (CPython 3.10, 3.12 and 3.14, 60 samples; 0.02 to 0.04 s
409
+ alone), and behind four of them at once 4.1 to 4.9 s and 5.3 to 6.8 s
410
+ (3.10, 3.12 and 3.14, 20 samples): the wait grows with the number of such credentials
411
+ verified at the same moment, so a service that verifies untrusted
412
+ selective-disclosure presentations in threads should do it in a process
413
+ of its own, or keep their number low. Without the lock the same
414
+ legitimate verification is not queued, and fails at random instead.
415
+
416
+ - security(ldp): an ecdsa-sd-2023 credential of more than 1,600 statements
417
+ (`ob3.ldp.MAX_DELEGATED_QUADS`) is refused with `OB3VerificationError`
418
+ before openvc-core sees it, counted on the N-Quads text before anything
419
+ parses it. openvc-core 1.35 to 1.37 parse the dataset back from N-Quads
420
+ text before the signature is checked, which pyld does in time quadratic
421
+ in the number of statements and whatever the graph looks like: a 110 KB
422
+ document of 12,000 statements cost about 14 s of CPU, a 160 KB one 80 s,
423
+ and neither is a poison graph, so the screen above let them through.
424
+ The screen now replays that pipeline, so a credential pays for the parse
425
+ twice (the screen, then the delegate). The worst case is one node with
426
+ several properties of many distinct values; signed with a key of the
427
+ attacker's own and verified by the default `OB3LdpVerifier()`, such a
428
+ credential at the limit (156 KB) costs the whole verification about 2 s
429
+ of CPU on CPython 3.10 (1.97 s interpolated, 2.28 s measured), 1.5 to 1.6
430
+ s on 3.13 and 3.14 and 1.3 to 1.5 s on 3.11, 3.12 and 3.15, half of it the
431
+ screen and half the delegate (openvc-core 1.35.0 and 1.37.0 alike); the
432
+ same count spread over many small nodes costs 1.1 s on 3.10. The
433
+ library's own presentations hold 28 to 273 statements, 1EdTech's
434
+ "Complete" example 322 and a credential with 100 alignments and 100
435
+ pieces of evidence 1,428; what no longer verifies is a credential of
436
+ more than 1,600 statements, roughly more than 110 fully described
437
+ alignments together with as many evidence entries. (A Comprehensive
438
+ Learner Record is not affected: its context is not one the delegate is
439
+ given, so ecdsa-sd-2023 CLRs were never verifiable here.) The limit goes
440
+ when openvc-core canonicalizes the dataset directly or takes a bound.
441
+
442
+ - fix(ldp): the `proofValue` of an ecdsa-sd-2023 proof is checked for its
443
+ shape (a multibase `u` string that starts with the suite's CBOR tag)
444
+ before the document is canonicalized, so a missing or foreign value is
445
+ refused without the screen's cost (a value of that shape that does not
446
+ decode still pays the screen, 0.5 s for a 23 KB document, never more
447
+ than a decodable one does); and a credential whose `proof` is an array
448
+ now verifies for ecdsa-sd-2023 as it already did for eddsa-rdfc-2022 (it
449
+ was refused with "credential has no proof object" by the delegate, which
450
+ was handed the array). Several supported proofs are still refused as
451
+ ambiguous; the other entries of the array (another cryptosuite, an empty
452
+ object, anything that is not an object) are ignored, not verified, for
453
+ both cryptosuites.
454
+
455
+ - security(ldp): the structure of a Data Integrity document is bounded
456
+ before any JSON-LD processing. pyld applies a type-scoped `@context` once
457
+ per entry of every node's `type` array, duplicates included, and once per
458
+ typed node, in expansion and again in compaction (and context validation
459
+ expands and compacts each embedded endorsement again on its own); it
460
+ applies the entries of an `@context` array one by one. The 256 KiB
461
+ document cap bounds the bytes, not that work, and the signature check
462
+ comes after it: 22,500 repeated types over ~300 nodes (258 KB) cost
463
+ `OB3LdpVerifier.verify` 9 to 11 s of CPU, the same inside one embedded
464
+ endorsement 12 to 15 s, and a flood of ~7,000 distinct typed nodes 6 to
465
+ 7 s, every one of them ending in "signature mismatch", on a document
466
+ nobody had authenticated. Every release since 3.2.0 pays it (a 229 KB
467
+ document of repeated types took 2.2 s on 4.5.0 and 4.6.0, which only
468
+ canonicalized, and 6.8 s on 4.6.1 and 4.6.2, which also validate the
469
+ contexts; 3.2.0 to 4.4 share the canonicalization path but could not be
470
+ run here), and `verify_data_integrity_proof` and `add_data_integrity_proof`,
471
+ which capped nothing then, also paid ~3 ms for each entry of an `@context`
472
+ array listing one pinned context a thousand times (34 s for 610 KB). The new
473
+ `ob3/_structure_screen.py` makes one iterative pass over the parsed JSON
474
+ (no pyld, no recursion, any nesting) at the top of
475
+ `OB3LdpVerifier.verify`, `verify_data_integrity_proof`,
476
+ `add_data_integrity_proof` and `OB3LdpSigner.sign`, and refuses with
477
+ `OB3VerificationError` ("refusing the credential: ...";
478
+ `ErrorSigningFile` when signing; the message names the limit, never the
479
+ document): a node whose `type` repeats an entry or lists more than 8; a
480
+ document with containers nested more than 36 deep (see the nesting entry
481
+ below); a document with more than 1,600 typed objects, 2,000 type entries
482
+ or 8,000 objects, an embedded endorsement's content counting once more
483
+ for every credential that holds it and a value of a property named like
484
+ any term that has an `@context` of its own counting as one type entry (26
485
+ terms in the pinned contexts, `cnf`, `proofPurpose`, `DataIntegrityProof`,
486
+ `Achievement`, `Profile` among them; the CLR context's three when the
487
+ low-level functions are given it, and those of any `extra_contexts`; pyld
488
+ applies that context to every value, however the arrays are nested: a
489
+ list of 130,000 integers under the key `DataIntegrityProof` cost 6 to 9 s
490
+ of CPU through `verify`, 11 to 16 s inside an endorsement); and, in the
491
+ two low-level functions (context validation bounds it for the verifier),
492
+ an `@context` array of more than 8 entries or 4,096 entries in all. The
493
+ low-level functions run no context validation, a node takes about half
494
+ the passes there, and they take twice the three totals for eddsa-rdfc-2022
495
+ (ecdsa-sd-2023 keeps the verifier's). The limits come from timing the
496
+ most expensive document each one admits through `verify` on CPython 3.10
497
+ to 3.15: 1.25 to 1.55 s of CPU on an Apple M4 Pro (3.10 the slowest, 1.25
498
+ to 1.45 s on 3.11 to 3.15), against 7 to 15 s before, and every hostile
499
+ shape above is refused in tens of milliseconds at most (the screen itself
500
+ takes about a millisecond on a legitimate badge). Real credentials sit
501
+ far below them: the 1EdTech "Complete" example, as the tests model it,
502
+ has 104 typed objects and a badge with 200 alignments, 500 evidence
503
+ entries and 50 results 805. What no longer verifies: a badge with more
504
+ than 1,600 typed objects (a CLR is bounded by its size first: see the
505
+ entry on CLRs below).
506
+
507
+ - security(ldp): `verify_data_integrity_proof` and `add_data_integrity_proof`
508
+ refuse an inline `@context` that uses `@import`. pyld merges an imported
509
+ context into the document the loader returned, and the loader hands out
510
+ the one pinned copy that every call of the process shares, so a document
511
+ handed to either function with {"@import": <a pinned context URL>} in an
512
+ inline context rewrote that bundled context for every later verification
513
+ and signature of the process, in every thread, until it restarted (the
514
+ definition of a term it added or changed was then the attacker's for
515
+ everyone). `OB3LdpVerifier` and `OB3LdpSigner` were not exposed: they
516
+ refuse inline contexts before pyld runs. The two low-level functions
517
+ (the only CLR verification route, and the W3C vectors) did not. The
518
+ structure screen now refuses the key at any depth of an `@context`, in
519
+ the verifier and the signer as well, before any JSON-LD processing.
520
+
521
+ - security(ldp): `verify_data_integrity_proof` bounds the size of the dict
522
+ it is handed, and `add_data_integrity_proof` the size of the document it
523
+ returns. The 256 KiB cap lived in `OB3LdpVerifier`'s parse and in
524
+ `add_data_integrity_proof`; the low-level verify, which is how CLR
525
+ credentials are verified, bounded nothing, so a large dict paid the whole
526
+ Python walk before it was refused (10 million empty objects: 2.1 s of CPU
527
+ and 690 MiB). It now measures the compact UTF-8 form of the dict, as
528
+ `add_data_integrity_proof` does, with `json.dumps` in C before anything
529
+ walks it (0.13 s and 40 MiB for the same dict), and refuses with
530
+ "credential document exceeds the 262144-byte limit". A document
531
+ `OB3LdpVerifier` accepts is never refused here: it measures the document
532
+ as received, spaces and escapes included. `add_data_integrity_proof`
533
+ measured the document without the proof it adds (about 0.4 KB), so one
534
+ within that of the cap was signed and then refused by every verifier: it
535
+ measures the signed document too, and refuses with "N bytes once signed".
536
+
537
+ - security(ldp): a Data Integrity document may nest at most 36 containers
538
+ deep (the JSON bound `_safejson` applies to everything is 128), and the
539
+ limit that remains on CPython 3.11 and 3.12 is documented. On those two
540
+ versions the interpreter allocates its call-stack data in 16 KiB chunks,
541
+ and a tight loop whose calls straddle a chunk boundary pays an allocation
542
+ for each call. pyld's duplicate check for the values of a node property
543
+ (`compare_values`, up to 1,000,000 comparisons, 0.35 s) is such a loop: a
544
+ 28 KB document of 34 nested objects around an array of 1,300 distinct
545
+ objects cost `OB3LdpVerifier.verify` and `verify_data_integrity_proof` 5
546
+ to 10 s of CPU (0.3 s at 33 or 35 levels), ending in "signature
547
+ mismatch". Where the boundary falls depends on how deep the caller
548
+ already is (a web framework adds 40 to 100 frames), so whether a
549
+ deployment is exposed depends on its own stack and the document is
550
+ chosen to match it. For the worst shape (objects nested directly) at least
551
+ 86 % of the caller depths have a nesting depth at which the loop sits on
552
+ a boundary within the 128 levels, and 22 % within 36 (the deepest document
553
+ the library accepts, 8 embedded endorsements inside a CLR member, is 28
554
+ deep; the 49 1EdTech examples and test documents are 2 to 10). **Known limit**: the cap lowers
555
+ the odds, it does not remove the cliff, and a hit costs about 7
556
+ microseconds per comparison through `verify` (10 through the low-level
557
+ function) against 0.35, up to the 1,000,000 the canonicalization guard
558
+ allows: on 3.11 and 3.12, 5 to 10 s of CPU in the unlucky 22 %. CPython
559
+ 3.10 and 3.13 to 3.15 do not have it (no outlier in 3,408
560
+ placements each). Run the workers that verify untrusted credentials under a CPU
561
+ limit (a resource limit or a timeout that kills the worker) where 3.11 or
562
+ 3.12 is in use.
563
+
564
+ - fix(ob3): a signed CLR is held to the 256 KiB the verifiers accept, and
565
+ `sign_clr_credential` says how to split one that is over it. Its
566
+ docstring and the wiki quoted "about 280 signed member credentials" and
567
+ a CLR of a thousand achievements plus a thousand associations, counting
568
+ the structural limits only; the size cap binds first on every shape. A
569
+ signed member credential takes 0.93 KB at the least (281 fit in one
570
+ CLR), 1.5 KB with three alignments, a result, evidence and an image
571
+ (176) and 1.7 KB with a result description and an achievement image
572
+ (154); an achievement with an alignment and its association take 0.4 KB
573
+ (about 650), and the thousand-achievement CLR is 400 KB. The structural
574
+ limits come after, at about 500, 285 and 245 members of the three sizes.
575
+ The `ErrorSigningFile` now says what to do: "this CLR holds 300 member
576
+ credentials of about 931 bytes each; sign it as several CLRs of at most
577
+ about 266 member credentials" (or achievements, or associations, for a
578
+ CLR that lists those). **Changed**: 4.6.2 put no cap on a CLR; it signed
579
+ one of 400 minimal members (505 KB) in 0.4 s and
580
+ `verify_data_integrity_proof`, which is how CLRs are verified, took it.
581
+ Both now refuse a CLR over 256 KiB (compact UTF-8), so one that big
582
+ signed by 4.6.2 no longer verifies, and a transcript that embeds more
583
+ members than fit has to be split into several CLRs. The size is not what
584
+ protects the CPU (the structural limits do) but one rule for every Data
585
+ Integrity document, signer and verifier alike. Signing or verifying a
586
+ CLR takes about 1.8 times the CPU of 4.6.2 (0.45 s against 0.25 s for 250
587
+ members), the cost of the checks added in 4.6.3.
588
+
589
+ - docs(compatibility): what 4.6.3 changes for a caller who sends no hostile
590
+ input. Nothing is removed or renamed, and every credential of the test
591
+ suite and of 1EdTech's examples verifies as it did in 4.6.2; what follows
592
+ is what a deployment may notice.
593
+ - Dependencies. `cryptography` must be `>=50` (it was `>=45`): a floor, not
594
+ a pin, but an environment that holds `cryptography<50` (a distribution
595
+ package, a constraints file, a lock file built on the old floor) stops
596
+ resolving until that is lifted, and 49.0.0 and later publish no wheel
597
+ for macOS x86_64 or 32-bit Windows. `pyld>=3.3.0,<4` (the ceiling dates
598
+ from 4.6.2) is a pin in practice, 3.3.0 being the only release in that
599
+ range: the canonicalization guard refuses with `OB3GuardUnavailable` any
600
+ pyld it was not fitted to, and pip checks the range only when it
601
+ resolves.
602
+ - New names. `OB3GuardUnavailable` (a subclass of `OB3VerificationError`,
603
+ exported by `openbadgeslib.ob3`) is the only name this release adds to a
604
+ public `__all__`. `openbadgeslib.ob3.ldp.MAX_DELEGATED_QUADS` is a module
605
+ constant outside any `__all__`; the guard, the structure screen, the JSON
606
+ bound and the lock around pyld live in underscore modules.
607
+ - Refused now, accepted before. A number that is not finite or not a float
608
+ (`Infinity`, `NaN`, `1e999`: an OB1 `expires`, `creditsAvailable`, a
609
+ status entry), a lone surrogate, and JSON nested more than 128 levels in
610
+ a token, a baked assertion or a document a host serves. In a Data
611
+ Integrity document, for both cryptosuites: more than 1,600 typed
612
+ objects, 2,000 type entries or 8,000 objects (twice that through the
613
+ low-level functions, which a CLR uses), a node with more than 8 types
614
+ or a repeated one, more than 1,414 distinct
615
+ values in one property (about 1,000 in each of two), an `@context` of
616
+ more than 8 entries in the low-level functions, a canonicalization
617
+ beyond its work or time budget, and an ecdsa-sd-2023 credential of more
618
+ than 1,600 statements. A real badge is far inside all of them (1EdTech's
619
+ "Complete" example has 104 typed objects and spends 1,124 of the 250,000
620
+ units), but a badge with 1,500 alignments verified in 4.6.2 and does not
621
+ now.
622
+ - Signing. `add_data_integrity_proof`, `OB3LdpSigner` and
623
+ `sign_clr_credential` refuse a document over 256 KiB (compact UTF-8)
624
+ before any JSON-LD work, so a CLR that 4.6.2 signed may not be signed
625
+ again: of member credentials of 1.34 KB (three alignments and an
626
+ evidence entry) 194 fit, and 4.6.2 signed 400 (538 KB). Verifying one
627
+ that 4.6.2 signed is unchanged up to the structure limits above.
628
+ - Accepted now, refused before. A credential whose `proof` is an array of
629
+ one entry verifies for ecdsa-sd-2023, as it did for eddsa-rdfc-2022.
630
+ A timestamp with no UTC `datetime` (`9999-12-31T23:59:59-05:00`) is
631
+ accepted, as in 4.6.2, and now also serialised (with its own offset).
632
+ - Messages and types. A document pyld cannot expand fails with "could not
633
+ canonicalize the credential: ..." (it was "Could not convert input to
634
+ RDF dataset"). A hostile token, body or document that ended in a bare
635
+ `RecursionError`, `OverflowError`, `TypeError` or `UnicodeEncodeError`
636
+ is now the typed failure of the verifier it reached
637
+ (`OB3VerificationError`, `OB2VerificationError`, `ErrorSigningFile`,
638
+ `AssertionFormatIncorrect`), and OB1's `get_badge_status` returns its
639
+ VerifyInfo where it raised: code that matches on the old text, or
640
+ catches the bare exceptions, should use those.
641
+ - Cost. Signing and verifying an eddsa-rdfc-2022 document takes more CPU
642
+ (these figures are for that suite; the ecdsa-sd-2023 entries above give
643
+ theirs): CPython 3.14, minimum of 5 runs against 4.6.2, a badge with 200
644
+ alignments 0.083 to 0.100 s to verify and one with 1,000 alignments
645
+ 0.51 to 0.60 s (about 1.2 times), a CLR of 100 member credentials
646
+ (135 KB) 0.15 to 0.26 s and of 150 (202 KB) 0.23 to 0.40 s (about 1.8
647
+ times), either way to sign or to verify. The pyld calls of the Data
648
+ Integrity path share one process-wide lock, so verifications on the
649
+ threads of one process no longer overlap inside pyld; use processes to
650
+ scale.
651
+
7
652
  * v4.6.2 - 2026-10-16
8
653
 
9
654
  - security(deps): the openvc-core floor of `[eudi]`, `[ldp-sd]` and