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: persist Linked Verifiable Presentations for did:web #149

Merged
merged 79 commits into from
Dec 5, 2024

Conversation

nanderstabel
Copy link
Collaborator

@nanderstabel nanderstabel commented Dec 2, 2024

Description of change

Issue

Previously, whenever UniCore was restarted, it generated a completely new DID Web Document from scratch. This behavior meant that any previously persisted changes to the document were overwritten, resulting in the loss of LinkedVerifiablePresentation services upon reboot.

Solution

This PR addresses the problem by checking whether a DID Web Document already exists before creating a new one. If an existing document is found, UniCore uses it, ensuring that all previously persisted changes—including LinkedVerifiablePresentation services—are retained across restarts.

Additional Changes

  • Added a presentation_ids field to the Service aggregate. This enhancement makes it easier for implementers to keep track of which presentations are currently being linked.

Links to any relevant issues

n/a

How the change has been tested

  1. Run UniCore in a docker container using the postgres event store type.
  2. In order to set a Linked VP, see the steps in this PR
  3. Check the /.well-known/did.json endpoint to validate that it contains a service of type LinkedVerifiablePresentation
  4. Stop the container: docker compose stop
  5. Restart the container docker compose start
  6. Check the /.well-known/did.json endpoint again to validate that it still contains a service of type LinkedVerifiablePresentation

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have successfully tested this change in a docker environment

@nanderstabel nanderstabel self-assigned this Dec 2, 2024
@nanderstabel nanderstabel force-pushed the fix/persist-linked-vps branch from 20b85e3 to 77305a2 Compare December 2, 2024 15:37
@nanderstabel nanderstabel added the Bug Something isn't working label Dec 2, 2024
@nanderstabel nanderstabel marked this pull request as ready for review December 2, 2024 15:55
Base automatically changed from nanderstabel/issue124 to beta December 3, 2024 13:21
agent_identity/src/state.rs Outdated Show resolved Hide resolved
agent_identity/src/state.rs Outdated Show resolved Hide resolved
agent_identity/src/state.rs Outdated Show resolved Hide resolved
@nanderstabel nanderstabel changed the title fix: persist Linked Verifiable Presentations fix: persist Linked Verifiable Presentations for did:web Dec 5, 2024
@nanderstabel nanderstabel merged commit 97b00ca into beta Dec 5, 2024
2 checks passed
@nanderstabel nanderstabel deleted the fix/persist-linked-vps branch December 5, 2024 20:01
Copy link

🎉 This PR is included in version 1.0.0-beta.7 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working released on @beta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants