openbadgeslib 4.6.3__tar.gz → 4.6.4__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.
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/Changelog.txt +377 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/PKG-INFO +1 -1
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/baking.py +101 -31
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/issue.py +13 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob2/verifier.py +58 -4
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/_canon_guard.py +43 -2
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/_context_validation.py +114 -13
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/_structure_screen.py +5 -2
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/clr.py +20 -5
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/did.py +127 -12
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/eudi.py +65 -2
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/ldp.py +28 -8
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/publish.py +143 -24
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/status.py +49 -9
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/verifier.py +10 -3
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/handler.py +47 -2
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/memory_store.py +14 -2
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/sqlite_store.py +27 -11
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/store.py +37 -13
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_publish.py +44 -14
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_signer.py +116 -23
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/util.py +29 -3
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib.egg-info/PKG-INFO +1 -1
- openbadgeslib-4.6.4/tests/test_baking.py +489 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_issue_credential.py +80 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob2_verifier.py +151 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_did.py +321 -5
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_eudi_sd_jwt.py +153 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp.py +78 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_canon_guard.py +68 -23
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_context_validation.py +384 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_ecdsa_sd.py +20 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_ecdsa_sd_dos.py +14 -3
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_structure_screen.py +13 -2
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_publish_cli.py +398 -1
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_status.py +267 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_oid4vci_protocol.py +427 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_oid4vci_store.py +146 -3
- openbadgeslib-4.6.4/tests/test_signer_batch.py +598 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_util.py +194 -4
- openbadgeslib-4.6.3/tests/test_baking.py +0 -192
- openbadgeslib-4.6.3/tests/test_signer_batch.py +0 -252
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/CONTRIBUTING.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/GOVERNANCE.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/LICENSE.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/MANIFEST.in +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/README.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/SECURITY.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/docs/README.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_jsonmodel.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_jws/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_jws/exceptions.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_jws/utils.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_ob1_api.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_python_support.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/_safejson.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/badge_model.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/cli_common.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/config.ini.example +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/confparser.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/errors.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/keys.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/logs.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/mail.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob1/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob1/badge.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob1/signer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob1/verifier.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob2/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob2/models.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob2/signer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/clr_context_2.0.1.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/credentials-v2.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/ob-v3p0-context-3.0.1.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/ob-v3p0-context-3.0.2.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/ob-v3p0-context-3.0.3.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/ob-v3p0-extensions.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/security-data-integrity-v2.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/contexts/security-multikey-v1.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/credential.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/signer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/status_list.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/ob3/status_registry.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/__init__.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/codes.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/errors.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/formats.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/metadata.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/nonce.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/offer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/oid4vci/reconcile.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_cli.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_init.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_keygenerator.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_status.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/openbadges_verifier.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/py.typed +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib/verify.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib.egg-info/SOURCES.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib.egg-info/dependency_links.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib.egg-info/entry_points.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib.egg-info/requires.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/openbadgeslib.egg-info/top_level.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/pyproject.toml +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/setup.cfg +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/config1.ini +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conformance/Dockerfile.ob3 +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conformance/README.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conformance/conftest.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conformance/docker-compose.yml +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conformance/relax-danubetech-checksums.awk +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conformance/test_official_validators.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/conftest.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/ob_schemas/README.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/ob_schemas/ob_v3p0_achievementcredential_schema.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/ob_schemas/ob_v3p0_profile_schema.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/ob_schemas/refresh.sh +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/vc_di_eddsa/README.md +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/vc_di_eddsa/credentials-examples-v2.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/vc_di_eddsa/doc-hash.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/vc_di_eddsa/key-pair.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/vc_di_eddsa/proof-config-hash.txt +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/fixtures/vc_di_eddsa/signed-credential.json +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/images/sample1.png +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/images/sample1.svg +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/images/userimage01.svg +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/ldp_helpers.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/logo Python Espan/314/203a.svg" +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/logo Python Espa/303/261a.svg" +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_b64url.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_cli_json.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_cli_smoke.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_confparser.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_docs.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_eddsa.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_errors.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_examples.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_issue.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_jsonmodel.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_jws.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_key_operation.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_keys.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_mail.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob1_badge_io.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob1_deprecation.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob1_signer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob1_verifier.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob2_cli.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob2_error_branches.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob2_models.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob2_signer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_canon_guard_dataset.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_clr.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_conformance_schema.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_contexts.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_credential.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_did_doc.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_endorsement.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_eudi_oid4vci.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_eudi_type_metadata.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_eudi_x5c.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_cli.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_errors.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_ldp_sign.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_signer.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_signer_cli_ldp.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_status_list.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_status_registry.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_ob3_verifier.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_oid4vci_config.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_oid4vci_reservations.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_openbadges_cli.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_public_api.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_python_support.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_safejson.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_sign_ecc.pem +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_sign_rsa.pem +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_untrusted_input.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_verifier_cli_coverage.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_verify.py +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_verify_ecc.pem +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/test_verify_rsa.pem +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/withoutxmlheader.svg +0 -0
- {openbadgeslib-4.6.3 → openbadgeslib-4.6.4}/tests/withxmlheader.svg +0 -0
|
@@ -4,6 +4,383 @@ OpenBadgesLib - Changelog
|
|
|
4
4
|
Newest first. Dates are ISO 8601 (YYYY-MM-DD).
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
* v4.6.4 - 2026-11-18
|
|
8
|
+
|
|
9
|
+
- security(ldp): on CPython 3.11 and 3.12 the JSON-LD to RDF conversion may
|
|
10
|
+
make at most 150,000 duplicate checks (1,000,000 on every other
|
|
11
|
+
interpreter, as before; `MAX_NODE_MAP_PAIRS` is 150,000 on CPython 3.11
|
|
12
|
+
and 3.12), which bounds what the stack-depth cliff that 4.6.3 documented
|
|
13
|
+
as a known limit can cost to about 1.3 s. Those two interpreters allocate the call-stack data in 16 KiB
|
|
14
|
+
chunks, and a tight loop whose calls straddle a chunk boundary pays an
|
|
15
|
+
allocation for each call; pyld's duplicate check for the values of a node
|
|
16
|
+
property (`compare_values`) is such a loop, and where the boundary falls
|
|
17
|
+
depends on how deep the caller's stack is and how deep the document
|
|
18
|
+
nests. At the wrong placement a comparison costs 5.8 to 7.5 microseconds
|
|
19
|
+
instead of 0.3, whatever the shape (flat arrays, values merged across
|
|
20
|
+
arrays, nodes referenced by identifier) and the size (101,000 to 979,000
|
|
21
|
+
comparisons: the same 18 to 24 times), in about 2 % of the caller depths,
|
|
22
|
+
so what a hit costs is the number of comparisons the allowance admits
|
|
23
|
+
times 7 microseconds, and only the allowance can bound it. Under the
|
|
24
|
+
1,000,000 a 29 KB document of 34 nested objects around 1,300 distinct
|
|
25
|
+
ones cost `OB3LdpVerifier.verify` 6.2 s of CPU at the worst of 105
|
|
26
|
+
placements (4 or 5 of them over 1 s; 0.26 to 0.27 s at the others) on
|
|
27
|
+
CPython 3.11.15 and 3.12.13, and a property of 1,400 values 6.6 to 6.9 s.
|
|
28
|
+
Under 150,000 the same document is refused after 0.10 to 0.12 s ("the
|
|
29
|
+
document puts too many values on its node properties", before pyld
|
|
30
|
+
builds the node map), and the widest property that fits (540 distinct
|
|
31
|
+
values, nested 21 to 36 levels deep, 1,120 placements per interpreter)
|
|
32
|
+
costs at most 1.24 s on 3.11 and 1.28 s on 3.12, in 10 placements over 1
|
|
33
|
+
s. CPython 3.10 and 3.13 to 3.15, which have no such outliers, keep the
|
|
34
|
+
1,000,000, and so does every number the other entries of 4.6.3 quote for
|
|
35
|
+
them.
|
|
36
|
+
|
|
37
|
+
- Compatibility, CPython 3.11 and 3.12 only: a Data Integrity document with
|
|
38
|
+
more than 548 distinct values in one property (about 387 in each of two;
|
|
39
|
+
n distinct values cost n(n-1)/2 comparisons, summed over the properties
|
|
40
|
+
of the document and its proof options) that 4.6.3 verified or signed is
|
|
41
|
+
refused or not signed, with the message above, which names the property
|
|
42
|
+
and the node. A credential with 549 to 1,414 tags, alignments or evidence
|
|
43
|
+
entries on one node is the case; a real badge has a handful of values per
|
|
44
|
+
property, a CLR is held to a couple of hundred members by the structure
|
|
45
|
+
limits of 4.6.3, and the same credential verifies on the other
|
|
46
|
+
interpreters. The cap is two constants of `openbadgeslib/ob3/_canon_guard.py`,
|
|
47
|
+
`MAX_NODE_MAP_PAIRS_FULL` and `MAX_NODE_MAP_PAIRS_CHUNKED_STACK`;
|
|
48
|
+
`MAX_NODE_MAP_PAIRS` is the one in force.
|
|
49
|
+
|
|
50
|
+
- fix(ob3): the split advice of `sign_clr_credential` counts the duplicate
|
|
51
|
+
checks too. A CLR that lists 650 achievements and as many associations
|
|
52
|
+
fits the 256 KiB, and the advice ("sign it as several CLRs of at most about
|
|
53
|
+
N achievements") was given from the bytes and the structure alone; on
|
|
54
|
+
CPython 3.11 and 3.12 that many entries are over the node-map allowance
|
|
55
|
+
first (about 550 in one list, 390 in each of two), so the CLR the advice
|
|
56
|
+
described was refused again. It now takes the smaller of the two, and what
|
|
57
|
+
it advises signs.
|
|
58
|
+
|
|
59
|
+
- security(util): `download_file` no longer reads the body of a redirect.
|
|
60
|
+
urllib's redirect handler reads the body of a 301, 302, 303, 307 or 308
|
|
61
|
+
whole before it follows the Location (`fp.read()`, no size), and
|
|
62
|
+
`MAX_DOWNLOAD_SIZE` (5 MiB) was only checked on the response that
|
|
63
|
+
`download_file` returns. Any host a badge names (an OB2 `id`, `badge`,
|
|
64
|
+
issuer or `revocationList` URL, the OB1 `verify.url`, a did:web host, a
|
|
65
|
+
status list) could therefore answer with a redirect whose body the
|
|
66
|
+
verifier buffered in memory, on each of up to 10 hops, bounded by nothing
|
|
67
|
+
but the 60-second budget. A 302 with a 32 MiB body in front of a 12-byte
|
|
68
|
+
document cost 33,554,607 bytes read and a peak of 48 MiB (64 MiB when
|
|
69
|
+
chunked), and the download succeeded; a redirect that announced more body
|
|
70
|
+
than it sent was an `http.client.IncompleteRead`. The response of a
|
|
71
|
+
redirect is now closed before the Location is followed (urllib never
|
|
72
|
+
reuses that connection), so the same downloads read 0.2 to 131 KB, the
|
|
73
|
+
headers and what one buffered read brings with them, on CPython 3.10 to
|
|
74
|
+
3.15, and the one that announced more than it sent returns its document
|
|
75
|
+
(so does one whose body arrives a byte at a time, which used to spend the
|
|
76
|
+
whole time budget). A redirect whose target is refused (not HTTPS, not a
|
|
77
|
+
public host) closes its response too, where it left the socket to the
|
|
78
|
+
garbage collector. Unchanged: the HTTPS-only and public-host checks of
|
|
79
|
+
every redirect target, the pinned IP, the size cap on the response
|
|
80
|
+
returned, the time budget, and what a redirect loop or a redirect without
|
|
81
|
+
a Location raises (`HTTPError`; a 308 on CPython 3.10, where urllib does
|
|
82
|
+
not follow it, likewise).
|
|
83
|
+
|
|
84
|
+
- security(ob3): one credential can no longer make a status check download
|
|
85
|
+
without limit. With `check_status=True` (`--check-status`) every
|
|
86
|
+
`credentialStatus` entry cost one download of the list it names, each
|
|
87
|
+
with its own 60-second budget, the same list again for every entry that
|
|
88
|
+
named it, and the number of entries is chosen by whoever built the
|
|
89
|
+
credential (a did:key credential is the presenter's own): a JWT-VC of
|
|
90
|
+
about 500 KB with 2,000 entries made 2,000 downloads. A credential with
|
|
91
|
+
more than 8 `credentialStatus` entries is now refused before anything is
|
|
92
|
+
fetched (`MAX_STATUS_ENTRIES` in `openbadgeslib/ob3/status.py`; a W3C
|
|
93
|
+
credential carries one entry per status purpose and this library issues
|
|
94
|
+
at most two), and within one check each distinct `statusListCredential`
|
|
95
|
+
URL is downloaded once, while every entry is still checked in full
|
|
96
|
+
against the list it names (purpose, index, `statusSize`, validity window
|
|
97
|
+
and, when the list is verified, its issuer and proof). Both live in
|
|
98
|
+
`check_credential_status`, so they hold for JWT-VC and Data Integrity
|
|
99
|
+
credentials alike. `OB3Verifier.verify` also checks the recipient before
|
|
100
|
+
the status, so a recipient mismatch costs no download; a credential that
|
|
101
|
+
is both revoked and presented for the wrong recipient is now reported as
|
|
102
|
+
a recipient mismatch.
|
|
103
|
+
|
|
104
|
+
- security(publish): `openbadges-publish` publishes the public key a
|
|
105
|
+
badge's `public_key` file holds, after checking it, and no longer a copy
|
|
106
|
+
of the file. All three versions wrote the configured file verbatim as
|
|
107
|
+
`verify.pem` (`-V 2` also as `publicKeyPem` in `key.json`), so a config
|
|
108
|
+
with one crossed path (`public_key` naming the private key file) served
|
|
109
|
+
the signing key at the public URL, with exit 0; `-V 3` reported that the
|
|
110
|
+
file was not a public key, left the badge out of `did.json`, and
|
|
111
|
+
published the file all the same. The file is now read once and must be
|
|
112
|
+
an RSA, EC or Ed25519 public key (any PEM flavour, PKCS#1
|
|
113
|
+
`RSA PUBLIC KEY` included): a file with `PRIVATE KEY` anywhere in it is
|
|
114
|
+
refused before it is parsed, and when the badge's `private_key` is
|
|
115
|
+
readable the public key must be its public half, so the key of another
|
|
116
|
+
pair is refused too. What is written is that key re-serialised as a
|
|
117
|
+
SubjectPublicKeyInfo `PUBLIC KEY` PEM, never the file's bytes. On a
|
|
118
|
+
refusal `-V 1` and `-V 2` exit 1 before creating the output directory (a
|
|
119
|
+
missing key file is the same clean exit, where it was a traceback over a
|
|
120
|
+
half-written tree), and `-V 3` writes nothing for that badge: it is left
|
|
121
|
+
out of `did.json`, listed under `skipped`, and the run exits 2, or 1
|
|
122
|
+
with nothing written when no badge is left to publish. The status lists
|
|
123
|
+
of a refused badge are not regenerated either, so a `--revoke` on such a
|
|
124
|
+
config records the revocation in the registry and does not publish it
|
|
125
|
+
until the config is fixed; a badge whose key file is merely missing
|
|
126
|
+
behaves as before. The check is
|
|
127
|
+
`load_publishable_public_key` in `openbadgeslib/ob3/publish.py`, shared
|
|
128
|
+
by the three paths.
|
|
129
|
+
Compatibility: the `verify.pem` of a key file that was not already in
|
|
130
|
+
that form (PKCS#1, or without a trailing newline) differs in bytes from
|
|
131
|
+
the file; the key is the same. Whoever published with such a config
|
|
132
|
+
served the private key: delete the published `verify.pem` and `key.json`
|
|
133
|
+
(a refused `-V 3` run does not remove what an earlier run left in the
|
|
134
|
+
output directory) and replace the key pair.
|
|
135
|
+
|
|
136
|
+
- security(did): a did:web identifier is validated before it becomes a URL,
|
|
137
|
+
and the DID document it resolves to must be that DID's. The resolver
|
|
138
|
+
percent-decoded every component of the identifier, where the method
|
|
139
|
+
decodes only the `%3A` of a port, so an escaped `/`, `?`, `#` or `@`, a
|
|
140
|
+
`..` or an empty component chose any URL of the host, or another host:
|
|
141
|
+
`did:web:good.example:uploads:evil%23` was read from
|
|
142
|
+
`https://good.example/uploads/evil#/did.json` (the fragment drops the
|
|
143
|
+
mandatory `/did.json`), `did:web:good.example:api%3Fcb%3D` from
|
|
144
|
+
`https://good.example/api?cb=/did.json`, and
|
|
145
|
+
`did:web:good.example%40evil.example` from
|
|
146
|
+
`https://good.example@evil.example/.well-known/did.json`. Whoever could
|
|
147
|
+
place a JSON file at any path of a host (an upload, an endpoint that
|
|
148
|
+
echoes JSON) had an issuer DID of that host, which
|
|
149
|
+
`verify_badge(..., resolve_did=True)` and `openbadges-verifier
|
|
150
|
+
--resolve-did` reported as valid and trusted. Now the first component
|
|
151
|
+
must be a DNS name with an optional `%3A` port (up to 65535), and each
|
|
152
|
+
path component is non-empty, made of the DID syntax's characters
|
|
153
|
+
(letters, digits, `.`, `-`, `_`, `~` and well-formed `%XX` escapes) and
|
|
154
|
+
may not decode to `.`, `..`, or to anything holding `/`, `?`, `#`, `@`,
|
|
155
|
+
`:`, a backslash or a control character; anything else is an
|
|
156
|
+
`OB3VerificationError` ("invalid did:web identifier") and nothing is
|
|
157
|
+
fetched. A path component reaches the URL as the DID spells it, escapes
|
|
158
|
+
included. This covers `resolve_did`, `resolve_verification_method`,
|
|
159
|
+
`OB3Verifier.for_issuer_did`, `OB3LdpVerifier` and the CLI.
|
|
160
|
+
Behaviour change for issuers: a DID document whose `id` differs from the
|
|
161
|
+
DID it was fetched for, or that has none, is now refused (the host name
|
|
162
|
+
is compared without regard to case, the path exactly). The `did.json`
|
|
163
|
+
that `openbadges-publish -V 3` writes carries the right `id`; a
|
|
164
|
+
hand-written one, or one copied to a URL other than the one its DID
|
|
165
|
+
names, has to be corrected. A DID whose path holds an escape is read at
|
|
166
|
+
a different URL than before (`did:web:host:a%20b` at
|
|
167
|
+
`https://host/a%20b/did.json`, no longer at `https://host/a b/did.json`),
|
|
168
|
+
so a `publish_url` written already percent-encoded
|
|
169
|
+
(`https://host/a%20b/`), whose DID is `did:web:host:a%2520b`, no longer
|
|
170
|
+
resolves where it is served: write it unencoded.
|
|
171
|
+
|
|
172
|
+
- security(ob2): the HostedBadge `startsWith` scope is tested on the path a
|
|
173
|
+
server resolves, not on the one written in the assertion `id` (#339). The
|
|
174
|
+
origin and path-segment comparison of 4.4.3 ran on the path as written,
|
|
175
|
+
and the request goes out with that path untouched while the server that
|
|
176
|
+
answers normalises it: under `startsWith:
|
|
177
|
+
https://issuer.example/assertions/` the id
|
|
178
|
+
`https://issuer.example/assertions/../uploads/evil.json` (or `%2e%2e`, or
|
|
179
|
+
`./../`) was in scope and was served from `/uploads/`, so whoever could
|
|
180
|
+
write a JSON file anywhere on the issuer's origin minted hosted assertions
|
|
181
|
+
that `OB2Verifier.verify` and `verify_hosted` reported as that issuer's.
|
|
182
|
+
The path of the id and of each declared prefix is now decoded once and is
|
|
183
|
+
in no scope unless servers can read it one way only: no `.` or `..`
|
|
184
|
+
segment (bare or with path parameters, `..;x`), no empty segment (`//`),
|
|
185
|
+
no backslash or encoded slash (`%5c`, `%2f`), no escape left after the one
|
|
186
|
+
decoding (`%252e`), no control character and no escape that is not UTF-8
|
|
187
|
+
(the overlong `%c0%ae`). Such an id fails with "outside the issuer's
|
|
188
|
+
declared startsWith scope". The two sides are compared decoded, so `%41`
|
|
189
|
+
in a prefix now matches `A` in an id. Compatibility: under `startsWith`
|
|
190
|
+
an id with an encoded percent sign followed by two hex digits (`%2520`)
|
|
191
|
+
or with escapes in a legacy encoding (`caf%e9`) is refused, and
|
|
192
|
+
`/assertions;v=1` no longer counts as the prefix `/assertions` itself.
|
|
193
|
+
Issuers that declare no `startsWith` (the same-origin default,
|
|
194
|
+
`allowedOrigins`) are not affected.
|
|
195
|
+
|
|
196
|
+
- security(baking): the filter that strips active content from an SVG badge
|
|
197
|
+
image before the token is baked into it (#328) let four things through,
|
|
198
|
+
a plain `<script>` among them (#340). It walked the subtree of the first
|
|
199
|
+
element named `svg` rather than the document, so a script beside that
|
|
200
|
+
element survived (`<svg:svg ...><svg:script>` around a nested `<svg>`, or
|
|
201
|
+
an XHTML document that merely contains an `<svg>`); it kept an
|
|
202
|
+
`<?xml-stylesheet?>` processing instruction, whose XSLT sheet can emit
|
|
203
|
+
script; it trimmed the ends of a URL before testing its scheme, where a
|
|
204
|
+
browser also drops tab, LF and CR inside it (`java script:`); and it
|
|
205
|
+
kept a SMIL `<set attributeName="href" to="javascript:...">`, which gives
|
|
206
|
+
its target the URL the filter had removed. `baking.bake_svg` now filters
|
|
207
|
+
the whole document: elements are matched by local name whatever their
|
|
208
|
+
prefix, every element in the XHTML namespace goes, `set` / `animate*`
|
|
209
|
+
elements that target `href` / `src` / `action` or an `on*` attribute go
|
|
210
|
+
(animations of `opacity`, `fill`, `transform` and the like stay),
|
|
211
|
+
`xml-stylesheet` instructions and every processing instruction inside the
|
|
212
|
+
tree go, the DOCTYPE's internal subset goes (an `<!ATTLIST svg onload
|
|
213
|
+
CDATA "...">` default put the handler back when the baked file was
|
|
214
|
+
parsed), and C0 controls and spaces are removed from a URL before the
|
|
215
|
+
scheme test. Namespace declarations are now left alone: an `xmlns:`
|
|
216
|
+
prefix that began with `on`, or was called `href`, `src` or `action` with
|
|
217
|
+
a `javascript:` or `data:` namespace name, was removed as if it were a
|
|
218
|
+
handler or a link, which left the baked file with an unbound prefix that
|
|
219
|
+
no parser reads (`xmlns:ont="..."` in the metadata was enough) and would
|
|
220
|
+
have let an element fall back to an outer XHTML binding after it had been
|
|
221
|
+
judged. Compatibility: the root element must be `svg` in the
|
|
222
|
+
`http://www.w3.org/2000/svg` namespace, and the token is appended to it. A
|
|
223
|
+
root written with a prefix (`<s:svg xmlns:s="...">`), which used to end in
|
|
224
|
+
an `AttributeError`, now bakes; a document with any other root, or an
|
|
225
|
+
`<svg>` with no `xmlns` (which a browser does not render as an image), is
|
|
226
|
+
refused with `BadgeImgFormatUnsupported`, which the signers report as
|
|
227
|
+
`ErrorSigningFile` ("Unable to bake SVG ...: The image is not an SVG
|
|
228
|
+
document ..."). `has_svg` and `extract_svg` are unchanged, so badges baked
|
|
229
|
+
by earlier versions read as before, and an SVG that holds none of the
|
|
230
|
+
above bakes to the same bytes as before.
|
|
231
|
+
|
|
232
|
+
- security(oid4vci): the `tx_code` attempt cap holds against a burst of
|
|
233
|
+
guesses. The token endpoint tested the cap on the copy of the grant each
|
|
234
|
+
request had read, verified the guess (scrypt) and only then counted the
|
|
235
|
+
failure, so every request that read the grant before the third failure
|
|
236
|
+
was recorded had its guess verified: 32 wrong PINs sent at once to an
|
|
237
|
+
offer with 3 attempts got 32 verifications on `InMemoryOID4VCIStore` and
|
|
238
|
+
13 to 15 on `SqliteOID4VCIStore`, and the guessing budget of a PIN-gated
|
|
239
|
+
offer was the concurrency of the server. `handle_token_request` now
|
|
240
|
+
reserves the attempt before it verifies anything, through a new store
|
|
241
|
+
method, `reserve_tx_attempt(grant_id) -> bool`, that counts it only while
|
|
242
|
+
the grant is offered and has one left (one conditional UPDATE in SQLite,
|
|
243
|
+
one test-and-increment under the lock in memory). At most
|
|
244
|
+
`tx_code_max_attempts` verifications ever run against a grant: the same
|
|
245
|
+
burst gets 3, on both stores. A request that finds no attempt left is not
|
|
246
|
+
verified; it pays the scrypt any other rejection pays, closes the offer
|
|
247
|
+
and gets the same `invalid_grant`. One request at a time nothing changes:
|
|
248
|
+
two wrong PINs and then the right one redeem the code, the third wrong
|
|
249
|
+
one invalidates the offer. A right PIN now counts as an attempt as well.
|
|
250
|
+
`record_tx_failure` no longer counts (the reservation did) and no longer
|
|
251
|
+
touches a grant that is not offered: it used to mark the grant
|
|
252
|
+
invalidated at the cap whatever its state, so a wrong guess reported
|
|
253
|
+
after the code was redeemed could take the credential from whoever held
|
|
254
|
+
the PIN. API change, for a custom `OID4VCIStore` only: it needs
|
|
255
|
+
`reserve_tx_attempt`, and its `record_tx_failure` must stop incrementing
|
|
256
|
+
and must guard the state; without the new method a PIN-gated token
|
|
257
|
+
request fails with AttributeError, and with it but an old
|
|
258
|
+
`record_tx_failure` an offer closes after two wrong PINs instead of
|
|
259
|
+
three. The SQLite schema is unchanged.
|
|
260
|
+
|
|
261
|
+
- security(oid4vci): two more cases in which the token endpoint answered a
|
|
262
|
+
request according to the kind of grant its code names (4.4.4 closed the
|
|
263
|
+
missing-PIN one), and one unhandled exception at the credential endpoint.
|
|
264
|
+
A `tx_code` that is not a string (a JSON number from a naive decoder,
|
|
265
|
+
bytes nobody decoded) was `invalid_grant` for an unknown code,
|
|
266
|
+
`invalid_request` for a live offer without a PIN, and an AttributeError
|
|
267
|
+
out of scrypt for a live PIN-gated one: a 500, for a guess that was not
|
|
268
|
+
counted as an attempt. `handle_token_request` now refuses it before the
|
|
269
|
+
store is asked anything, as `invalid_request` ("the tx_code parameter
|
|
270
|
+
must be a string"), the same for every code, and nothing is spent. That
|
|
271
|
+
includes `0`, `False` and `b''`, which were taken for no `tx_code` at
|
|
272
|
+
all. A string `tx_code` sent to a live offer that does not use one was
|
|
273
|
+
answered at once, where an unknown code costs a scrypt; it now burns the
|
|
274
|
+
same `dummy_tx_verification()` first. Its error code has not changed: it
|
|
275
|
+
is still `invalid_request` where every other rejection is
|
|
276
|
+
`invalid_grant`, so that answer still says "live, and no PIN" to whoever
|
|
277
|
+
holds the code. And `handle_credential_request` answers an `access_token`
|
|
278
|
+
that is not a string with the 401 `invalid_token` of a missing one,
|
|
279
|
+
instead of an AttributeError.
|
|
280
|
+
|
|
281
|
+
- security(cli): `openbadges-signer` no longer writes a badge through a
|
|
282
|
+
symlink planted in the output directory (#342). The output names are
|
|
283
|
+
predictable (`badge_<n>_<recipient>.<ext>` and `.assertion.json`), the
|
|
284
|
+
already-signed check used `os.path.isfile`, which follows links and is
|
|
285
|
+
false for a dangling one, and the file was written with a plain `open()`:
|
|
286
|
+
a local user able to write to a shared `-o` directory could make the
|
|
287
|
+
operator create a file anywhere the operator can write or, with
|
|
288
|
+
`--force`, overwrite an existing one, with badge bytes. Anything at the
|
|
289
|
+
output name now counts as already signed (a symlink included, whatever it
|
|
290
|
+
points to), the file is created exclusively, and `--force` writes a new
|
|
291
|
+
file beside it and renames it over the name, so a symlink or a hard link
|
|
292
|
+
is replaced and what it pointed to is left untouched. On POSIX a link that
|
|
293
|
+
appears between the check and the write ends in the usual "Could not write
|
|
294
|
+
badge" exit. This covers `-V 1`, `-V 2` and `-V 3`, batch mode and the `-H`
|
|
295
|
+
assertion JSON. Compatibility: with `-H`, an existing `.assertion.json`
|
|
296
|
+
is now a reason to refuse (single badge) or skip (batch; the skipped
|
|
297
|
+
entry names it as `assertion_file`) unless `--force` is given, where it
|
|
298
|
+
used to be overwritten when the badge file itself was absent; and
|
|
299
|
+
`--force` replaces the file instead of truncating it in place, so the
|
|
300
|
+
result has the mode of a newly signed badge (from the umask) rather than
|
|
301
|
+
the mode of the file it replaced.
|
|
302
|
+
|
|
303
|
+
- security(eudi): `issue_badge_sd_jwt` binds a holder key only if it is a
|
|
304
|
+
public key (#343). `holder_jwk` was signed into `cnf.jwk` as given, with
|
|
305
|
+
no look at it, and `cnf` travels with the credential: a caller that
|
|
306
|
+
forwarded the whole key its wallet or client sent had the holder's private
|
|
307
|
+
key issued inside the badge (a private P-256 or Ed25519 JWK kept its `d`,
|
|
308
|
+
a symmetric `oct` key its `k`), and a str or a list became the `jwk`
|
|
309
|
+
itself. RFC 7800 section 3.2 wants a public key there. Now a value that is
|
|
310
|
+
not a JWK object, a JWK that carries any of the private members `d`, `k`,
|
|
311
|
+
`p`, `q`, `dp`, `dq`, `qi`, `oth` or `priv`, and a `kty` other than `EC`,
|
|
312
|
+
`OKP` or `RSA` raise `EudiError` before anything is signed. The key is
|
|
313
|
+
refused, never reduced to its public half: stripping would bind and
|
|
314
|
+
publish a key the caller did not mean to hand over. A public JWK is bound
|
|
315
|
+
as before, with its `kid`, `use`, `alg`, `key_ops` or `x5c` if it has
|
|
316
|
+
them. `issue_credential_from_conf(holder_jwk=...)` refuses the same
|
|
317
|
+
members before it derives the did:jwk; it already refused all of them but
|
|
318
|
+
`oth` (the RSA multi-prime member), which went into the signed `sub` of a
|
|
319
|
+
`jwt_vc_json` credential and into the `cnf` of a `vc+sd-jwt` one. The
|
|
320
|
+
OID4VCI credential endpoint never issued a key proof whose `jwk` header
|
|
321
|
+
carries `d`, `k`, `p`, `q`, `dp`, `dq`, `qi` or `priv` (openvc-core
|
|
322
|
+
answers `invalid_proof`), but it does not look for `oth` either: a P-256
|
|
323
|
+
proof key with a stray `oth` member was issued with it, in both formats,
|
|
324
|
+
and `handle_credential_request` now raises `IssuanceError` for it.
|
|
325
|
+
|
|
326
|
+
- security(ldp): the subject of an embedded endorsement credential may
|
|
327
|
+
carry only `id`, `type` and `endorsementComment`, the members of an
|
|
328
|
+
EndorsementSubject. An embedded endorsement names the node it endorses
|
|
329
|
+
(the achievement, the issuer) as its `credentialSubject`, and RDF lets a
|
|
330
|
+
node be described under any JSON object that references it, so the holder
|
|
331
|
+
of a Data Integrity badge could move the achievement's `description`,
|
|
332
|
+
`image` or `alignment` (the issuer's `name`, `url`, `image` or
|
|
333
|
+
`description`) into that subject: the same signed dataset, the same
|
|
334
|
+
signature, the document still its own compacted form, and
|
|
335
|
+
`OB3LdpVerifier.verify` returned a credential without them (an empty
|
|
336
|
+
description, no issuer name). Validity, status, recipient and issuer
|
|
337
|
+
verdicts were not affected. The rule goes by the position, not by the
|
|
338
|
+
subject's EndorsementSubject type, which a holder could move out the same
|
|
339
|
+
way. Compatibility: a badge whose embedded endorsement gives its subject
|
|
340
|
+
any other member, an extension included, no longer verifies. Not covered:
|
|
341
|
+
a node the issuer itself describes twice in the credential (the issuer
|
|
342
|
+
again as `achievement.creator`, a `criteria` with the achievement's id),
|
|
343
|
+
where a member can still be left only in the description the model does
|
|
344
|
+
not read (#345).
|
|
345
|
+
|
|
346
|
+
- security(ldp): a blank node label (`_:b7`) is refused as the `id` of a
|
|
347
|
+
Data Integrity credential, of its issuer, of a `credentialSubject` or of
|
|
348
|
+
a `credentialStatus` entry, in the credential and in each embedded
|
|
349
|
+
endorsement. A label is not part of the signed dataset (RDF
|
|
350
|
+
canonicalization relabels blank nodes), so `"id": "_:b7"` written on a
|
|
351
|
+
node that was signed without an id kept the signature valid and the
|
|
352
|
+
document its own compacted form, and `OB3LdpVerifier.verify` returned the
|
|
353
|
+
label as an identifier: as `recipient_id` for a subject signed with a
|
|
354
|
+
hashed `identifier` only (and `expected_recipient="_:b7"` matched it), as
|
|
355
|
+
the id of a status entry, and as the id of a credential or of an issuer
|
|
356
|
+
signed without one, which is refused as malformed when no label is
|
|
357
|
+
added. `OB3LdpSigner` no longer issues a credential with such an id
|
|
358
|
+
(`ErrorSigningFile`); the low-level functions, which check the proof
|
|
359
|
+
alone, are unchanged, and so is the JWT-VC path, where every byte is
|
|
360
|
+
signed. With ecdsa-sd-2023 only the credential's and the issuer's ids
|
|
361
|
+
are held to the rule: openvc-core's derive writes a label on every node
|
|
362
|
+
of a presentation that has no id, and OB 3.0 makes the id of a subject
|
|
363
|
+
and of a status entry optional, so a presentation of a credential whose
|
|
364
|
+
status entry has no id carries one there, keeps verifying, and still
|
|
365
|
+
shows it. The ids of other nodes (the achievement, an evidence, an
|
|
366
|
+
image) are not covered either: a rule for every node would refuse every
|
|
367
|
+
such presentation of a badge this library issues, whose `criteria` has
|
|
368
|
+
no id and so carries a label (#346).
|
|
369
|
+
|
|
370
|
+
- security(ldp): `OB3LdpVerifier.verify` checks the recipient before the
|
|
371
|
+
status, as `OB3Verifier.verify` does. With `check_status=True` and an
|
|
372
|
+
`expected_recipient` that the credential is not for, the status list was
|
|
373
|
+
downloaded (and its signature verified) before the mismatch was
|
|
374
|
+
reported; the recipient binding is local and free, so a credential
|
|
375
|
+
presented for someone else now costs no status list download. The proof,
|
|
376
|
+
the validity window and the ecdsa-sd-2023 lifecycle checks still come
|
|
377
|
+
first, so a did:web `verificationMethod` is still resolved before the
|
|
378
|
+
recipient is looked at. Compatibility: a credential that is presented
|
|
379
|
+
for the wrong recipient and whose status check would also fail (revoked,
|
|
380
|
+
suspended, a list that cannot be fetched or verified) is reported as a
|
|
381
|
+
recipient mismatch, not as the status failure; for the right recipient,
|
|
382
|
+
and without `expected_recipient`, nothing changes (#336).
|
|
383
|
+
|
|
7
384
|
* v4.6.3 - 2026-10-21
|
|
8
385
|
|
|
9
386
|
- fix(jws): the native JWS engine (OB1 and OB2 signed badges) answers a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openbadgeslib
|
|
3
|
-
Version: 4.6.
|
|
3
|
+
Version: 4.6.4
|
|
4
4
|
Summary: Production-ready Python library & CLI for Open Badges 3.0 (W3C Verifiable Credentials): issue, verify, and revoke JWT-VC credentials with Bitstring Status Lists and did:web — plus strict OB 2.0 and legacy OB 1.0.
|
|
5
5
|
Author-email: Luis González Fernández <luisgf@luisgf.es>, Jesús Cea Avión <jcea@jcea.es>
|
|
6
6
|
License: LGPLv3
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
# implementation here stops the two paths from drifting (e.g. two PNG readers,
|
|
27
27
|
# one fixed-offset and one structured).
|
|
28
28
|
|
|
29
|
+
import re
|
|
29
30
|
from struct import pack
|
|
30
31
|
from zlib import crc32
|
|
31
32
|
|
|
@@ -39,6 +40,7 @@ from png import Reader, signature as _png_signature
|
|
|
39
40
|
# accepts it as a real export) — `baking.DecompressionLimitExceeded` and
|
|
40
41
|
# `from openbadgeslib.baking import DecompressionLimitExceeded` keep working.
|
|
41
42
|
from .errors import DecompressionLimitExceeded as DecompressionLimitExceeded
|
|
43
|
+
from .errors import BadgeImgFormatUnsupported
|
|
42
44
|
|
|
43
45
|
# OB 2.0 document-format identifiers.
|
|
44
46
|
ITXT_KEYWORD = b'openbadges'
|
|
@@ -81,6 +83,13 @@ def _bounded_inflate(data: bytes, limit: int = MAX_ITXT_DECOMPRESSED) -> bytes:
|
|
|
81
83
|
# javascript: URLs in the source SVG would execute in that context (#328).
|
|
82
84
|
# `opacity` is the one SVG presentation attribute whose local name starts
|
|
83
85
|
# with "on" and is not an event handler.
|
|
86
|
+
#
|
|
87
|
+
# The filter covers the whole document, not the subtree of one element (#340):
|
|
88
|
+
# every element (matched by local name, whatever its prefix), every processing
|
|
89
|
+
# instruction inside the tree, the xml-stylesheet ones beside the root and the
|
|
90
|
+
# DOCTYPE's internal subset.
|
|
91
|
+
_SVG_XMLNS = 'http://www.w3.org/2000/svg'
|
|
92
|
+
_XHTML_XMLNS = 'http://www.w3.org/1999/xhtml'
|
|
84
93
|
_ACTIVE_SVG_ELEMENTS = frozenset({
|
|
85
94
|
'script', 'foreignobject', 'iframe', 'embed', 'object', 'handler',
|
|
86
95
|
})
|
|
@@ -88,24 +97,30 @@ _URL_ATTRS = frozenset({'href', 'src', 'action'})
|
|
|
88
97
|
_SAFE_DATA_IMAGE_TYPES = (
|
|
89
98
|
'image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/webp',
|
|
90
99
|
)
|
|
100
|
+
# What a browser's URL parser throws away before it reads the scheme: C0
|
|
101
|
+
# controls and spaces at both ends, tab/LF/CR anywhere. Removing all of them
|
|
102
|
+
# everywhere is the superset; no URL this filter lets through needs one.
|
|
103
|
+
_URL_IGNORED_CHARS = re.compile(r'[\x00-\x20]+')
|
|
104
|
+
_STYLESHEET_PI = 'xml-stylesheet'
|
|
91
105
|
|
|
92
106
|
|
|
93
107
|
def _svg_local_name(node: Any) -> str:
|
|
94
108
|
return str(node.tagName).split(':')[-1].lower()
|
|
95
109
|
|
|
96
110
|
|
|
97
|
-
def
|
|
98
|
-
|
|
99
|
-
if getattr(node, 'nodeType', None) == node.ELEMENT_NODE:
|
|
100
|
-
found.append(node)
|
|
101
|
-
for child in list(node.childNodes):
|
|
102
|
-
found.extend(_iter_svg_elements(child))
|
|
103
|
-
return found
|
|
111
|
+
def _is_handler_attr(local: str) -> bool:
|
|
112
|
+
return local.startswith('on') and local != 'opacity'
|
|
104
113
|
|
|
105
114
|
|
|
106
115
|
def _is_active_url(value: str) -> bool:
|
|
107
|
-
"""True for javascript:/vbscript: and for data: that is not a raster image.
|
|
108
|
-
|
|
116
|
+
"""True for javascript:/vbscript: and for data: that is not a raster image.
|
|
117
|
+
|
|
118
|
+
The scheme is read the way a browser reads it: ``java script:`` is
|
|
119
|
+
``javascript:`` to the WHATWG URL parser, so whitespace and control
|
|
120
|
+
characters are removed from the whole value before the test rather than
|
|
121
|
+
trimmed off its ends (#340).
|
|
122
|
+
"""
|
|
123
|
+
lowered = _URL_IGNORED_CHARS.sub('', value).strip().lower()
|
|
109
124
|
if lowered.startswith('javascript:') or lowered.startswith('vbscript:'):
|
|
110
125
|
return True
|
|
111
126
|
if not lowered.startswith('data:'):
|
|
@@ -114,26 +129,69 @@ def _is_active_url(value: str) -> bool:
|
|
|
114
129
|
return not any(payload.startswith(kind) for kind in _SAFE_DATA_IMAGE_TYPES)
|
|
115
130
|
|
|
116
131
|
|
|
117
|
-
def
|
|
118
|
-
"""
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
def _animates_active_attr(el: Any) -> bool:
|
|
133
|
+
"""True for a SMIL ``set`` / ``animate*`` element that targets a URL or an
|
|
134
|
+
event-handler attribute: ``<set attributeName="href" to="javascript:…"/>``
|
|
135
|
+
gives its target the URL that the attribute filter would have removed.
|
|
136
|
+
Animations of presentation attributes (``opacity``, ``fill``, …) are kept.
|
|
137
|
+
"""
|
|
138
|
+
local = _svg_local_name(el)
|
|
139
|
+
if local != 'set' and not local.startswith('animate'):
|
|
140
|
+
return False
|
|
141
|
+
target = _URL_IGNORED_CHARS.sub('', el.getAttribute('attributeName'))
|
|
142
|
+
target = target.split(':')[-1].lower()
|
|
143
|
+
return target in _URL_ATTRS or _is_handler_attr(target)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def _is_active_element(el: Any) -> bool:
|
|
147
|
+
# Anything in the XHTML namespace is active inside an image: <h:script>,
|
|
148
|
+
# <h:iframe>, <h:img onerror>, <h:link>, <h:meta http-equiv>, …
|
|
149
|
+
return (el.namespaceURI == _XHTML_XMLNS
|
|
150
|
+
or _svg_local_name(el) in _ACTIVE_SVG_ELEMENTS
|
|
151
|
+
or _animates_active_attr(el))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def _strip_svg_active_content(svg_doc: Any) -> None:
|
|
155
|
+
"""Drop from the document *svg_doc*: script-class and XHTML elements, on*
|
|
156
|
+
handlers, active URLs and the animations that would set either; the
|
|
157
|
+
``xml-stylesheet`` processing instructions beside the root (an XSLT sheet
|
|
158
|
+
can emit script) and every processing instruction inside the tree; and the
|
|
159
|
+
DOCTYPE's internal subset (an ``<!ATTLIST>`` default would put a handler
|
|
160
|
+
back when the baked file is parsed)."""
|
|
161
|
+
doctype = svg_doc.doctype
|
|
162
|
+
if doctype is not None:
|
|
163
|
+
doctype.internalSubset = None
|
|
164
|
+
for node in list(svg_doc.childNodes):
|
|
165
|
+
if (node.nodeType == node.PROCESSING_INSTRUCTION_NODE
|
|
166
|
+
and str(node.target).lower() == _STYLESHEET_PI):
|
|
167
|
+
svg_doc.removeChild(node)
|
|
168
|
+
# Iterative walk, so the depth of the source image is not a recursion
|
|
169
|
+
# limit here. The subtree of a removed node is never visited.
|
|
170
|
+
pending: List[Any] = [svg_doc.documentElement]
|
|
171
|
+
while pending:
|
|
172
|
+
el = pending.pop()
|
|
173
|
+
for name in list(el.attributes.keys()):
|
|
174
|
+
# A namespace declaration is neither a handler nor a link, and it
|
|
175
|
+
# must be written back as it was read: the verdicts above and below
|
|
176
|
+
# (is this the SVG root? is that element XHTML?) hold only for the
|
|
177
|
+
# bindings the parser saw. Judging xmlns:ont or xmlns:href by its
|
|
178
|
+
# prefix left the baked file with an unbound prefix, or let an
|
|
179
|
+
# element fall back to an outer XHTML binding.
|
|
180
|
+
if name == 'xmlns' or name.startswith('xmlns:'):
|
|
181
|
+
continue
|
|
131
182
|
local = name.split(':')[-1].lower()
|
|
132
|
-
if local
|
|
183
|
+
if _is_handler_attr(local):
|
|
133
184
|
el.removeAttribute(name)
|
|
134
|
-
|
|
135
|
-
if local in _URL_ATTRS and _is_active_url(attrs[name].value):
|
|
185
|
+
elif local in _URL_ATTRS and _is_active_url(el.getAttribute(name)):
|
|
136
186
|
el.removeAttribute(name)
|
|
187
|
+
for child in list(el.childNodes):
|
|
188
|
+
if child.nodeType == child.PROCESSING_INSTRUCTION_NODE:
|
|
189
|
+
el.removeChild(child)
|
|
190
|
+
elif child.nodeType == child.ELEMENT_NODE:
|
|
191
|
+
if _is_active_element(child):
|
|
192
|
+
el.removeChild(child)
|
|
193
|
+
else:
|
|
194
|
+
pending.append(child)
|
|
137
195
|
|
|
138
196
|
|
|
139
197
|
def bake_svg(image_bytes: bytes, token: str, comment: Optional[str] = None, *,
|
|
@@ -148,14 +206,26 @@ def bake_svg(image_bytes: bytes, token: str, comment: Optional[str] = None, *,
|
|
|
148
206
|
secured with a Data Integrity proof, whose payload is a JSON document
|
|
149
207
|
rather than a compact JWT (OB 3.0 §5.3).
|
|
150
208
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
209
|
+
The document element must be ``svg`` in the SVG namespace, with or without
|
|
210
|
+
a prefix; anything else raises :class:`BadgeImgFormatUnsupported` (a
|
|
211
|
+
document of another vocabulary that merely contains an ``<svg>`` is not a
|
|
212
|
+
badge image, and a filter written for SVG cannot vouch for it).
|
|
213
|
+
|
|
214
|
+
Active content in the source SVG (``<script>``, XHTML elements,
|
|
215
|
+
event-handler attributes, ``javascript:`` / hostile ``data:`` URLs, the
|
|
216
|
+
SMIL animations that would set either, ``xml-stylesheet`` processing
|
|
217
|
+
instructions, the DOCTYPE's internal subset) is stripped from the whole
|
|
218
|
+
document before the token is attached, so the baked carrier is not an XSS
|
|
219
|
+
gadget (#328, #340).
|
|
154
220
|
"""
|
|
155
221
|
svg_doc = parseString(image_bytes)
|
|
156
222
|
try:
|
|
157
|
-
svg_tag = svg_doc.
|
|
158
|
-
|
|
223
|
+
svg_tag = svg_doc.documentElement
|
|
224
|
+
if svg_tag.namespaceURI != _SVG_XMLNS or svg_tag.localName != 'svg':
|
|
225
|
+
raise BadgeImgFormatUnsupported(
|
|
226
|
+
'The image is not an SVG document: its root element is not '
|
|
227
|
+
'<svg> in the %s namespace' % _SVG_XMLNS)
|
|
228
|
+
_strip_svg_active_content(svg_doc)
|
|
159
229
|
node = svg_doc.createElement(element)
|
|
160
230
|
node.attributes['xmlns:openbadges'] = namespace
|
|
161
231
|
if as_text:
|
|
@@ -460,10 +460,23 @@ def _bind_holder(credential: Any, recipient: str,
|
|
|
460
460
|
|
|
461
461
|
The salt is fresh per credential, so the same address hashed for two badges
|
|
462
462
|
does not correlate them. Returns the did:jwk.
|
|
463
|
+
|
|
464
|
+
A did:jwk IS its JWK, and the SD-JWT path signs the same JWK into ``cnf``,
|
|
465
|
+
so a private member in *holder_jwk* would be published with the credential.
|
|
466
|
+
It is refused here, before anything is allocated or signed, and never
|
|
467
|
+
stripped: the list is the SD-JWT issuer's own, which also names ``oth``
|
|
468
|
+
(the RSA multi-prime member) that the did:jwk encoder does not look for.
|
|
463
469
|
"""
|
|
464
470
|
from .ob3 import IdentityObject
|
|
465
471
|
from .ob3.did import did_jwk_from_jwk
|
|
472
|
+
from .ob3.eudi import _private_jwk_members
|
|
466
473
|
|
|
474
|
+
leaked = _private_jwk_members(holder_jwk)
|
|
475
|
+
if leaked:
|
|
476
|
+
raise IssuanceError(
|
|
477
|
+
'invalid holder key: the JWK carries private members %s; a holder '
|
|
478
|
+
'key must be a public key, and it is signed into the credential'
|
|
479
|
+
% leaked)
|
|
467
480
|
try:
|
|
468
481
|
holder_did = did_jwk_from_jwk(holder_jwk)
|
|
469
482
|
except ValueError as exc:
|