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

Refactor IdentityApi to be scoped to the agent as a tenant. #911

Merged
merged 11 commits into from
Sep 26, 2024

Conversation

LiranCohen
Copy link
Member

@LiranCohen LiranCohen commented Sep 26, 2024

When thinking about importing/syncing identities across wallets (or agents) there is a lot of extra complexity associated with the different tenants who store the identities.

Within this PR:

  • simplify IdentityApi to be agent-focused and storing both the DID and IdentityMetadata under the agent's tenant.
  • Remove the need for manage in IdentityApi.
  • DIDs that are created/imported are automatically pre-populated in the resolution cache.
  • Update vulnerable packages

The DidApi remains unchanged and a default did.create() will store the DID document as the tenant of the newly created DID.

In a subsequent PRs I would like to take some of the logic from AgentDidResolverCache and move it to the DidStore. That way not only agent DIDs but any DIDs which are imported int the DID store will be respected as long-term DIDs and the DID Store itself will be refreshed with updated DID doc information from resolution. As well as introduce an update method to the DID / Identity APIs.

Copy link

changeset-bot bot commented Sep 26, 2024

🦋 Changeset detected

Latest commit: c06a929

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@web5/api Patch
@web5/identity-agent Minor
@web5/proxy-agent Minor
@web5/user-agent Minor
@web5/agent Minor

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

Copy link
Contributor

github-actions bot commented Sep 26, 2024

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 5

@web5/api

  • Project entry file: packages/api/src/index.ts

@web5/crypto

  • Project entry file: packages/crypto/src/index.ts
📄 File: ./packages/crypto/src/utils.ts
⚠️ extractor:typedoc:missing-docs: CryptoUtils (Variable) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomPin (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomUuid (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomBytes (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.getJoseSignatureAlgorithmFromPublicKey (Property) does not have any documentation.

@web5/crypto-aws-kms

  • Project entry file: packages/crypto-aws-kms/src/index.ts

@web5/dids

  • Project entry file: packages/dids/src/index.ts

@web5/credentials

  • Project entry file: packages/credentials/src/index.ts

TBDocs Report Updated at 2024-09-26T16:17:42Z c06a929

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.49%. Comparing base (e2df13a) to head (e5dd4ec).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #911      +/-   ##
==========================================
+ Coverage   93.44%   93.49%   +0.05%     
==========================================
  Files         117      117              
  Lines       33470    33438      -32     
  Branches     2704     2705       +1     
==========================================
- Hits        31277    31264      -13     
+ Misses       2154     2135      -19     
  Partials       39       39              
Components Coverage Δ
agent 87.57% <100.00%> (+0.13%) ⬆️
api 99.61% <100.00%> (-0.01%) ⬇️
common 98.68% <ø> (ø)
credentials 94.95% <ø> (ø)
crypto 93.79% <ø> (ø)
dids 97.77% <ø> (ø)
identity-agent 96.42% <ø> (ø)
crypto-aws-kms 100.00% <ø> (ø)
proxy-agent 96.42% <ø> (ø)
user-agent 96.57% <ø> (ø)

@LiranCohen LiranCohen marked this pull request as ready for review September 26, 2024 15:31
@LiranCohen LiranCohen changed the title [WIP] Refactor IdentityApi to be scoped to the agent as a tenant. Refactor IdentityApi to be scoped to the agent as a tenant. Sep 26, 2024
@LiranCohen LiranCohen merged commit c92159c into main Sep 26, 2024
13 checks passed
@LiranCohen LiranCohen deleted the lirancohen/did-storage-as-cache branch September 26, 2024 18:06
@github-actions github-actions bot mentioned this pull request Sep 26, 2024
This was referenced Oct 22, 2024
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.

3 participants