TBD54566975 / web5-js

Monorepo for the Web5 JS TypeScript implementation
https://tbd54566975.github.io/web5-js/
Apache License 2.0
129 stars 52 forks source link

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

Closed LiranCohen closed 3 days ago

LiranCohen commented 3 days ago

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:

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.

changeset-bot[bot] commented 3 days ago

🦋 Changeset detected

Latest commit: c06a9293892a67515f9439d169f5a0605aa3c378

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

github-actions[bot] commented 3 days ago

TBDocs Report

🛑 Errors: 0 ⚠️ Warnings: 5

@web5/api

@web5/crypto

📄 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

@web5/dids

@web5/credentials


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

codecov[bot] commented 3 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | Coverage Δ | | |---|---|---| | [agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `87.57% <100.00%> (+0.13%)` | :arrow_up: | | [api](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `99.61% <100.00%> (-0.01%)` | :arrow_down: | | [common](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `98.68% <ø> (ø)` | | | [credentials](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `94.95% <ø> (ø)` | | | [crypto](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `93.79% <ø> (ø)` | | | [dids](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `97.77% <ø> (ø)` | | | [identity-agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `96.42% <ø> (ø)` | | | [crypto-aws-kms](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `100.00% <ø> (ø)` | | | [proxy-agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `96.42% <ø> (ø)` | | | [user-agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/911/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `96.57% <ø> (ø)` | |