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

Agent Refactor #168

Merged
merged 11 commits into from
Aug 21, 2023
Merged

Agent Refactor #168

merged 11 commits into from
Aug 21, 2023

Conversation

frankhinek
Copy link
Contributor

@frankhinek frankhinek commented Aug 16, 2023

Summary of changes:

  • An externally created DID can be used/imported when calling Web5.connect() Allow users to BYODid #74
  • Allows for custom DWN override when calling Web5.connect() allow for custom DWN override in web5 connect.  #162
  • Ability to specify the URL to a dwn-server to use for tests by @finn-tbd from PR test against a local copy of the dwn server #161.
    CLI
    TEST_DWN_URL=http://localhost:3000 npm run test:node
    or GitHub Actions workflow
      - name: Run <>
        run: npm run <>
        env:
          TEST_DWN_URL: http://localhost:3000
  • Migrate DID management functionality from Web5.did to Agent's DidManager.
  • Adds encrypted AppDataVaultto safeguard the locally stored agent private key. Can be optionally disabled for testing.
  • Introduces Web5ManagedAgent with DwnManager, IdentityManager, DidManager, KeyManager, etc. to provide a consistent approach to managing all components of a Web5 Agent.
  • Introduces Local KeyManagement System (KMS) to be used with KeyManager. Multiple KMS instances are supported simultaneously and adapters can be implemented for AWS, GCP, etc. KMS.
  • Generalized DwnRpcClient to RpcClient as a first step towards adding RPC capability for the Web5 API to make DID and VC RPC calls.
  • Implemented stores to back DID, Identity, and Key management with a DWN. Also provided in-memory versions. Can be extended for other storage providers (e.g., SQlite, etc.).
  • Provides a TestManagedAgent implementation to make development and testing with Web5 managed agents easier.
  • Migrate packages to @web5/* on NPM Registry to improve discoverability and address community reported concerns regarding typo attacks (e.g., malicious actor registers @tbd5456975/web5 and publishes modified version that steals private keys.
  • Resolves Error: looks like alg param missing from create did in keyPair? #50
  • Addresses PR export all relevant types #106
  • Addresses PR export and then add profile on connect #127
  • Addresses PR Temporarily expose access to local ProfileManager through web5.techPreview.profileManager #155
  • Bumps dev dependencies, including eslint, typescript, playwright, and chai.
  • Significantly increases test coverage.
  • Stops patching the root package.json with a manual override directive now that c8 and istanbul-lib-report have been updated and no longer depend on a package that contains a security vulnerability. Closes Stop manually patching package-lock.json once c8 is updated #135

@mistermoe
Copy link
Member

@frankhinek i think the dids package cjs build is borked because ion-sdk doesn't ship a cjs distribution anymore. We have two options:

  • @thehenrytsai and i can team up and re-introduce a cjs distribution for ion-sdk
  • we use esbuild instead of tsc to create a cjs bundle for the dids package. we can copy/paste what i did to solve the same problem for ion-tools here

import { Dwn } from '@tbd54566975/dwn-sdk-js';
import { DidIonMethod, DidKeyMethod, DidResolver } from '@web5/dids';
import { KeyValueStore, LevelStore, MemoryStore } from '@web5/common';
import { MessageStoreLevel, DataStoreLevel, EventLogLevel } from '@tbd54566975/dwn-sdk-js/stores';
Copy link
Contributor

Choose a reason for hiding this comment

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

React Native isn't able to import these, as they're named exports. Going to make a PR against the dwn repository to move these exports into the primary dwn-sdk-js package.

Copy link
Contributor

Choose a reason for hiding this comment

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

Reintroduce DidResolverCache
Reintroduce TechPreview hosted DWNs

Signed-off-by: Frank Hinek <[email protected]>
@frankhinek frankhinek linked an issue Aug 18, 2023 that may be closed by this pull request
@frankhinek
Copy link
Contributor Author

@frankhinek i think the dids package cjs build is borked because ion-sdk doesn't ship a cjs distribution anymore. We have two options:

  • @thehenrytsai and i can team up and re-introduce a cjs distribution for ion-sdk
  • we use esbuild instead of tsc to create a cjs bundle for the dids package. we can copy/paste what i did to solve the same problem for ion-tools here

@mistermoe Addressed in b780aa4

…ity to ION DwnConfiguration.

Signed-off-by: Frank Hinek <[email protected]>
@frankhinek frankhinek linked an issue Aug 21, 2023 that may be closed by this pull request
Signed-off-by: Frank Hinek <[email protected]>
@frankhinek frankhinek linked an issue Aug 21, 2023 that may be closed by this pull request
@frankhinek frankhinek linked an issue Aug 21, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants