Indicio-tech / pydid

Python library for validating, constructing, and representing DIDs and DID Documents
Apache License 2.0
11 stars 12 forks source link

fix!: publicKey to verificationMethod correction, minor fixes #58

Closed dbluhm closed 1 year ago

dbluhm commented 1 year ago

This PR introduces a breaking change:

publicKey is no longer accepted as a core attribute as an alias for verificationMethod.

To achieve the same behavior, the document must have the correction created with this commit applied first. This can be done by calling it directly with the dictionary value of the document or by using deserialize_document with the correction method specified in the corrections list. This would look like:

>>> import pydid
>>> doc_raw = {"@context": "http://example.com", "id": "did:example:123"}
>>> doc_raw = pydid.doc.corrections.public_key_is_verification_method(doc_raw)

or:

>>> import pydid
>>> doc_raw = {"@context": "http://example.com", "id": "did:example:123"}
>>> doc = pydid.deserialize_document(
...     doc, corrections=[pydid.doc.corrections.public_key_is_verification_method]
... )

A few other minor issues are also addressed.