Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Aug 24, 2023

Conversation

dbluhm
Copy link
Member

@dbluhm dbluhm commented Jan 6, 2023

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.

@dbluhm dbluhm changed the title publicKey to verificationMethod correction, minor fixes fix!: publicKey to verificationMethod correction, minor fixes Jun 1, 2023
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
BREAKING CHANGE: publicKey is no longer accepted by default. 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. See docs
on pydid.doc.corrections.public_key_is_verification_method for examples.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm dbluhm merged commit 30b9ec3 into main Aug 24, 2023
4 checks passed
@dbluhm dbluhm deleted the fix/types-and-corrections branch October 20, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants