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

feat(did-manager): matching DIDs by alias should not depend on the provider #1218

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

mirceanis
Copy link
Member

What issue is this PR fixing

fixes #1215

What is being changed

  • DIDManager no longer relies on the alias+provider pair when storing or filtering identifiers.
    It is now impossible to use the same alias on 2 identifiers from different providers.
  • Creating or importing an identifier using an alias that is already used will fail, no matter what provider is used.
  • didManagerGetOrCreate still accepts a provider param in case it needs to create a new DID, but if it encounters an identifier with an existing alias but using a different provider it will throw an error.
  • AbstractDIDStore.getDID() no longer uses a provider parameter.
  • DID stores from @veramo/data-store and @veramo/data-store-json packages have been adapted to match the expected behavior of the DID manager

Quality

Check all that apply:

  • I want these changes to be integrated
  • I successfully ran pnpm i, pnpm build, pnpm test, pnpm test:browser locally.
  • I allow my PR to be updated by the reviewers (to speed up the review process).
  • I added unit tests.
  • I added integration tests.

Details

BREAKING CHANGE: The behavior of DIDManager has changed when working with alias. It is mostly ignoring provider unless it is used to create new identifiers. AbstractDIDStore APIs have been adapted and implementations have changed.

Merging this PR into main will trigger a new major release

@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ecdb2a2) 84.85% compared to head (08e4ab0) 84.85%.
Report is 7 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1218   +/-   ##
=======================================
  Coverage   84.85%   84.85%           
=======================================
  Files         167      167           
  Lines       18065    18071    +6     
  Branches     2028     2029    +1     
=======================================
+ Hits        15329    15335    +6     
  Misses       2736     2736           
Files Changed Coverage Δ
...ckages/data-store-json/src/identifier/did-store.ts 92.52% <100.00%> (ø)
packages/data-store/src/identifier/did-store.ts 96.66% <100.00%> (ø)
...kages/did-manager/src/abstract-identifier-store.ts 100.00% <100.00%> (ø)
packages/did-manager/src/id-manager.ts 90.74% <100.00%> (+0.21%) ⬆️
packages/did-manager/src/memory-did-store.ts 91.30% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mirceanis mirceanis force-pushed the 1215-fix-alias-handling branch from 7851375 to c8058af Compare August 4, 2023 20:02
…ovider

fixes #1215

BREAKING CHANGE: The behavior of `DIDManager` has changed when working with `alias`. It is mostly ignoring `provider` unless it is used to create new identifiers. `AbstractDIDStore` APIs have been adapted and implementations have changed.
@mirceanis mirceanis force-pushed the 1215-fix-alias-handling branch from c8058af to 08e4ab0 Compare August 15, 2023 14:15
@mirceanis mirceanis merged commit bfdfc4c into next Oct 5, 2023
@mirceanis mirceanis deleted the 1215-fix-alias-handling branch October 5, 2023 14:57
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.

[proposal] Matching identifiers by alias should not depend on the provider
2 participants