-
Notifications
You must be signed in to change notification settings - Fork 56
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
Protocol definitions for DwnDidStore
, DwnKeyStore
and DwnIdentityStore
#743
Conversation
🦋 Changeset detectedLatest commit: 9ae5984 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
TBDocs Report ✅ No errors or warnings @web5/api
@web5/crypto
@web5/crypto-aws-kms
@web5/dids
@web5/credentials
TBDocs Report Updated at 2024-07-12T23:01:43Z |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #743 +/- ##
==========================================
+ Coverage 90.30% 91.63% +1.33%
==========================================
Files 118 118
Lines 30546 30269 -277
Branches 2292 2306 +14
==========================================
+ Hits 27584 27738 +154
+ Misses 2928 2496 -432
- Partials 34 35 +1
|
cc27497
to
b0140b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the PR description, making my first journey into the Store abstractions less treacherous. Code generally looks good, though can't say I understand everything.
I do find a lot of naming problematic, which is probably the source a lot of confusion. e.g.
DwnDataStore
is a complete reuse of term indwn-sdk-js
but mean different thing.- the term "DID", "identify" and "tenant" all smell very similar, I wish there is one lineer documentation describing the intent/purpose of
DwnDidStore
andDwnIdentityStore
. getDataStoreTenant()
- at a glance seem so odd having to pass tenant to get tenant. LOL.
Co-authored-by: Henry Tsai <henrytsai@outlook.com>
e0b6c29
to
9ae5984
Compare
This PR requires
DwnDataStore
to use aprotocol
for the storage abstraction. The protocol is initialized when any data isset
, the result of the initialization is cached in an in-memory map so that the DWN does not need to query for the installed protocol on each subsequent invocation of set.This is split into two protocols,
identity-store
which is used forDwnIdentityStore
andDwnDidStore
And
jwk-store
which stores theprivateJwk
for a given keyThere can be improvements with these stores such as using tags instead of the cached index and scanning of all records, but that will be done in a separate PR after delegated/permissioned key functionality is complete.