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

[WIP] Initial commit - Webvh #1377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamshale
Copy link
Contributor

@jamshale jamshale commented Jan 9, 2025

WIP - Adds basic did create/update/deactivate support with the didwebvh-server-py project.

Includes endorsement protocol, initial integration testing and some initial unit tests.

Signed-off-by: jamshale <[email protected]>
from .did.manager import DidWebvhManager


class WebvhOptionsSchema(OpenAPISchema):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this request payload following a model we see with other did registration methods or is it specific to webvh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm. This is super basic right now specific to webvh. I was mostly waiting until I knew exactly what options would be available. Currently you just provide the namespace and an optional identifier.

It tries to be the same as what cheqd did with an options and features object, as this had been discussed briefly. It's very much open for changes.

Copy link

@PatStLouis PatStLouis Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok good to know. I would envision having a parameters key in there where the user can set some boolean flags for prerotation and portable as well as the witness information. The options key is fine with me.

We should also discuss how we plan to handle method versions of webvh which may or may not become a nightmare.

if response.status == http.HTTPStatus.BAD_REQUEST:
raise DidCreationError(response_json.get("detail"))

log_entry = response_json.get("logEntry")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change, the posting of the did document will no longer return the log entry. Instead the client must create it itself. However, I will have a helper call available by calling GET http://example.com/my/identifier. If this call is made after a did was registered but the log wasn't initialized, it will return a proposed initial log entry for the client to sign. However, the client should be responsible for creating this initial did log entry based on the parameters it wishes to set.


return resolved_did_doc

async def update(self, options: dict, features: dict):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently not implemented on the didwebvh server. The route exists, but will return a 501

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. The way this was working was by creating the next custom log entry and posting it to the /namespace/identifier endpoint.

Do we need another endpoint for this?

Copy link

@PatStLouis PatStLouis Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updates will be using the PUT method (same endpoint). The reason for this is the rules for the log entry object are different for the initial log entry.

)
).serialize()

async def deactivate(self, options: dict):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently not implemented on the didwebvh server. The route exists, but will return a 501

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