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

Prepare DID storage for multiple DIDs per DID Subject #3196

Merged
merged 16 commits into from
Jun 25, 2024

Conversation

woutslakhorst
Copy link
Member

@woutslakhorst woutslakhorst commented Jun 17, 2024

closes #3193

  • removed selfControl & controllers for did:nuts
  • removed tenant option for did:web
  • moved sql storage from did:web to vdr

@woutslakhorst woutslakhorst marked this pull request as ready for review June 18, 2024 13:04
Copy link
Member

@reinkrul reinkrul left a comment

Choose a reason for hiding this comment

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

How are we going to keep services and VMs over multiple DIDs belonging to the same subject in sync?

docs/_static/vdr/v2.yaml Outdated Show resolved Hide resolved
docs/_static/vdr/v2.yaml Show resolved Hide resolved
docs/pages/release_notes.rst Outdated Show resolved Hide resolved
storage/sql_migrations/003_did.sql Outdated Show resolved Hide resolved
vdr/didweb/manager.go Outdated Show resolved Hide resolved
vdr/didweb/manager.go Outdated Show resolved Hide resolved
vdr/didweb/manager.go Outdated Show resolved Hide resolved
Subject: newDID.String(),
}
var doc *sql.DIDDocument
if doc, err = documentStore.CreateOrUpdate(sqlDid, []sql.SqlVerificationMethod{{
Copy link
Member

Choose a reason for hiding this comment

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

You're not really creating a new DID document here? You could have multiple DIDs (even multiple did:web's?) belonging to the same subject, which should then all return the same services and VMs?

Copy link
Member Author

Choose a reason for hiding this comment

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

True, but I wanted this PR to just update the DB model. In a later PR we'll move this logic one level higher (so the web manager will no longer have a create just a read/list/resolve)

vdr/didweb/manager.go Outdated Show resolved Hide resolved
}

// SqlDIDManager is the implementation of the DIDManager interface
type SqlDIDManager struct {
Copy link
Member

Choose a reason for hiding this comment

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

already in sql package, so no need to prepend types with Sql

Copy link
Member Author

Choose a reason for hiding this comment

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

true, but DIDManager is the interface. When declaring vars from other packages you should use the interface. We won't see var a sql.SqlDIDManager anywhere. Also I'm not sure the package will not be renamed after some refactors.

@woutslakhorst
Copy link
Member Author

How are we going to keep services and VMs over multiple DIDs belonging to the same subject in sync?

Use the DB as primary and (for now) the network update as side-effect (maybe within the sql transaction)

woutslakhorst and others added 4 commits June 21, 2024 08:38
Co-authored-by: reinkrul <info@reinkrul.nl>
Co-authored-by: reinkrul <info@reinkrul.nl>
Co-authored-by: reinkrul <info@reinkrul.nl>
@woutslakhorst woutslakhorst requested a review from reinkrul June 21, 2024 06:54
vdr/didweb/manager.go Outdated Show resolved Hide resolved
@woutslakhorst woutslakhorst merged commit 30cf36c into master Jun 25, 2024
8 of 9 checks passed
@woutslakhorst woutslakhorst deleted the feature/3191_did_subject branch June 25, 2024 06:59
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.

Add subject_id to did table. Add findBySubjectId
2 participants