├── packages
├── cli
│ ├── src
│ │ ├── imported-types
│ │ │ └── imported-modules.d.ts
│ │ ├── cli.ts
│ │ ├── explore
│ │ │ ├── index.ts
│ │ │ ├── styles.ts
│ │ │ └── utils.ts
│ │ ├── util.ts
│ │ ├── lib
│ │ │ └── agentCreator.ts
│ │ ├── discover.ts
│ │ ├── server.ts
│ │ ├── createCommand.ts
│ │ └── message.ts
│ ├── views
│ │ └── home.html
│ ├── bin
│ │ └── veramo.js
│ ├── tsconfig.json
│ └── README.md
├── utils
│ ├── README.md
│ ├── tsconfig.json
│ ├── src
│ │ ├── index.ts
│ │ └── type-utils.ts
│ ├── api-extractor.json
│ └── package.json
├── did-provider-ion
│ ├── src
│ │ ├── types
│ │ │ └── @trust
│ │ │ │ └── keyto
│ │ │ │ └── index.d.ts
│ │ ├── index.ts
│ │ ├── ion-did-resolver.ts
│ │ └── json-canonicalizer.ts
│ ├── api-extractor.json
│ └── tsconfig.json
├── test-react-app
│ ├── src
│ │ ├── react-app-env.d.ts
│ │ ├── global.ts
│ │ ├── setupTests.ts
│ │ ├── index.css
│ │ ├── reportWebVitals.ts
│ │ ├── index.tsx
│ │ ├── App.css
│ │ └── test-utils
│ │ │ └── ethers-provider.ts
│ ├── public
│ │ ├── robots.txt
│ │ ├── favicon.ico
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ └── manifest.json
│ ├── Readme.md
│ ├── jest-preset-puppeteer-esm
│ │ └── jest-preset.cjs
│ ├── jest-puppeteer.config.cjs
│ ├── craco.config.cjs
│ ├── config
│ │ └── jest
│ │ │ └── babelTransform.cjs
│ ├── .eslintrc.json
│ ├── jest-integration.config.cjs
│ └── tsconfig.json
├── core-types
│ ├── README.md
│ ├── tsconfig.json
│ ├── src
│ │ ├── types
│ │ │ ├── IError.ts
│ │ │ ├── ICredentialPlugin.ts
│ │ │ ├── ICredentialStatus.ts
│ │ │ ├── IVerifyResult.ts
│ │ │ └── IMessageHandler.ts
│ │ ├── coreEvents.ts
│ │ ├── index.ts
│ │ └── agent.ts
│ └── api-extractor.json
├── credential-jwt
│ ├── src
│ │ └── index.ts
│ ├── CHANGELOG.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── credential-eip712
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── credential-status
│ ├── src
│ │ └── index.ts
│ ├── README.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── did-discovery
│ ├── README.md
│ ├── tsconfig.json
│ ├── src
│ │ ├── index.ts
│ │ └── abstract-did-discovery-provider.ts
│ ├── api-extractor.json
│ └── package.json
├── did-jwt
│ ├── README.md
│ ├── src
│ │ ├── index.ts
│ │ └── message-handler.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── remote-client
│ ├── README.md
│ ├── src
│ │ ├── index.ts
│ │ └── client.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── test-utils
│ ├── README.md
│ ├── src
│ │ ├── index.ts
│ │ └── broken-did-discovery.ts
│ ├── tsconfig.json
│ └── package.json
├── kv-store
│ ├── src
│ │ ├── store-adapters
│ │ │ ├── index.ts
│ │ │ ├── typeorm
│ │ │ │ ├── migrations
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── 1.createKVDatabase.ts
│ │ │ │ ├── entities
│ │ │ │ │ └── keyValueStoreEntity.ts
│ │ │ │ └── types.ts
│ │ │ └── tiered
│ │ │ │ └── types.ts
│ │ └── index.ts
│ ├── tsconfig.json
│ └── api-extractor.json
├── core
│ ├── README.md
│ ├── tsconfig.json
│ ├── src
│ │ ├── index.ts
│ │ └── schemas
│ │ │ └── ValidationError.ts
│ ├── api-extractor.json
│ └── package.json
├── selective-disclosure
│ ├── README.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ ├── src
│ │ └── index.ts
│ └── package.json
├── did-manager
│ ├── src
│ │ ├── __tests__
│ │ │ └── default.test.ts
│ │ ├── index.ts
│ │ ├── abstract-identifier-store.ts
│ │ └── did-discovery-provider.ts
│ ├── README.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── key-manager
│ ├── src
│ │ ├── __tests__
│ │ │ ├── default.test.ts
│ │ │ └── abstract-key-store.test.ts
│ │ ├── types.ts
│ │ ├── abstract-secret-box.ts
│ │ ├── index.ts
│ │ ├── abstract-key-store.ts
│ │ └── abstract-private-key-store.ts
│ ├── README.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── message-handler
│ ├── README.md
│ ├── tsconfig.json
│ ├── src
│ │ ├── index.ts
│ │ ├── abstract-message-handler.ts
│ │ └── __tests__
│ │ │ └── default.test.ts
│ ├── api-extractor.json
│ └── package.json
├── did-provider-key
│ ├── README.md
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── did-provider-pkh
│ ├── README.md
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── did-provider-web
│ ├── README.md
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── did-provider-ethr
│ ├── README.md
│ ├── src
│ │ ├── index.ts
│ │ └── __tests__
│ │ │ └── identity-provider.test.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── did-provider-peer
│ ├── README.md
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── api-extractor.json
├── did-resolver
│ ├── README.md
│ ├── tsconfig.json
│ ├── src
│ │ └── index.ts
│ ├── api-extractor.json
│ └── package.json
├── credential-ld
│ ├── src
│ │ ├── types.ts
│ │ ├── contexts
│ │ │ ├── veramo.io_contexts_profile_v1.json
│ │ │ ├── lds-ecdsa-secp256k1-recovery2020-0.0.json
│ │ │ ├── w3id.org_security_suites_x25519-2019_v1.json
│ │ │ ├── w3id.org_security_suites_x25519-2020_v1.json
│ │ │ └── www.w3.org_ns_did_v1.json
│ │ ├── module-types
│ │ │ └── jsonld
│ │ │ │ └── index.d.ts
│ │ ├── index.ts
│ │ ├── ld-context-loader.ts
│ │ ├── __tests__
│ │ │ └── context.loader.test.ts
│ │ └── ld-suite-loader.ts
│ ├── README.md
│ ├── api-extractor.json
│ └── tsconfig.json
├── remote-server
│ ├── README.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── src
│ │ ├── api-key-auth.ts
│ │ ├── request-agent-router.ts
│ │ └── index.ts
├── kms-web3
│ ├── tsconfig.json
│ ├── src
│ │ └── index.ts
│ ├── README.md
│ ├── api-extractor.json
│ └── package.json
├── credential-w3c
│ ├── README.md
│ ├── api-extractor.json
│ ├── tsconfig.json
│ ├── src
│ │ └── index.ts
│ └── package.json
├── did-provider-jwk
│ ├── README.md
│ ├── src
│ │ ├── index.ts
│ │ └── types
│ │ │ └── jwk-provider-types.ts
│ ├── api-extractor.json
│ ├── tsconfig.json
│ └── package.json
├── url-handler
│ ├── src
│ │ └── index.ts
│ ├── README.md
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── package.json
├── data-store-json
│ ├── tsconfig.json
│ ├── api-extractor.json
│ ├── README.md
│ └── src
│ │ └── index.ts
├── mediation-manager
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ ├── CHANGELOG.md
│ └── package.json
├── data-store
│ ├── tsconfig.json
│ ├── README.md
│ ├── api-extractor.json
│ ├── src
│ │ ├── utils.ts
│ │ ├── entities
│ │ │ ├── PreMigrationEntities.ts
│ │ │ ├── private-key.ts
│ │ │ ├── service.ts
│ │ │ └── key.ts
│ │ └── migrations
│ │ │ ├── 2.simplifyRelations.ts
│ │ │ └── index.ts
│ └── package.json
├── kms-local
│ ├── tsconfig.json
│ ├── src
│ │ └── index.ts
│ ├── api-extractor.json
│ └── README.md
├── did-comm
│ ├── src
│ │ ├── protocols
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── encryption
│ │ │ ├── a256kw.ts
│ │ │ └── xc20pkw.ts
│ │ └── types
│ │ │ └── utility-types.ts
│ ├── tsconfig.json
│ ├── api-extractor.json
│ └── README.md
└── tsconfig.settings.json
├── .dockerignore
├── .prettierignore
├── __tests__
├── utils
│ └── third.party.types.d.ts
├── fixtures
│ ├── local-database-before-migration.sqlite
│ ├── local-database-before-p256key-migration.sqlite
│ ├── local-database-before-migration-with-prefix.sqlite
│ └── cred1.json
└── shared
│ └── credentialInterop.ts
├── .prettierrc
├── commitlint.config.js
├── .vscode
└── settings.json
├── pnpm-workspace.yaml
├── lerna.json
├── .github
├── workflows
│ ├── sync-next-with-latest.yml
│ └── veramo-website.yml
├── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── stale.yml
└── pull_request_template.md
├── tsconfig.scripts.json
├── .gitignore
├── docsconfig.json
├── scripts
└── docs-copy.ts
├── jest.config.mjs
├── AWESOME.md
├── renovate.json
└── authors.md
/packages/cli/src/imported-types/imported-modules.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'cors'
2 |
--------------------------------------------------------------------------------
/packages/utils/README.md:
--------------------------------------------------------------------------------
1 | # Veramo utils
2 |
3 | A package with helper methods.
4 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | npm-debug.log
3 | examples
4 | database.sqlite
5 | agent.yml
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | coverage
2 | examples
3 | **/build
4 | docs
5 | report
6 | *.json
7 | *.md
--------------------------------------------------------------------------------
/packages/did-provider-ion/src/types/@trust/keyto/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module '@trust/keyto'
2 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/cli/views/home.html:
--------------------------------------------------------------------------------
1 | {{#each links}} {{label}}
2 | {{/each}}
3 |
--------------------------------------------------------------------------------
/packages/core-types/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Core-types
2 |
3 | Definitions for Veramo common data types
4 |
--------------------------------------------------------------------------------
/__tests__/utils/third.party.types.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'ganache-cli'
2 | declare module 'ethr-did-registry'
3 |
--------------------------------------------------------------------------------
/packages/credential-jwt/src/index.ts:
--------------------------------------------------------------------------------
1 | export { CredentialProviderJWT } from './agent/CredentialProviderJWT.js'
2 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/global.ts:
--------------------------------------------------------------------------------
1 | import { Buffer } from "buffer";
2 | window.Buffer = window.Buffer || Buffer;
--------------------------------------------------------------------------------
/packages/credential-eip712/src/index.ts:
--------------------------------------------------------------------------------
1 | export { CredentialProviderEIP712 } from './agent/CredentialProviderEIP712.js'
2 |
--------------------------------------------------------------------------------
/packages/test-react-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/packages/credential-status/src/index.ts:
--------------------------------------------------------------------------------
1 | /* istanbul ignore file */
2 | export { CredentialStatusPlugin } from './credential-status.js'
3 |
--------------------------------------------------------------------------------
/packages/did-discovery/README.md:
--------------------------------------------------------------------------------
1 | # Veramo DID discovery plugin
2 |
3 | This package provides a Veramo plugin for discovering DIDs
4 |
--------------------------------------------------------------------------------
/packages/did-jwt/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did-jwt message validator
2 |
3 | Veramo message validator plugin for decoding and verifying JWT payloads.
--------------------------------------------------------------------------------
/packages/remote-client/README.md:
--------------------------------------------------------------------------------
1 | # Veramo remote client
2 |
3 | A Veramo agent plugin that can expose methods from a remote agent locally.
4 |
--------------------------------------------------------------------------------
/packages/test-react-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/decentralized-identity/veramo/HEAD/packages/test-react-app/public/favicon.ico
--------------------------------------------------------------------------------
/packages/test-react-app/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/decentralized-identity/veramo/HEAD/packages/test-react-app/public/logo192.png
--------------------------------------------------------------------------------
/packages/test-react-app/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/decentralized-identity/veramo/HEAD/packages/test-react-app/public/logo512.png
--------------------------------------------------------------------------------
/packages/test-utils/README.md:
--------------------------------------------------------------------------------
1 | # Veramo test-utils
2 |
3 | Helper methods for Veramo integration tests. This package is NOT meant to be used in production.
4 |
--------------------------------------------------------------------------------
/packages/kv-store/src/store-adapters/index.ts:
--------------------------------------------------------------------------------
1 | export * from './tiered/index.js'
2 | export * from './typeorm/index.js'
3 | export * from './typeorm/migrations/index.js'
4 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "jsxBracketSameLine": false,
3 | "trailingComma": "all",
4 | "tabWidth": 2,
5 | "printWidth": 110,
6 | "singleQuote": true,
7 | "semi": false
8 | }
9 |
--------------------------------------------------------------------------------
/__tests__/fixtures/local-database-before-migration.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/decentralized-identity/veramo/HEAD/__tests__/fixtures/local-database-before-migration.sqlite
--------------------------------------------------------------------------------
/packages/core/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Core
2 |
3 | ### Core functions
4 |
5 | - instantiate and orchestrate plugins
6 | - coordinate events
7 | - validate schemas
8 | - define core types
9 |
--------------------------------------------------------------------------------
/packages/selective-disclosure/README.md:
--------------------------------------------------------------------------------
1 | # Veramo selective disclosure plugin
2 |
3 | This package provides a Veramo plugin that can create and receive selective disclosure requests.
4 |
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['@commitlint/config-conventional'],
3 | rules: {
4 | // 'subject-case': [2, 'always', ['sentence-case']],
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/__tests__/fixtures/local-database-before-p256key-migration.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/decentralized-identity/veramo/HEAD/__tests__/fixtures/local-database-before-p256key-migration.sqlite
--------------------------------------------------------------------------------
/packages/did-manager/src/__tests__/default.test.ts:
--------------------------------------------------------------------------------
1 | describe('did-manager', () => {
2 | const a = 100
3 | it('should run a dummy test', () => {
4 | expect(a).toEqual(100)
5 | })
6 | })
7 |
--------------------------------------------------------------------------------
/packages/key-manager/src/__tests__/default.test.ts:
--------------------------------------------------------------------------------
1 | describe('key-manager', () => {
2 | const a = 100
3 | it('should run a dummy test', () => {
4 | expect(a).toEqual(100)
5 | })
6 | })
7 |
--------------------------------------------------------------------------------
/__tests__/fixtures/local-database-before-migration-with-prefix.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/decentralized-identity/veramo/HEAD/__tests__/fixtures/local-database-before-migration-with-prefix.sqlite
--------------------------------------------------------------------------------
/packages/core-types/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build"
6 | },
7 | "include": ["./**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/credential-jwt/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
--------------------------------------------------------------------------------
/packages/credential-status/README.md:
--------------------------------------------------------------------------------
1 | # Credential Revocation Status plugin for Veramo
2 |
3 | Veramo package which enables support for [status of W3C Verifiable Credentials](https://www.w3.org/TR/vc-data-model/#status).
--------------------------------------------------------------------------------
/packages/message-handler/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Message Handler
2 |
3 | This is a Veramo plugin that coordinates several `AbstractMessageHandler` implementations
4 | to provide a `handleMessage` method to a Veramo agent.
5 |
--------------------------------------------------------------------------------
/packages/did-provider-key/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did:key provider
2 |
3 | This package contains an implementation of `AbstractIdentifierProvider` for the `did:key` method.
4 | This enables creation and control of `did:key` entities.
5 |
--------------------------------------------------------------------------------
/packages/did-provider-pkh/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did:pkh provider
2 |
3 | This package contains an implementation of `AbstractIdentifierProvider` for the `did:pkh` method.
4 | This enables creation and control of `did:pkh` entities.
5 |
--------------------------------------------------------------------------------
/packages/did-provider-web/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did:web provider
2 |
3 | This package contains an implementation of `AbstractIdentifierProvider` for the `did:web` method.
4 | This enables creation and control of `did:web` entities.
5 |
--------------------------------------------------------------------------------
/packages/key-manager/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Key Manager plugin
2 |
3 | This plugin combines multiple Key management systems and exposes a unified API to the DID manager
4 | and other plugins that require crypto functionality.
5 |
6 |
--------------------------------------------------------------------------------
/packages/did-manager/README.md:
--------------------------------------------------------------------------------
1 | # Veramo DID Manager
2 |
3 | The DID controller abstraction plugin for Veramo.
4 |
5 | This plugin combines multiple DID method controllers and provides the abstracted functionality to other plugins.
6 |
--------------------------------------------------------------------------------
/packages/did-provider-ethr/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did:ethr provider
2 |
3 | This package contains an implementation of `AbstractIdentifierProvider` for the `did:ethr` method.
4 | This enables creation and control of `did:ethr` entities.
5 |
--------------------------------------------------------------------------------
/packages/did-provider-peer/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did:peer provider
2 |
3 | This package contains an implementation of `AbstractIdentifierProvider` for the `did:peer` method.
4 | This enables creation and control of `did:peer` entities.
5 |
--------------------------------------------------------------------------------
/packages/did-resolver/README.md:
--------------------------------------------------------------------------------
1 | # Veramo DID Document resolver plugin
2 |
3 | This plugin exposes a DID resolver API to the rest of the agent.
4 | This is used to obtain DID documents that are used for verification and communication.
5 |
--------------------------------------------------------------------------------
/packages/test-react-app/Readme.md:
--------------------------------------------------------------------------------
1 | # test-react-app
2 |
3 | This package is only meant to be used as a testing ground to check compatibility of Veramo core dependencies with a
4 | browser environment. This is not really meant sample code.
--------------------------------------------------------------------------------
/packages/credential-ld/src/types.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Describes a document with a `@context` property.
3 | *
4 | * @beta This API may change without a BREAKING CHANGE notice.
5 | */
6 | export type ContextDoc = {
7 | '@context': Record
8 | }
9 |
--------------------------------------------------------------------------------
/packages/remote-server/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Express
2 |
3 | A utility module that contains express.js routers to:
4 |
5 | * expose some agent methods to other agents or APIs
6 | * serve open API schema for these methods
7 | * serve did:web did documents
8 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "node_modules/typescript/lib",
3 | "cSpell.words": [
4 | "Decrypter",
5 | "Encrypter",
6 | "Keypair",
7 | "arrayify",
8 | "ethersproject"
9 | ],
10 | "jest.autoRun": "off"
11 | }
--------------------------------------------------------------------------------
/packages/credential-ld/src/contexts/veramo.io_contexts_profile_v1.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@version": 1.1,
4 | "@protected": true,
5 | "Profile": "https://veramo.io/contexts/profile#Profile",
6 | "name": "https://schema.org/name"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build"
6 | },
7 | "include": ["./**/*.ts"],
8 | "references": [
9 | {
10 | "path": "../core-types"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/did-provider-web/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:web` {@link @veramo/did-provider-web#WebDIDProvider | identifier provider } for the
3 | * {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { WebDIDProvider } from './web-did-provider.js'
8 |
--------------------------------------------------------------------------------
/packages/kms-web3/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [{ "path": "../core-types" }, { "path": "../key-manager" }]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/message-handler/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [{ "path": "../core-types" }, { "path": "../core"}]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/test-react-app/jest-preset-puppeteer-esm/jest-preset.cjs:
--------------------------------------------------------------------------------
1 | const { defaultsESM: tsJestPresetDefaultEsm } = require('ts-jest/presets')
2 | const jestPuppeteerPreset = require('jest-puppeteer/jest-preset')
3 |
4 | module.exports = Object.assign(jestPuppeteerPreset, tsJestPresetDefaultEsm)
5 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/packages/utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [{ "path": "../core-types" }]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/credential-w3c/README.md:
--------------------------------------------------------------------------------
1 | # Veramo W3C credentials plugin
2 |
3 | Veramo package for working with W3C Verifiable Credentials & Presentations.
4 |
5 | This package contains a plugin and a message handler for issuing and verifying Credentials
6 | and Presentations that adhere to W3C standards.
7 |
--------------------------------------------------------------------------------
/packages/did-discovery/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [{ "path": "../core-types" }],
9 | "include": ["./**/*.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/credential-ld/README.md:
--------------------------------------------------------------------------------
1 | # Veramo JSON-LD credentials plugin
2 |
3 | Veramo package for working with W3C JSON-LD Verifiable Credentials & Presentations.
4 |
5 | This package contains a plugin and a message handler for issuing and verifying Credentials
6 | and Presentations that adhere to W3C standards.
7 |
--------------------------------------------------------------------------------
/packages/did-jwt/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/did-jwt#JwtMessageHandler | plugin } for the
3 | * {@link @veramo/message-handler#MessageHandler} that finds and verifies a JWT in a message.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { JwtMessageHandler } from './message-handler.js'
8 |
--------------------------------------------------------------------------------
/packages/did-provider-jwk/README.md:
--------------------------------------------------------------------------------
1 | # Veramo did:jwk provider
2 |
3 | This package contains an implementation of `AbstractIdentifierProvider` for the `did:jwk` method, according to the [specification](https://github.com/quartzjer/did-jwk/blob/main/spec.md).
4 | This enables creation and control of `did:jwk` entities.
5 |
--------------------------------------------------------------------------------
/packages/test-utils/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains helper methods for Veramo integration tests.
3 | *
4 | * NOT to be used in production.
5 | *
6 | * @packageDocumentation
7 | */
8 |
9 | export * from './fake-did.js'
10 | export * from './example-did.js'
11 | export * from './broken-did-discovery.js'
12 |
--------------------------------------------------------------------------------
/packages/core/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides {@link @veramo/core#Agent} implementation
3 | *
4 | * @packageDocumentation
5 | */
6 | export { Agent, createAgent } from './agent.js'
7 | export { ValidationError } from './validator.js'
8 |
9 | // re-export types for convenience
10 | export * from '@veramo/core-types'
11 |
--------------------------------------------------------------------------------
/packages/did-jwt/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [{ "path": "../core-types" }, { "path": "../message-handler" }]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/did-manager/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [
9 | { "path": "../core-types" },
10 | { "path": "../did-discovery" }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - packages/*
3 |
4 | ignoredBuiltDependencies:
5 | - '@scarf/scarf'
6 | - bufferutil
7 | - core-js
8 | - core-js-pure
9 | - nx
10 | - secp256k1
11 | - utf-8-validate
12 |
13 | onlyBuiltDependencies:
14 | - puppeteer
15 | - sqlite3
16 |
17 | prefer-workspace-packages: true
18 |
--------------------------------------------------------------------------------
/packages/kms-web3/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a web3 wallet backed
3 | * {@link @veramo/kms-web3#Web3KeyManagementSystem | key management system }
4 | * for the {@link @veramo/key-manager#KeyManager}
5 | *
6 | * @packageDocumentation
7 | */
8 | export { Web3KeyManagementSystem } from './web3-key-management-system.js'
9 |
10 |
--------------------------------------------------------------------------------
/packages/remote-client/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/remote-client#AgentRestClient | plugin} for the {@link @veramo/core#Agent} that
3 | * can proxy method execution over HTTPS
4 | *
5 | * @packageDocumentation
6 | */
7 | export { AgentRestClient } from './client.js'
8 | export { getOpenApiSchema } from './openApi.js'
9 |
--------------------------------------------------------------------------------
/packages/remote-client/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "lib": [
8 | "dom",
9 | "esnext"
10 | ]
11 | },
12 | "references": [{ "path": "../core-types" }]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/did-provider-peer/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:key` {@link @veramo/did-provider-peer#PeerDIDProvider | identifier provider } for the
3 | * {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { PeerDIDProvider } from './peer-did-provider.js'
8 | export { getResolver } from './resolver.js'
9 |
--------------------------------------------------------------------------------
/packages/url-handler/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/url-handler#UrlMessageHandler | plugin } for the
3 | * {@link @veramo/message-handler#MessageHandler} that can extract a raw message from a URL query string or by fetching.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { UrlMessageHandler } from './message-handler.js'
8 |
--------------------------------------------------------------------------------
/packages/did-provider-key/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:key` {@link @veramo/did-provider-key#KeyDIDProvider | identifier provider } for the
3 | * {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { KeyDIDProvider } from './key-did-provider.js'
8 | export { getDidKeyResolver } from './resolver.js'
9 |
--------------------------------------------------------------------------------
/packages/credential-status/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | { "path": "../core-types" },
11 | { "path": "../utils" }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/did-provider-ion/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:ion` {@link @veramo/did-provider-ion#IonDIDProvider | identifier provider }
3 | * for the {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { IonDIDProvider } from './ion-did-provider.js'
8 | export { getDidIonResolver } from './ion-did-resolver.js'
9 |
--------------------------------------------------------------------------------
/packages/core-types/src/types/IError.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * An error object, which can contain a code.
3 | * @beta
4 | */
5 | export interface IError {
6 |
7 | /**
8 | * The details of the error being throw or forwarded
9 | */
10 | message?: string
11 |
12 | /**
13 | * The code for the error being throw
14 | */
15 | errorCode?: string
16 | }
--------------------------------------------------------------------------------
/packages/did-provider-ethr/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:ethr` {@link @veramo/did-provider-ethr#EthrDIDProvider | identifier provider }
3 | * for the {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { EthrDIDProvider } from './ethr-did-provider.js'
8 | export { KmsEthereumSigner } from './kms-eth-signer.js'
9 |
--------------------------------------------------------------------------------
/packages/did-resolver/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [
9 | {
10 | "path": "../core-types"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/key-manager/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [
9 | {
10 | "path": "../core-types"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/did-provider-pkh/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:pkh` {@link @veramo/did-provider-pkh#PkhDIDProvider | identifier provider } for the
3 | * {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { PkhDIDProvider } from './pkh-did-provider.js'
8 | export { getResolver as getDidPkhResolver } from './resolver.js'
9 |
--------------------------------------------------------------------------------
/packages/did-provider-web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [
9 | { "path": "../core-types" },
10 | { "path": "../did-manager" },
11 | { "path": "../utils" }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/src/cli.ts:
--------------------------------------------------------------------------------
1 | import inquirer from 'inquirer'
2 | import inquirerAutoPrompt from 'inquirer-autocomplete-prompt'
3 |
4 | inquirer.registerPrompt('autocomplete', inquirerAutoPrompt)
5 | import { veramo } from './createCommand.js'
6 |
7 | if (!process.argv.slice(2).length) {
8 | veramo.outputHelp()
9 | } else {
10 | veramo.parse(process.argv)
11 | }
12 |
--------------------------------------------------------------------------------
/packages/utils/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains helper methods for Veramo plugins.
3 | *
4 | * @packageDocumentation
5 | */
6 |
7 | export * from './types/utility-types.js'
8 | export * from './credential-utils.js'
9 | export * from './did-utils.js'
10 | export * from './encodings.js'
11 | export * from './type-utils.js'
12 | export * from './jwk-did-utils.js'
13 |
--------------------------------------------------------------------------------
/packages/url-handler/README.md:
--------------------------------------------------------------------------------
1 | # Veramo URL handler
2 |
3 | This is an implementation of `AbstractMessageHandler` that can interpret messages presented as a URL.
4 |
5 | This is done either by attempting to extract a `c_i` param from the URL query string or by fetching the given URL. This also looks for a URL redirect and attempts to extract the parameter from the redirected URL.
6 |
--------------------------------------------------------------------------------
/packages/did-provider-key/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {"path": "../core-types"},
11 | {"path": "../did-manager"},
12 | {"path": "../utils"}
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/did-provider-peer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {"path": "../core-types"},
11 | {"path": "../did-manager"},
12 | {"path": "../utils"}
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/did-provider-pkh/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | { "path": "../core-types" },
11 | { "path": "../did-manager" },
12 | { "path": "../utils" }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/url-handler/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "lib": [
8 | "dom",
9 | "esnext"
10 | ]
11 | },
12 | "references": [
13 | {"path": "../core-types"},
14 | {"path": "../message-handler"}
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/data-store-json/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "lib": ["dom", "esnext"]
7 | },
8 | "references": [
9 | { "path": "../core-types" },
10 | { "path": "../did-manager" },
11 | { "path": "../key-manager" },
12 | { "path": "../utils" }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/test-utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [
9 | { "path": "../core-types" },
10 | { "path": "../did-discovery" },
11 | { "path": "../did-manager" },
12 | { "path": "../utils" }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/mediation-manager/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/mediation-manager#MediationManager | plugin} for the
3 | * {@link @veramo/core#Agent} that implements the {@link @veramo/mediation-manager#IMediationManager} interface.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { MediationManagerPlugin } from './mediation-manager.js'
8 | export * from './types/IMediationManager.js'
9 |
--------------------------------------------------------------------------------
/packages/test-react-app/jest-puppeteer.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | launch: {
3 | dumpio: true,
4 | headless: true,
5 | product: 'chrome',
6 | args: ['--no-sandbox', '--disable-setuid-sandbox'],
7 | },
8 | browserContext: 'default',
9 | server: {
10 | command: 'pnpm start',
11 | port: 3000,
12 | launchTimeout: 30000,
13 | debug: true,
14 | },
15 | }
16 |
--------------------------------------------------------------------------------
/packages/did-provider-jwk/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides `did:jwk` {@link @veramo/did-provider-jwk#JwkDIDProvider | identifier provider } for the
3 | * {@link @veramo/did-manager#DIDManager}
4 | *
5 | * @packageDocumentation
6 | */
7 | export { JwkDIDProvider } from './jwk-did-provider.js'
8 | export { getDidJwkResolver } from './resolver.js'
9 | export * from './types/jwk-provider-types.js'
10 |
--------------------------------------------------------------------------------
/packages/did-discovery/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/did-discovery#IDIDDiscovery | plugin} for the {@link @veramo/core#Agent}
3 | *
4 | * @packageDocumentation
5 | */
6 | export { DIDDiscovery } from './action-handler.js'
7 | export { AbstractDidDiscoveryProvider } from './abstract-did-discovery-provider.js'
8 | export * from './types.js'
9 | export { schema } from './plugin.schema.js'
10 |
--------------------------------------------------------------------------------
/packages/kms-web3/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Web3 KMS
2 |
3 | A Veramo KMS implementation that provides secp256k1 crypto backed by web3 wallets.
4 |
5 | This module provides an implementation
6 | of [`AbstractKeyManagementSystem`](../key-manager/src/abstract-key-management-system.ts#L6) that can be used by the
7 | [`@veramo/key-manager`](../key-manager) plugin to provide Secp256k1 crypto functionality to a
8 | Veramo agent.
9 |
--------------------------------------------------------------------------------
/packages/did-resolver/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/did-resolver#DIDResolverPlugin | plugin} for the {@link @veramo/core#Agent}
3 | * that implements {@link @veramo/core-types#IResolver } interface.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { DIDResolverPlugin } from './resolver.js'
8 | export { UniversalResolver, getUniversalResolver, getUniversalResolverFor } from './universal-resolver.js'
9 |
--------------------------------------------------------------------------------
/packages/remote-server/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build"
7 | },
8 | "references": [
9 | {
10 | "path": "../core-types"
11 | },
12 | {
13 | "path": "../remote-client"
14 | },
15 | {
16 | "path": "../utils"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/data-store/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "skipLibCheck": true
7 | },
8 | "references": [
9 | { "path": "../core-types" },
10 | { "path": "../did-discovery" },
11 | { "path": "../did-manager" },
12 | { "path": "../key-manager" },
13 | { "path": "../utils" }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/key-manager/src/types.ts:
--------------------------------------------------------------------------------
1 | import { TypedDataDomain, TypedDataField } from 'ethers'
2 |
3 | /**
4 | * The payload that is sent to be signed according to EIP712
5 | * @see {@link https://eips.ethereum.org/EIPS/eip-712}
6 | * @beta
7 | */
8 | export type Eip712Payload = {
9 | domain: TypedDataDomain
10 | types: Record
11 | primaryType: string
12 | message: Record
13 | }
14 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/module-types/jsonld/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module '@digitalcredentials/jsonld'
2 | declare module '@digitalcredentials/jsonld-signatures'
3 | declare module '@digitalcredentials/vc'
4 | declare module '@digitalcredentials/ed25519-signature-2020'
5 | declare module '@veramo-community/lds-ecdsa-secp256k1-recovery2020'
6 |
7 | declare module "*.json" {
8 | const content: any;
9 | export default content;
10 | }
11 |
--------------------------------------------------------------------------------
/packages/kms-local/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core-types"
12 | },
13 | {
14 | "path": "../key-manager"
15 | },
16 | {
17 | "path": "../utils"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/did-provider-ethr/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core-types"
12 | },
13 | {
14 | "path": "../did-manager"
15 | },
16 | {
17 | "path": "../utils"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/message-handler/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/message-handler#MessageHandler | plugin} for the
3 | * {@link @veramo/core#Agent} that implements {@link @veramo/core-types#IMessageHandler} interface.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { MessageHandler } from './message-handler.js'
8 | export { AbstractMessageHandler } from './abstract-message-handler.js'
9 | export { Message } from './message.js'
10 |
--------------------------------------------------------------------------------
/packages/did-comm/src/protocols/index.ts:
--------------------------------------------------------------------------------
1 | export { TrustPingMessageHandler } from './trust-ping-message-handler.js'
2 | export * from './coordinate-mediation-message-handler.js'
3 | export * from './coordinate-mediation-v3-message-handler.js'
4 | export { RoutingMessageHandler } from './routing-message-handler.js'
5 | export {
6 | PickupMediatorMessageHandler,
7 | PickupRecipientMessageHandler,
8 | } from './messagepickup-message-handler.js'
9 |
10 |
--------------------------------------------------------------------------------
/packages/cli/src/explore/index.ts:
--------------------------------------------------------------------------------
1 | import { getAgent } from '../setup.js'
2 | import { Command } from 'commander'
3 | import { renderMainScreen } from './main.js'
4 |
5 | const explore = new Command('explore')
6 | .description('launch Verifiable Data explorer')
7 | .action(async (opts: {}, cmd: Command) => {
8 | const agent = await getAgent(cmd.optsWithGlobals().config)
9 | await renderMainScreen(agent)
10 | })
11 |
12 | export { explore }
13 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/core-types/src/coreEvents.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This collection defines the core event types.
3 | *
4 | * @public
5 | */
6 | export const CoreEvents = {
7 | /**
8 | * This event type is used to signal an error to event listeners.
9 | *
10 | * @public
11 | */
12 | error: 'ev_err',
13 |
14 | /**
15 | * This event type is used to signal a warning to event listeners.
16 | *
17 | * @public
18 | */
19 | warning: 'ev_warn',
20 | }
21 |
--------------------------------------------------------------------------------
/packages/kms-local/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link https://github.com/jedisct1/libsodium.js | libsodium} backed
3 | * {@link @veramo/kms-local#KeyManagementSystem | key management system } and
4 | * {@link @veramo/kms-local#SecretBox | secret box } for the {@link @veramo/key-manager#KeyManager}
5 | *
6 | * @packageDocumentation
7 | */
8 | export { KeyManagementSystem } from './key-management-system.js'
9 | export { SecretBox } from './secret-box.js'
10 |
--------------------------------------------------------------------------------
/packages/kv-store/src/store-adapters/typeorm/migrations/index.ts:
--------------------------------------------------------------------------------
1 | import { CreateKVDatabaseMigration } from './1.createKVDatabase.js'
2 |
3 | /**
4 | * The migrations array that SHOULD be used when initializing a TypeORM database connection.
5 | *
6 | * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
7 | *
8 | * @public
9 | */
10 | export const kvStoreMigrations = [CreateKVDatabaseMigration]
11 |
--------------------------------------------------------------------------------
/packages/key-manager/src/abstract-secret-box.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This simple abstract class can be extended by different implementations to provide encryption at rest for
3 | * some implementations of {@link @veramo/key-manager#AbstractPrivateKeyStore | AbstractPrivateKeyStore}.
4 | *
5 | * @public
6 | */
7 | export abstract class AbstractSecretBox {
8 | abstract encrypt(message: string): Promise
9 | abstract decrypt(encryptedMessageHex: string): Promise
10 | }
11 |
--------------------------------------------------------------------------------
/packages/kv-store/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "esModuleInterop": true,
5 | "rootDir": "src",
6 | "outDir": "build",
7 | "declarationDir": "build",
8 | "skipLibCheck": true,
9 | "strictFunctionTypes": false,
10 | "types": ["node"]
11 | },
12 | "references": [
13 | {
14 | "path": "../core-types"
15 | },
16 | {
17 | "path": "../utils"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/credential-jwt/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | // https://github.com/transmute-industries/vc.js/issues/60
8 | "skipLibCheck": true
9 | },
10 | "references": [
11 | { "path": "../core-types" },
12 | { "path": "../credential-w3c" },
13 | { "path": "../utils" }
14 | ],
15 | "include": ["./**/*.ts"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/selective-disclosure/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core-types"
12 | },
13 | {
14 | "path": "../message-handler"
15 | },
16 | {
17 | "path": "../utils"
18 | }
19 | ],
20 | "include": ["./**/*.ts"]
21 | }
22 |
--------------------------------------------------------------------------------
/packages/credential-eip712/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | // https://github.com/transmute-industries/vc.js/issues/60
8 | "skipLibCheck": true
9 | },
10 | "references": [
11 | { "path": "../core-types" },
12 | { "path": "../credential-w3c" },
13 | { "path": "../utils" }
14 | ],
15 | "include": ["./**/*.ts"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/data-store/README.md:
--------------------------------------------------------------------------------
1 | # Veramo data store
2 |
3 | Veramo data storage based on TypeORM.
4 | This package provides several plugins that relate to data storage.
5 |
6 | ### `DataStore`
7 | A plugin that exposes simple store/get methods for messages, credentials and presentations.
8 |
9 | ### `DataStoreORM`
10 | A plugin that provides more querying options using TypeORM.
11 |
12 | ### `KeyStore` and `DIDStore`
13 |
14 | Implementations of `AbstractKeyStore` and `AbstractDIDStore`
15 |
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "6.0.0",
3 | "npmClient": "pnpm",
4 | "changelog": {
5 | "repo": "decentralized-identity/veramo",
6 | "cacheDir": ".changelog"
7 | },
8 | "command": {
9 | "publish": {
10 | "allowBranch": [
11 | "main",
12 | "next",
13 | "master",
14 | "unstable"
15 | ],
16 | "conventionalCommits": true,
17 | "gitRemote": "origin",
18 | "message": "chore(release): %s [skip ci]"
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/cli/src/explore/styles.ts:
--------------------------------------------------------------------------------
1 | export const styles = {
2 | list: {
3 | selected: {
4 | fg: 'white',
5 | bg: 'blue',
6 | border: {
7 | fg: '#f0f0f0',
8 | },
9 | hover: {
10 | bg: 'green',
11 | },
12 | },
13 | },
14 | listtable: {
15 | header: {
16 | fg: 'blue',
17 | bold: true,
18 | },
19 | cell: {
20 | fg: 'white',
21 | selected: {
22 | bg: 'blue',
23 | },
24 | },
25 | },
26 | }
27 |
--------------------------------------------------------------------------------
/packages/kv-store/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/did-manager#DIDManager | plugin} for the
3 | * {@link @veramo/core#Agent} that implements {@link @veramo/core-types#IDIDManager} interface.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { KeyValueStore } from './key-value-store.js'
8 | export * from './store-adapters/tiered/index.js'
9 | export * from './store-adapters/typeorm/index.js'
10 | export * from './key-value-types.js'
11 | export * from './store-adapters/index.js'
12 |
--------------------------------------------------------------------------------
/packages/did-comm/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "lib": ["dom", "esnext"],
8 | "skipLibCheck": true
9 | },
10 | "references": [
11 | {
12 | "path": "../core-types"
13 | },
14 | {
15 | "path": "../message-handler"
16 | },
17 | {
18 | "path": "../utils"
19 | }
20 | ],
21 | "include": ["./**/*.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/mediation-manager/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "esModuleInterop": true,
5 | "rootDir": "src",
6 | "outDir": "build",
7 | "declarationDir": "build",
8 | "skipLibCheck": true,
9 | "strictFunctionTypes": false,
10 | "types": [
11 | "node"
12 | ]
13 | },
14 | "references": [
15 | {
16 | "path": "../core-types"
17 | },
18 | {
19 | "path": "../utils"
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts:
--------------------------------------------------------------------------------
1 | import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm'
2 |
3 | /**
4 | *
5 | * @beta This API may change without a BREAKING CHANGE notice.
6 | */
7 | @Entity('keyvaluestore')
8 | export class KeyValueStoreEntity extends BaseEntity {
9 | @PrimaryColumn()
10 | // @ts-ignore
11 | key: string
12 |
13 | @Column({
14 | type: 'text',
15 | })
16 | // @ts-ignore
17 | data: string
18 |
19 | expires?: number
20 | }
21 |
--------------------------------------------------------------------------------
/packages/cli/bin/veramo.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | const originalEmit = process.emit;
3 | process.emit = function (name, data, ...args) {
4 | if (
5 | name === `warning` &&
6 | typeof data === `object` &&
7 | data.name === `ExperimentalWarning`
8 | //if you want to only stop certain messages, test for the message here:
9 | //&& data.message.includes(`Fetch API`)
10 | ) {
11 | return false;
12 | }
13 | return originalEmit.apply(process, arguments);
14 | };
15 |
16 | import '../build/cli.js'
17 |
--------------------------------------------------------------------------------
/packages/core-types/src/types/ICredentialPlugin.ts:
--------------------------------------------------------------------------------
1 | import { ICredentialIssuer } from './ICredentialIssuer.js'
2 | import { ICredentialVerifier } from './ICredentialVerifier.js'
3 |
4 | /**
5 | * The interface definition for a plugin that can generate and verify Verifiable Credentials and Presentations
6 | *
7 | * @remarks Please see {@link https://www.w3.org/TR/vc-data-model | W3C Verifiable Credentials data model}
8 | *
9 | * @public
10 | */
11 | export type ICredentialPlugin = ICredentialIssuer & ICredentialVerifier
12 |
--------------------------------------------------------------------------------
/packages/core/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/mediation-manager/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 | "docModel": {
9 | "enabled": true,
10 | "apiJsonFilePath": "./api/.api.json"
11 | },
12 | "dtsRollup": {
13 | "enabled": false
14 | },
15 | "mainEntryPointFilePath": "/build/index.d.ts"
16 | }
17 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/reportWebVitals.ts:
--------------------------------------------------------------------------------
1 | import { ReportHandler } from 'web-vitals';
2 |
3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4 | if (onPerfEntry && onPerfEntry instanceof Function) {
5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6 | getCLS(onPerfEntry);
7 | getFID(onPerfEntry);
8 | getFCP(onPerfEntry);
9 | getLCP(onPerfEntry);
10 | getTTFB(onPerfEntry);
11 | });
12 | }
13 | };
14 |
15 | export default reportWebVitals;
16 |
--------------------------------------------------------------------------------
/packages/utils/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/core-types/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/data-store/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-comm/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-jwt/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/kms-local/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/kms-web3/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/kv-store/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/credential-jwt/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/credential-ld/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/credential-ld/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | // https://github.com/transmute-industries/vc.js/issues/60
8 | "skipLibCheck": true,
9 | "resolveJsonModule": true
10 | },
11 | "include": ["src/**/*.json", "src/**/*.ts"],
12 | "references": [
13 | { "path": "../core-types" },
14 | { "path": "../credential-w3c" },
15 | { "path": "../utils" }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/packages/credential-w3c/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/data-store-json/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-discovery/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-manager/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-resolver/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/key-manager/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/message-handler/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/remote-client/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/remote-server/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/url-handler/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/credential-eip712/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/credential-status/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-ethr/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-ethr/src/__tests__/identity-provider.test.ts:
--------------------------------------------------------------------------------
1 | // import SignerProvider from 'ethjs-provider-signer'
2 | // import { DIDResolverPlugin } from '@veramo/did-resolver'
3 | // import { IdentifierProvider } from '../identifier-provider'
4 | // import { Identifier } from '../identifier'
5 | // import { createJWT, decodeJWT, verifyJWT } from 'did-jwt'
6 | // const fs = require('fs')
7 |
8 | describe('dummy', () => {
9 | const a = 100
10 | it('should run a dummy test', () => {
11 | expect(a).toEqual(100)
12 | })
13 | })
14 |
--------------------------------------------------------------------------------
/packages/did-provider-ion/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-jwk/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-key/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-peer/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-pkh/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-web/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/selective-disclosure/api-extractor.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3 | "apiReport": {
4 | "enabled": true,
5 | "reportFolder": "./api",
6 | "reportTempFolder": "./api"
7 | },
8 |
9 | "docModel": {
10 | "enabled": true,
11 | "apiJsonFilePath": "./api/.api.json"
12 | },
13 |
14 | "dtsRollup": {
15 | "enabled": false
16 | },
17 | "mainEntryPointFilePath": "/build/index.d.ts"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/did-provider-ion/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core-types"
12 | },
13 | {
14 | "path": "../did-manager"
15 | },
16 | {
17 | "path": "../key-manager"
18 | },
19 | {
20 | "path": "../kms-local"
21 | },
22 | {
23 | "path": "../utils"
24 | }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/credential-w3c/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | // https://github.com/transmute-industries/vc.js/issues/60
8 | "skipLibCheck": true
9 | },
10 | "references": [
11 | {
12 | "path": "../core-types"
13 | },
14 | {
15 | "path": "../message-handler"
16 | },
17 | {
18 | "path": "../utils"
19 | }
20 | ],
21 | "include": [
22 | "./**/*.ts"
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/packages/test-react-app/craco.config.cjs:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack')
2 |
3 | module.exports = {
4 | babel: {
5 | plugins: ['@babel/plugin-syntax-import-assertions'],
6 | },
7 | webpack: {
8 | configure: (webpackConfig) => {
9 | // Add ProvidePlugin for global process availability
10 | webpackConfig.plugins = [
11 | ...webpackConfig.plugins,
12 | new webpack.ProvidePlugin({
13 | process: 'process/browser',
14 | }),
15 | ]
16 |
17 | return webpackConfig
18 | },
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/packages/did-provider-jwk/src/types/jwk-provider-types.ts:
--------------------------------------------------------------------------------
1 | import { RequireOnly, KeyMetadata } from '@veramo/core-types'
2 | import { JwkDidSupportedKeyTypes, KeyUse, CreateIdentifierBaseOptions } from '@veramo/utils'
3 |
4 | export type JwkCreateIdentifierOptions = CreateIdentifierBaseOptions & {
5 | /**
6 | * @deprecated use key.type instead
7 | */
8 | keyType?: JwkDidSupportedKeyTypes
9 |
10 | /**
11 | * @deprecated use key.privateKeyHex instead
12 | */
13 | privateKeyHex?: string
14 |
15 | keyUse?: KeyUse
16 | };
17 |
--------------------------------------------------------------------------------
/.github/workflows/sync-next-with-latest.yml:
--------------------------------------------------------------------------------
1 | name: Sync @next with @latest
2 | permissions:
3 | contents: write
4 | on:
5 | workflow_dispatch:
6 | push:
7 | branches:
8 | - 'main'
9 | jobs:
10 | merge-branch:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v5
14 | - uses: everlytic/branch-merge@1.1.5
15 | with:
16 | github_token: ${{ secrets.GH_TOKEN }}
17 | source_ref: ${{ github.ref }}
18 | target_branch: 'next'
19 | commit_message_template: 'chore(ci): merge main into next'
20 |
--------------------------------------------------------------------------------
/packages/did-discovery/src/abstract-did-discovery-provider.ts:
--------------------------------------------------------------------------------
1 | import type { IAgentContext } from '@veramo/core-types'
2 | import type { IDIDDiscoveryDiscoverDidArgs, IDIDDiscoveryProviderResult } from './types.js'
3 |
4 | /**
5 | * An abstract class for the {@link @veramo/did-discovery#DIDDiscovery} providers
6 | * @public
7 | */
8 | export abstract class AbstractDidDiscoveryProvider {
9 | abstract name: string
10 | abstract discoverDid(
11 | args: IDIDDiscoveryDiscoverDidArgs,
12 | context: IAgentContext,
13 | ): Promise
14 | }
15 |
--------------------------------------------------------------------------------
/packages/did-manager/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/did-manager#DIDManager | plugin} for the
3 | * {@link @veramo/core#Agent} that implements {@link @veramo/core-types#IDIDManager} interface.
4 | *
5 | * @packageDocumentation
6 | */
7 | export { DIDManager } from './id-manager.js'
8 | export { AbstractIdentifierProvider } from './abstract-identifier-provider.js'
9 | export { AbstractDIDStore } from './abstract-identifier-store.js'
10 | export { MemoryDIDStore } from './memory-did-store.js'
11 | export { AliasDiscoveryProvider } from './did-discovery-provider.js'
12 |
--------------------------------------------------------------------------------
/.github/workflows/veramo-website.yml:
--------------------------------------------------------------------------------
1 | name: Trigger veramo-website build
2 | on:
3 | push:
4 | branches:
5 | - "main"
6 | jobs:
7 | dispatch:
8 | permissions:
9 | contents: write
10 | actions: write
11 | runs-on: ubuntu-latest
12 | steps:
13 | - run: |
14 | curl -X POST \
15 | -H 'Authorization: token ${{ secrets.GH_TOKEN }}' \
16 | -H "Accept: application/vnd.github.v3+json" \
17 | https://api.github.com/repos/uport-project/veramo-website/dispatches \
18 | -d '{"event_type":"deploy_website"}'
19 |
--------------------------------------------------------------------------------
/packages/kv-store/src/store-adapters/tiered/types.ts:
--------------------------------------------------------------------------------
1 | import { IKeyValueStoreAdapter } from '../../key-value-types.js'
2 |
3 | export type Options = {
4 | local: IKeyValueStoreAdapter | Map
5 | remote: IKeyValueStoreAdapter | Map
6 | localOnly?: boolean
7 | iterationLimit?: number | string
8 | }
9 |
10 | // eslint-disable-next-line @typescript-eslint/naming-convention
11 | export type Options_ = {
12 | validator: (value: any, key: string) => boolean
13 | dialect: string
14 | iterationLimit?: number | string
15 | localOnly?: boolean
16 | }
17 |
--------------------------------------------------------------------------------
/packages/did-manager/src/abstract-identifier-store.ts:
--------------------------------------------------------------------------------
1 | import { IIdentifier } from '@veramo/core-types'
2 |
3 | /**
4 | * An abstract class for the {@link @veramo/did-manager#DIDManager} identifier store
5 | * @public
6 | */
7 | export abstract class AbstractDIDStore {
8 | abstract importDID(args: IIdentifier): Promise
9 | abstract getDID(args: { did: string }): Promise
10 | abstract getDID(args: { alias: string }): Promise
11 | abstract deleteDID(args: { did: string }): Promise
12 | abstract listDIDs(args: { alias?: string; provider?: string }): Promise
13 | }
14 |
--------------------------------------------------------------------------------
/tsconfig.scripts.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./packages/tsconfig.settings.json",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "outDir": "./build",
6 | "rootDir": ".",
7 | "types": ["node", "jest"],
8 | },
9 | "include": [
10 | "scripts/**/*",
11 | "packages/**/*"
12 | ],
13 | "exclude": [
14 | "node_modules",
15 | "build",
16 | "**/__tests__/**/*",
17 | "**/build/**/*"
18 | ],
19 | "ts-node": {
20 | "compilerOptions": {
21 | "module": "CommonJS",
22 | "target": "ES2020",
23 | "moduleResolution": "node",
24 | "types": ["node"]
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/packages/test-react-app/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/packages/data-store/src/utils.ts:
--------------------------------------------------------------------------------
1 | import { DataSource } from 'typeorm'
2 | import { OrPromise } from "@veramo/utils";
3 |
4 | /**
5 | * Ensures that the provided DataSource is connected.
6 | *
7 | * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource
8 | */
9 | export async function getConnectedDb(dbConnection: OrPromise): Promise {
10 | if (dbConnection instanceof Promise) {
11 | return await dbConnection
12 | } else if (!dbConnection.isInitialized) {
13 | return await (dbConnection).initialize()
14 | } else {
15 | return dbConnection
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/did-provider-jwk/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "declarationDir": "build",
7 | "skipLibCheck": true
8 | },
9 | "references": [
10 | {
11 | "path": "../core-types"
12 | },
13 | {
14 | "path": "../core"
15 | },
16 | {
17 | "path": "../did-manager"
18 | },
19 | {
20 | "path": "../did-resolver"
21 | },
22 | {
23 | "path": "../key-manager"
24 | },
25 | {
26 | "path": "../kms-local"
27 | },
28 | {
29 | "path": "../utils"
30 | }
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_STORE
3 | .eslintcache
4 | *.swp
5 | *~
6 | /examples/*/node_modules/
7 | /examples/*/build/
8 | /docs
9 | /report
10 | /node_modules
11 | website/node_modules
12 |
13 | **/build/
14 | **/*.log
15 | /packages/*/build/
16 | /packages/*/api/*.api.json
17 | /packages/*/api/*.api.md
18 | /packages/*/coverage/
19 | /packages/*/node_modules/
20 | coverage
21 |
22 | .npmrc
23 |
24 | npm-debug.log
25 | npm-debug.log*
26 | lerna-debug.log
27 |
28 | *.tsbuildinfo
29 | identity-store.json
30 | key-store.json
31 | *.sqlite
32 |
33 | .vscode/
34 | node_modules
35 | temp/
36 | tmp/
37 |
38 | agent.yml
39 | data
40 | .vscode-upload.json
41 |
42 | local-database*.json
43 |
--------------------------------------------------------------------------------
/packages/cli/src/util.ts:
--------------------------------------------------------------------------------
1 | export async function readStdin(): Promise {
2 | return new Promise((resolve, reject) => {
3 | let data = ''
4 | process.stdin.setEncoding('utf-8')
5 |
6 | process.stdin.on('readable', () => {
7 | let chunk: string
8 | while ((chunk = process.stdin.read())) {
9 | data += chunk
10 | }
11 | })
12 |
13 | process.stdin.on('end', () => {
14 | // There will be a trailing \n from the user hitting enter. Get rid of it.
15 | data = data.replace(/\n$/, '')
16 | resolve(data)
17 | })
18 |
19 | process.stdin.on('error', (error) => {
20 | reject(error)
21 | })
22 | })
23 | }
24 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import './global'
4 | import './index.css';
5 | import App from './App';
6 | import reportWebVitals from './reportWebVitals';
7 |
8 |
9 | const container = document.getElementById('root');
10 | const root = createRoot(container);
11 | root.render(
12 |
13 | );
14 |
15 | // If you want to start measuring performance in your app, pass a function
16 | // to log results (for example: reportWebVitals(console.log))
17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
18 | reportWebVitals();
19 |
--------------------------------------------------------------------------------
/packages/data-store-json/README.md:
--------------------------------------------------------------------------------
1 | # Veramo data store using JSON trees
2 |
3 | Veramo data storage based on JSON trees.
4 | This package provides several plugins that relate to data storage that is backed up by a JSON tree.
5 |
6 | ### `DataStoreJSON`
7 | A plugin that exposes simple store/get methods for messages, credentials and presentations.
8 | This implements the `@veramo/data-store#DataStore` plugin interface.
9 |
10 | ### `DataStoreORMJson`
11 | A plugin that provides more querying options using TypeORM.
12 | This implements the `@veramo/data-store#DataStoreORM` plugin interface.
13 |
14 | ### `KeyStore` and `DIDStore`
15 |
16 | Implementations of `AbstractKeyStore` and `AbstractDIDStore`
17 |
--------------------------------------------------------------------------------
/packages/test-react-app/config/jest/babelTransform.cjs:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const babelJest = require('babel-jest').default;
4 |
5 | const hasJsxRuntime = (() => {
6 | if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
7 | return false;
8 | }
9 |
10 | try {
11 | require.resolve('react/jsx-runtime');
12 | return true;
13 | } catch (e) {
14 | return false;
15 | }
16 | })();
17 |
18 | module.exports = babelJest.createTransformer({
19 | presets: [
20 | [
21 | require.resolve('babel-preset-react-app'),
22 | {
23 | runtime: hasJsxRuntime ? 'automatic' : 'classic',
24 | },
25 | ],
26 | ],
27 | babelrc: false,
28 | configFile: false,
29 | });
--------------------------------------------------------------------------------
/packages/selective-disclosure/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/selective-disclosure#ISelectiveDisclosure | plugin} for the {@link @veramo/core#Agent}
3 | * that implements {@link @veramo/selective-disclosure#SelectiveDisclosure} interface.
4 | *
5 | * Provides a {@link @veramo/selective-disclosure#SdrMessageHandler | plugin} for the
6 | * {@link @veramo/message-handler#MessageHandler} that detects Selective Disclosure Request in a message
7 | *
8 | * @packageDocumentation
9 | */
10 | export { SdrMessageHandler, MessageTypes } from './message-handler.js'
11 | export { SelectiveDisclosure } from './action-handler.js'
12 | export * from './types.js'
13 | export { schema } from './plugin.schema.js'
14 |
--------------------------------------------------------------------------------
/packages/core-types/src/types/ICredentialStatus.ts:
--------------------------------------------------------------------------------
1 | import { ICredentialStatusVerifier } from './ICredentialStatusVerifier.js'
2 | import { ICredentialStatusManager } from './ICredentialStatusManager.js'
3 |
4 | /**
5 | * Veramo plugin interface for plugins implementing both the {@link ICredentialStatusManager | manager} and the
6 | * {@link ICredentialStatusVerifier | verifier} aspects of Credential Status flow.
7 | *
8 | * @see {@link https://www.w3.org/TR/vc-data-model/#status | credentialStatus} data model
9 | * @see {@link @veramo/credential-status#CredentialStatusPlugin | CredentialStatusPlugin}
10 | *
11 | * @beta
12 | */
13 | export type ICredentialStatus = ICredentialStatusVerifier & ICredentialStatusManager
14 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[proposal]"
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/packages/did-comm/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/did-comm#DIDComm | plugin} for the {@link @veramo/core#Agent} that implements
3 | * {@link @veramo/did-comm#IDIDComm} interface. Provides a {@link @veramo/did-comm#DIDCommMessageHandler | plugin}
4 | * for the {@link @veramo/message-handler#MessageHandler} that decrypts messages.
5 | *
6 | * @packageDocumentation
7 | */
8 |
9 | export * from './didcomm.js'
10 | export * from './types/message-types.js'
11 | export * from './types/utility-types.js'
12 | export * from './types/IDIDComm.js'
13 | export { DIDCommMessageHandler } from './message-handler.js'
14 | export * from './protocols/index.js'
15 | export * from './transports/transports.js'
16 | export { schema } from './plugin.schema.js'
17 |
--------------------------------------------------------------------------------
/packages/kms-local/README.md:
--------------------------------------------------------------------------------
1 | # Veramo Local KMS
2 |
3 | A Veramo KMS implementation that provides Ed25519 and secp256k1 crypto.
4 |
5 | This module provides an implementation
6 | of [`AbstractKeyManagementSystem`](../key-manager/src/abstract-key-management-system.ts#L6) that can be used by the
7 | [`@veramo/key-manager`](../key-manager) plugin to provide Secp256k1, Ed25519, and X25519 crypto functionality to a
8 | Veramo agent.
9 |
10 | The keys managed by this module are stored in an implementation
11 | of [`AbstractPrivateKeyStore`](../key-manager/src/abstract-private-key-store.ts).
12 | See [`MemoryPrivateKeyStore`](../key-manager/src/memory-key-store.ts#L43)
13 | or [`PrivateKeyStore`](../data-store/src/identifier/private-key-store.ts) for implementations.
14 |
--------------------------------------------------------------------------------
/packages/cli/src/lib/agentCreator.ts:
--------------------------------------------------------------------------------
1 | import { TAgent, IPluginMethodMap } from '@veramo/core-types'
2 | import { createObjects } from './objectCreator.js'
3 |
4 | /**
5 | * Creates a Veramo agent from a config object containing an `/agent` pointer.
6 | * @param config - The configuration object
7 | *
8 | * @see {@link https://veramo.io/docs/veramo_agent/configuration_internals | Configuration Internals} for details on
9 | * the configuration options.
10 | *
11 | * @beta - This API may change without a major version bump
12 | */
13 | export async function createAgentFromConfig(config: object): Promise> {
14 | // @ts-ignore
15 | const { agent } = await createObjects(config, { agent: '/agent' })
16 | return agent
17 | }
18 |
--------------------------------------------------------------------------------
/packages/key-manager/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/key-manager#KeyManager | plugin} for the {@link @veramo/core#Agent}
3 | * that implements {@link @veramo/core-types#IKeyManager} interface
4 | *
5 | * @packageDocumentation
6 | */
7 | export { KeyManager } from './key-manager.js'
8 | export { AbstractKeyManagementSystem } from './abstract-key-management-system.js'
9 | export { AbstractKeyStore } from './abstract-key-store.js'
10 | export {
11 | AbstractPrivateKeyStore,
12 | ImportablePrivateKey,
13 | ManagedPrivateKey,
14 | } from './abstract-private-key-store.js'
15 | export { AbstractSecretBox } from './abstract-secret-box.js'
16 | export { MemoryKeyStore, MemoryPrivateKeyStore } from './memory-key-store.js'
17 | export * from './types.js'
18 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 60
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 7
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | - planned-feature
10 | # Label to use when marking an issue as stale
11 | staleLabel: wontfix
12 | # Comment to post when marking an issue as stale. Set to `false` to disable
13 | markComment: >
14 | This issue has been automatically marked as stale because it has not had
15 | recent activity. It will be closed if no further activity occurs. Thank you
16 | for your contributions.
17 | # Comment to post when closing a stale issue. Set to `false` to disable
18 | closeComment: false
19 |
--------------------------------------------------------------------------------
/packages/data-store/src/entities/PreMigrationEntities.ts:
--------------------------------------------------------------------------------
1 | import { Column, Entity, PrimaryColumn } from 'typeorm'
2 | import { Key } from './key.js'
3 |
4 | /**
5 | * This represents the private key data of keys that were stored by {@link @veramo/data-store#KeyStore} before Veramo
6 | * 3.0. During database migration this key material is moved to a different table and accessible by
7 | * {@link @veramo/data-store#PrivateKeyStore}.
8 | *
9 | * @beta This API may change without a BREAKING CHANGE notice.
10 | */
11 | @Entity('key', )
12 | export class PreMigrationKey extends Key {
13 | // Key contains all the other columns present needed for successful migrations
14 |
15 | @PrimaryColumn()
16 | // @ts-ignore
17 | kid: string
18 |
19 | @Column({ nullable: true })
20 | privateKeyHex?: string
21 | }
22 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@version": 1.1,
4 | "id": "@id",
5 | "type": "@type",
6 | "esrs2020": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#",
7 | "EcdsaSecp256k1RecoverySignature2020": "esrs2020:EcdsaSecp256k1RecoverySignature2020",
8 | "EcdsaSecp256k1RecoveryMethod2020": "esrs2020:EcdsaSecp256k1RecoveryMethod2020",
9 | "publicKeyJwk": {
10 | "@id": "esrs2020:publicKeyJwk",
11 | "@type": "@json"
12 | },
13 | "privateKeyJwk": {
14 | "@id": "esrs2020:privateKeyJwk",
15 | "@type": "@json"
16 | },
17 | "publicKeyHex": "esrs2020:publicKeyHex",
18 | "privateKeyHex": "esrs2020:privateKeyHex",
19 | "ethereumAddress": "esrs2020:ethereumAddress"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/remote-server/src/api-key-auth.ts:
--------------------------------------------------------------------------------
1 | import passport from 'passport'
2 | import Bearer from 'passport-http-bearer'
3 | import { Router } from 'express'
4 |
5 | /**
6 | * This provides a simple authorization mechanism based on a single pre-shared API key.
7 | *
8 | * @param apiKey - the pre-shared API key
9 | *
10 | * @public
11 | */
12 | export function apiKeyAuth({ apiKey }: { apiKey: string }): Router {
13 | const router = Router()
14 | router.use(passport.initialize())
15 | passport.use(
16 | new Bearer.Strategy((token, done) => {
17 | if (!apiKey || apiKey === token) {
18 | done(null, {}, { scope: 'all' })
19 | } else {
20 | done(null, false)
21 | }
22 | }),
23 | )
24 | router.use(passport.authenticate('bearer', { session: false }))
25 | return router
26 | }
27 |
--------------------------------------------------------------------------------
/packages/test-react-app/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "jest": true,
4 | "node": true,
5 | "browser": true
6 | },
7 | "globals": {
8 | "page": true,
9 | "browser": true,
10 | "context": true,
11 | "jestPuppeteer": true
12 | },
13 | "parserOptions": {
14 | "sourceType": "module",
15 | "ecmaVersion": 2020,
16 | "ecmaFeatures": {
17 | "jsx": true,
18 | "modules": true,
19 | "experimentalObjectRestSpread": true
20 | }
21 | },
22 | "plugins": [
23 | "react",
24 | "@typescript-eslint"
25 | ],
26 | "extends": [
27 | "eslint:recommended",
28 | "plugin:react/recommended",
29 | "plugin:@typescript-eslint/eslint-recommended",
30 | "plugin:@typescript-eslint/recommended"
31 | ],
32 | "ignorePatterns": ["**/*.browser-test.ts"]
33 | }
34 |
--------------------------------------------------------------------------------
/packages/test-react-app/jest-integration.config.cjs:
--------------------------------------------------------------------------------
1 | const { defaults } = require('jest-config')
2 |
3 | /**
4 | * @type {import('jest-environment-puppeteer').JestPuppeteerConfig}
5 | */
6 | const config = {
7 | // preset path is relative to the rootDir when that is set
8 | preset: '../jest-preset-puppeteer-esm/jest-preset.cjs',
9 | rootDir: 'headless-tests',
10 | moduleFileExtensions: [...defaults.moduleFileExtensions, 'mts'],
11 | testRegex: './*\\.browser-test\\.(ts|tsx?)$',
12 | transform: {
13 | '^.+\\.m?tsx?$': ['ts-jest', { useESM: true }],
14 | },
15 | transformIgnorePatterns: [],
16 | testTimeout: 30000,
17 | collectCoverage: false,
18 | coverageProvider: 'v8',
19 | moduleNameMapper: {
20 | '^(\\.{1,2}/.*)\\.js$': '$1',
21 | },
22 | cache: false,
23 | }
24 |
25 | module.exports = config
26 |
--------------------------------------------------------------------------------
/packages/core-types/src/types/IVerifyResult.ts:
--------------------------------------------------------------------------------
1 | import { IError } from "./IError.js"
2 | /**
3 | * Encapsulates the response object to verifyPresentation method after verifying a
4 | * {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation}
5 | *
6 | * @beta
7 | */
8 | export interface IVerifyResult {
9 | /**
10 | * This value is used to transmit the result of verification.
11 | */
12 | verified: boolean
13 |
14 | /**
15 | * Optional Error object for the
16 | * but currently the machine readable errors are not expored from DID-JWT package to be imported here
17 | */
18 | error?: IError
19 |
20 | /**
21 | * Other options can be specified for verification.
22 | * They will be forwarded to the lower level modules. that performt the checks
23 | */
24 | [x: string]: any
25 | }
--------------------------------------------------------------------------------
/packages/credential-ld/src/contexts/w3id.org_security_suites_x25519-2019_v1.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "id": "@id",
4 | "type": "@type",
5 | "@protected": true,
6 | "X25519KeyAgreementKey2019": {
7 | "@id": "https://w3id.org/security#X25519KeyAgreementKey2019",
8 | "@context": {
9 | "@protected": true,
10 | "id": "@id",
11 | "type": "@type",
12 | "controller": {
13 | "@id": "https://w3id.org/security#controller",
14 | "@type": "@id"
15 | },
16 | "revoked": {
17 | "@id": "https://w3id.org/security#revoked",
18 | "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
19 | },
20 | "publicKeyBase58": {
21 | "@id": "https://w3id.org/security#publicKeyBase58"
22 | }
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/key-manager/src/abstract-key-store.ts:
--------------------------------------------------------------------------------
1 | import { IKey, ManagedKeyInfo } from '@veramo/core-types'
2 |
3 | /**
4 | * This base abstract class should be extended to provide platform specific implementations that are usable by
5 | * {@link @veramo/key-manager#KeyManager | KeyManager}.
6 | *
7 | * Implementations of this class are used to store mappings between key IDs and their respective
8 | * {@link @veramo/key-manager#AbstractKeyManagementSystem | AbstractKeyManagementSystem} implementations.
9 | *
10 | * @public
11 | */
12 | export abstract class AbstractKeyStore {
13 | abstract importKey(args: Partial): Promise
14 |
15 | abstract getKey(args: { kid: string }): Promise
16 |
17 | abstract deleteKey(args: { kid: string }): Promise
18 |
19 | abstract listKeys(args: {}): Promise>
20 | }
21 |
--------------------------------------------------------------------------------
/packages/kv-store/src/store-adapters/typeorm/types.ts:
--------------------------------------------------------------------------------
1 | import { OrPromise } from '@veramo/utils'
2 | import { DataSource } from 'typeorm'
3 | import { KeyvDeserializedData } from '../../keyv/keyv-types.js'
4 |
5 | /**
6 | * @public
7 | */
8 | export type KeyValueTypeORMOptions = {
9 | dbConnection: OrPromise
10 |
11 | namespace?: string
12 | }
13 |
14 | /**
15 | * Internal options for the TypeORM adapter
16 | * @internal
17 | */
18 | // eslint-disable-next-line @typescript-eslint/naming-convention
19 | export type Options_ = {
20 | validator: (value: any, key: string) => boolean
21 | dialect: string
22 | serialize: (data: KeyvDeserializedData) => OrPromise
23 | /** A custom deserialization function. */
24 | deserialize: (data: any) => OrPromise | undefined>
25 | }
26 |
--------------------------------------------------------------------------------
/packages/test-utils/src/broken-did-discovery.ts:
--------------------------------------------------------------------------------
1 | import { IAgentContext, } from '@veramo/core-types'
2 | import {
3 | AbstractDidDiscoveryProvider,
4 | IDIDDiscoveryDiscoverDidArgs,
5 | IDIDDiscoveryProviderResult
6 | } from "@veramo/did-discovery";
7 |
8 | /**
9 | * A DID Discovery provider that throws an error for a particular query, used to test error handling.
10 | */
11 | export class BrokenDiscoveryProvider implements AbstractDidDiscoveryProvider {
12 | readonly name = 'broken-discovery'
13 |
14 | async discoverDid(
15 | args: IDIDDiscoveryDiscoverDidArgs,
16 | context: IAgentContext,
17 | ): Promise {
18 | if (args.query.match(/broken/)) {
19 | throw new Error(`test_error: let's see how the plugin handles provider errors`)
20 | }
21 | return { matches: [], provider: this.name }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/tsconfig.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "strict": true,
4 | "preserveConstEnums": true,
5 | "sourceMap": true,
6 | "target": "ES2022",
7 | "module": "ESNext",
8 | "moduleResolution": "Node",
9 | "esModuleInterop": true,
10 | "downlevelIteration": true,
11 | "declarationMap": true,
12 | "declaration": true,
13 | "composite": true,
14 | "emitDecoratorMetadata": true,
15 | "useUnknownInCatchVariables": false,
16 | "experimentalDecorators": true,
17 | "resolveJsonModule": true,
18 | "allowSyntheticDefaultImports": true,
19 | "skipLibCheck": true,
20 | "types": [
21 | "jest"
22 | ]
23 | },
24 | "ts-node": {
25 | "compilerOptions": {
26 | "module": "CommonJS"
27 | }
28 | },
29 | "exclude": [
30 | "**/__tests__/**/*",
31 | "**/build/**/*"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/packages/did-comm/src/encryption/a256kw.ts:
--------------------------------------------------------------------------------
1 | import { AESKW } from '@stablelib/aes-kw'
2 | import type { EncryptionResult, KeyWrapper } from 'did-jwt'
3 |
4 | /**
5 | * Creates a wrapper using AES-KW
6 | * @param wrappingKey
7 | */
8 | export const a256KeyWrapper: KeyWrapper = {
9 | from: (wrappingKey: Uint8Array) => {
10 | const wrap = async (cek: Uint8Array): Promise => {
11 | return { ciphertext: new AESKW(wrappingKey).wrapKey(cek) }
12 | }
13 | return { wrap }
14 | },
15 |
16 | alg: 'A256KW',
17 | }
18 |
19 | export function a256KeyUnwrapper(wrappingKey: Uint8Array) {
20 | const unwrap = async (wrappedCek: Uint8Array): Promise => {
21 | try {
22 | return new AESKW(wrappingKey).unwrapKey(wrappedCek)
23 | } catch (e) {
24 | return null
25 | }
26 | }
27 | return { unwrap, alg: 'A256KW' }
28 | }
29 |
--------------------------------------------------------------------------------
/docsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "documentPackages": [
3 | "core",
4 | "core-types",
5 | "credential-eip712",
6 | "credential-ld",
7 | "credential-status",
8 | "credential-w3c",
9 | "data-store",
10 | "data-store-json",
11 | "did-comm",
12 | "did-discovery",
13 | "did-jwt",
14 | "did-manager",
15 | "did-provider-ethr",
16 | "did-provider-ion",
17 | "did-provider-jwk",
18 | "did-provider-key",
19 | "did-provider-peer",
20 | "did-provider-pkh",
21 | "did-provider-web",
22 | "did-resolver",
23 | "key-manager",
24 | "kms-local",
25 | "kms-web3",
26 | "message-handler",
27 | "remote-client",
28 | "remote-server",
29 | "selective-disclosure",
30 | "url-handler",
31 | "utils"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/contexts/w3id.org_security_suites_x25519-2020_v1.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "id": "@id",
4 | "type": "@type",
5 | "@protected": true,
6 | "X25519KeyAgreementKey2020": {
7 | "@id": "https://w3id.org/security#X25519KeyAgreementKey2020",
8 | "@context": {
9 | "@protected": true,
10 | "id": "@id",
11 | "type": "@type",
12 | "controller": {
13 | "@id": "https://w3id.org/security#controller",
14 | "@type": "@id"
15 | },
16 | "revoked": {
17 | "@id": "https://w3id.org/security#revoked",
18 | "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
19 | },
20 | "publicKeyMultibase": {
21 | "@id": "https://w3id.org/security#publicKeyMultibase",
22 | "@type": "https://w3id.org/security#multibase"
23 | }
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/scripts/docs-copy.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path'
2 | import { resolve } from 'path'
3 | import { existsSync, readdirSync, copyFileSync, mkdirSync, unlinkSync } from 'fs'
4 |
5 | const outputFolder = './temp'
6 | const { documentPackages } = require('../docsconfig.json')
7 |
8 | if (!existsSync(resolve(outputFolder))) {
9 | console.log('Creating', outputFolder)
10 | mkdirSync(resolve(outputFolder))
11 | } else {
12 | console.log('Removing files in', outputFolder)
13 | readdirSync(resolve(outputFolder)).forEach((file) => {
14 | unlinkSync(resolve(outputFolder, file))
15 | })
16 | }
17 |
18 | for (const packageName of documentPackages) {
19 | const apiDocsPath: string = path.join(__dirname, `../packages/${packageName}/api`)
20 |
21 | readdirSync(apiDocsPath).forEach((file) => {
22 | console.log('Copying', resolve(outputFolder, file))
23 | copyFileSync(resolve(apiDocsPath, file), resolve(outputFolder, file))
24 | })
25 | }
26 |
--------------------------------------------------------------------------------
/packages/data-store/src/entities/private-key.ts:
--------------------------------------------------------------------------------
1 | import { KeyType } from './key.js'
2 | import { Entity, Column, PrimaryColumn, BaseEntity } from 'typeorm'
3 |
4 | /**
5 | * Represents some properties of a {@link @veramo/key-manager#ManagedPrivateKey | ManagedPrivateKey} that are stored in
6 | * a TypeORM database when using a {@link @veramo/data-store#PrivateKeyStore | PrivateKeyStore} to store private key
7 | * data.
8 | *
9 | * @see {@link @veramo/kms-local#KeyManagementSystem | KeyManagementSystem} for an implementation of a KMS that can
10 | * make use of such stored keys.
11 | *
12 | * @beta This API may change without a BREAKING CHANGE notice.
13 | */
14 | @Entity('private-key')
15 | export class PrivateKey extends BaseEntity {
16 | @PrimaryColumn()
17 | // @ts-ignore
18 | alias: string
19 |
20 | @Column()
21 | // @ts-ignore
22 | type: KeyType
23 |
24 | @Column()
25 | // @ts-ignore
26 | privateKeyHex: string
27 | }
28 |
--------------------------------------------------------------------------------
/packages/key-manager/src/__tests__/abstract-key-store.test.ts:
--------------------------------------------------------------------------------
1 | import { AbstractKeyStore } from '../abstract-key-store.js'
2 | import { IKey, ManagedKeyInfo } from '@veramo/core-types'
3 |
4 | class MockKeyStore extends AbstractKeyStore {
5 | async listKeys(args: {}): Promise {
6 | return [
7 | {
8 | kid: '',
9 | kms: '',
10 | type: 'Ed25519',
11 | publicKeyHex: '',
12 | },
13 | ]
14 | }
15 | async getKey({ kid }: { kid: string }): Promise {
16 | return {
17 | kid: '',
18 | kms: '',
19 | type: 'Ed25519',
20 | publicKeyHex: '',
21 | }
22 | }
23 |
24 | async deleteKey({ kid }: { kid: string }) {
25 | return true
26 | }
27 |
28 | async importKey(args: IKey): Promise {
29 | return true
30 | }
31 | }
32 |
33 | describe('core AbstractKeyStore compile time error checking', () => {
34 | it.todo('call mock methods')
35 | })
36 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: 14px;
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
40 | pre {
41 | font-family: monospace;
42 | white-space: pre;
43 | }
44 |
45 | pre {
46 | text-align: left;
47 | width: 90%;
48 | background-color: #24232d;
49 | color: #25c2a0;
50 | padding: 15px;
51 | overflow: scroll;
52 | }
53 |
--------------------------------------------------------------------------------
/packages/cli/src/discover.ts:
--------------------------------------------------------------------------------
1 | import { getAgent } from './setup.js'
2 | import { Command } from 'commander'
3 | import { printTable } from 'console-table-printer'
4 |
5 | const discover = new Command('discover').description('Discovery')
6 |
7 | discover
8 | .command('did')
9 | .description('did discovery')
10 | .option('-q, --query ', 'Query string')
11 |
12 | .action(async (opts: { query: string }, cmd: Command) => {
13 | const agent = await getAgent(cmd.optsWithGlobals().config)
14 |
15 | const response = await agent.discoverDid({ query: opts.query })
16 | const list: any = []
17 |
18 | response.results.forEach((r: any) => {
19 | r.matches.forEach((m: any) => {
20 | list.push({
21 | provider: r.provider,
22 | did: m.did,
23 | })
24 | })
25 | })
26 |
27 | if (list.length > 0) {
28 | printTable(list)
29 | } else {
30 | console.log('No dids discovered')
31 | }
32 | })
33 |
34 | export { discover }
35 |
--------------------------------------------------------------------------------
/packages/data-store-json/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * {@link @veramo/core#Agent} {@link @veramo/data-store-json#DataStoreJson | plugin} that implements
3 | * {@link @veramo/core-types#IDataStore } and
4 | * {@link @veramo/core-types#IDataStoreORM }interfaces and uses a JSON tree as a backend.
5 | *
6 | * The JSON tree backend can be persisted to any JSON compatible media using a callback that gets called when the agent
7 | * data is updated.
8 | *
9 | * @packageDocumentation
10 | */
11 |
12 | export { DataStoreJson } from './data-store-json.js'
13 | export {
14 | DiffCallback,
15 | ClaimTableEntry,
16 | CredentialTableEntry,
17 | PresentationTableEntry,
18 | VeramoJsonCache,
19 | VeramoJsonStore,
20 | } from './types.js'
21 | export { DIDStoreJson } from './identifier/did-store.js'
22 | export { KeyStoreJson } from './identifier/key-store.js'
23 | export { PrivateKeyStoreJson } from './identifier/private-key-store.js'
24 | export { BrowserLocalStorageStore } from './browser-local-storage-store.js'
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Bug severity**
11 | Please rate severity from 1-5, 1 being very minor and 5 being critical
12 |
13 | **Describe the bug**
14 | A clear and concise description of what the bug is.
15 |
16 | **To Reproduce**
17 | Steps to reproduce the behaviour:
18 | 1. ...
19 | 2. ...
20 | 3. ...
21 | 4. ...
22 |
23 | **Observed behaviour**
24 | A clear and concise description of what you observe.
25 |
26 | **Expected behaviour**
27 | A clear and concise description of what you expected to happen.
28 |
29 | **Details**
30 | If applicable, add screenshots, error messages or stack traces to help explain your problem.
31 |
32 | **Additional context**
33 | Add any other context about the problem here.
34 |
35 | **Versions (please complete the following information):**
36 | - Veramo: [e.g. 1.3]
37 | - Browser [e.g. chrome, safari]
38 | - Node Version [e.g. 10]
39 |
--------------------------------------------------------------------------------
/packages/message-handler/src/abstract-message-handler.ts:
--------------------------------------------------------------------------------
1 | import { IAgentContext } from '@veramo/core-types'
2 | import { Message } from './message.js'
3 | import Debug from 'debug'
4 |
5 | const debug = Debug('veramo:message-handler')
6 | export const unsupportedMessageTypeError = new Error('Unsupported message type')
7 |
8 | /**
9 | * An abstract class for creating {@link @veramo/message-handler#MessageHandler} plugins
10 | * @public
11 | */
12 | export abstract class AbstractMessageHandler {
13 | public nextMessageHandler?: AbstractMessageHandler
14 |
15 | public setNext(messageHandler: AbstractMessageHandler): AbstractMessageHandler {
16 | this.nextMessageHandler = messageHandler
17 | return messageHandler
18 | }
19 |
20 | public async handle(message: Message, context: IAgentContext<{}>): Promise {
21 | if (this.nextMessageHandler) return this.nextMessageHandler.handle(message, context)
22 | debug("can't handle message: ", message)
23 | return Promise.reject(unsupportedMessageTypeError)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/core/src/schemas/ValidationError.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | components: {
3 | schemas: {
4 | ValidationError: {
5 | type: 'object',
6 | properties: {
7 | name: {
8 | type: 'string',
9 | description: 'Error name',
10 | },
11 | method: {
12 | type: 'string',
13 | description: 'Method',
14 | },
15 | message: {
16 | type: 'string',
17 | description: 'Error message',
18 | },
19 | path: {
20 | type: 'string',
21 | description: 'Error path',
22 | },
23 | code: {
24 | type: 'string',
25 | description: 'Error code',
26 | },
27 | description: {
28 | type: 'string',
29 | description: 'Error description',
30 | },
31 | },
32 | required: ['didUrl'],
33 | description: 'Agent method arguments validation error',
34 | },
35 | },
36 | },
37 | }
38 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## What issue is this PR fixing
2 |
3 | Example:
4 | `closes #123`
5 | `fixes #456`
6 |
7 | Linking to an issue provides some context and a reason for the PR to be reviewed, as well as simplifying the release
8 | notes and changelogs that get generated automatically. If an issue is linked like this it will be automatically closed
9 | when the PR is merged.
10 |
11 | ## What is being changed
12 | A clear description of what this PR brings.
13 |
14 | ## Quality
15 | Check all that apply:
16 | * [X] I want these changes to be integrated
17 | * [ ] I successfully ran `pnpm i`, `pnpm build`, `pnpm test`, `pnpm test:browser` locally.
18 | * [ ] I allow my PR to be updated by the reviewers (to speed up the review process).
19 | * [ ] I added unit tests.
20 | * [ ] I added integration tests.
21 | * [ ] I did not add automated tests because _________, and I am aware that a PR without tests will likely get rejected.
22 |
23 | ## Details
24 | If applicable, add screen captures, error messages or stack traces to help explain your problem.
25 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/credential-ld#CredentialProviderLD | handler} for the {@link @veramo/credential-w3c#CredentialPlugin} that
3 | * implements
4 | * {@link @veramo/core-types#AbstractCredentialProvider} interface.
5 | *
6 | * This plugin adds support for working with JSON-LD credentials.
7 | * When installed, this plugin will be automatically used by
8 | * {@link @veramo/credential-w3c#CredentialPlugin | CredentialPlugin} if the user requests the credential to be signed
9 | * by one of the installed signature suites.
10 | *
11 | * @packageDocumentation
12 | */
13 | export { CredentialProviderLD } from './CredentialProviderLD.js'
14 | export * from './types.js'
15 | export { LdDefaultContexts } from './ld-default-contexts.js'
16 | export { VeramoLdSignature } from './ld-suites.js'
17 | export * from './suites/EcdsaSecp256k1RecoverySignature2020.js'
18 | export * from './suites/Ed25519Signature2018.js'
19 | export * from './suites/Ed25519Signature2020.js'
20 | export * from './suites/JsonWebSignature2020.js'
21 |
--------------------------------------------------------------------------------
/packages/credential-w3c/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a {@link @veramo/credential-w3c#CredentialPlugin | plugin} for the {@link @veramo/core#Agent} that
3 | * implements
4 | * {@link @veramo/core-types#ICredentialIssuer} interface.
5 | *
6 | * Provides a {@link @veramo/credential-w3c#W3cMessageHandler | plugin} for the
7 | * {@link @veramo/message-handler#MessageHandler} that verifies Credentials and Presentations in a message.
8 | *
9 | * @packageDocumentation
10 | */
11 | export { W3cMessageHandler, MessageTypes } from './message-handler.js'
12 | import { CredentialPlugin } from './action-handler.js'
13 |
14 | /**
15 | * @deprecated please use {@link CredentialPlugin} instead
16 | * @public
17 | */
18 | const CredentialIssuer = CredentialPlugin
19 | export { CredentialIssuer, CredentialPlugin }
20 |
21 | // For backward compatibility, re-export the plugin types that were moved to core in v4
22 | export type { ICredentialIssuer, ICredentialVerifier } from '@veramo/core-types'
23 |
24 | export { AbstractCredentialProvider } from './abstract-credential-provider.js'
--------------------------------------------------------------------------------
/packages/data-store/src/entities/service.ts:
--------------------------------------------------------------------------------
1 | import { Entity, Column, PrimaryColumn, BaseEntity, ManyToOne, Relation } from 'typeorm'
2 | import { Identifier } from './identifier.js'
3 |
4 | /**
5 | * Represents some properties of a {@link did-resolver#ServiceEndpoint | ServiceEndpoint} as it is stored in a TypeORM
6 | * database. This is used by {@link @veramo/data-store#DIDStore | DIDStore} to provide information to
7 | * {@link @veramo/did-manager#DIDManager | DIDManager} when DID management information is stored in a local TypeORM
8 | * database.
9 | *
10 | * @beta This API may change without a BREAKING CHANGE notice.
11 | */
12 | @Entity('service')
13 | export class Service extends BaseEntity {
14 | @PrimaryColumn()
15 | // @ts-ignore
16 | id: string
17 |
18 | @Column()
19 | // @ts-ignore
20 | type: string
21 |
22 | @Column()
23 | // @ts-ignore
24 | serviceEndpoint: string
25 |
26 | @Column({ nullable: true })
27 | description?: string
28 |
29 | @ManyToOne((type) => Identifier, (identifier) => identifier?.services, { onDelete: 'CASCADE' })
30 | // @ts-ignore
31 | identifier?: Relation
32 | }
33 |
--------------------------------------------------------------------------------
/packages/cli/src/server.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import { Command } from 'commander'
3 | import { getConfig } from './setup.js'
4 | import { createObjects } from './lib/objectCreator.js'
5 |
6 | const server = new Command('server')
7 | .description('Launch OpenAPI server')
8 | .option('-p, --port ', 'Optionally set port to override config')
9 | .action(async (opts: { port: number }, cmd: Command) => {
10 | const app = express()
11 |
12 | let server: any
13 |
14 | try {
15 | const config = await createObjects(await getConfig(cmd.optsWithGlobals().config), { server: '/server' })
16 | server = config.server
17 | } catch (e: any) {
18 | console.error(e.message)
19 | process.exit(1)
20 | }
21 |
22 | for (let router of server.use) {
23 | app.use(...router)
24 | if (typeof router[0] === 'string') {
25 | console.log(`Listening to route: ${server.baseUrl}${router[0]}`)
26 | }
27 | }
28 |
29 | app.listen(opts.port || server.port, async () => {
30 | console.log(`🚀 Cloud Agent ready at ${server.baseUrl}`)
31 | })
32 | })
33 |
34 | export { server }
35 |
--------------------------------------------------------------------------------
/packages/mediation-manager/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 | # [6.0.0](https://github.com/decentralized-identity/veramo/compare/v5.6.0...v6.0.0) (2024-04-02)
7 |
8 |
9 | ### Bug Fixes
10 |
11 | * **did-provider-key:** align did:key resolver to spec ([#1332](https://github.com/decentralized-identity/veramo/issues/1332)) ([8e3b94c](https://github.com/decentralized-identity/veramo/commit/8e3b94cf997619d7adcb5cb8827e0f55ff88cdb5)), closes [#1330](https://github.com/decentralized-identity/veramo/issues/1330)
12 |
13 |
14 |
15 |
16 |
17 | # [5.6.0](https://github.com/decentralized-identity/veramo/compare/v5.5.3...v5.6.0) (2024-01-16)
18 |
19 |
20 | ### Features
21 |
22 | * **remote-client:** allow dynamic headers param for AgentRestClient constructor ([#1314](https://github.com/decentralized-identity/veramo/issues/1314)) ([1b8a0a2](https://github.com/decentralized-identity/veramo/commit/1b8a0a2718dd63492ad3a312a6ebe5f6e7849935)), closes [#1313](https://github.com/decentralized-identity/veramo/issues/1313)
23 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/ld-context-loader.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * The LdContextLoader is initialized with a List of Map>
3 | * that it unifies into a single Map to provide to the documentLoader within
4 | * the w3c credential module.
5 | */
6 | import { isIterable, OrPromise, RecordLike } from '@veramo/utils'
7 | import { ContextDoc } from './types.js'
8 |
9 | export class LdContextLoader {
10 | private readonly contexts: Record>
11 |
12 | constructor(options: { contextsPaths: RecordLike>[] }) {
13 | this.contexts = {}
14 | Array.from(options.contextsPaths, (mapItem) => {
15 | const map = isIterable(mapItem) ? mapItem : Object.entries(mapItem)
16 | // generate-plugin-schema is failing unless we use the cast to `any[]`
17 | for (const [key, value] of map as any[]) {
18 | this.contexts[key] = value
19 | }
20 | })
21 | }
22 |
23 | has(url: string): boolean {
24 | return this.contexts[url] !== null && typeof this.contexts[url] !== 'undefined'
25 | }
26 |
27 | async get(url: string): Promise {
28 | return this.contexts[url]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "skipLibCheck": true
7 | },
8 | "references": [
9 | { "path": "../core" },
10 | { "path": "../core-types" },
11 | { "path": "../credential-ld" },
12 | { "path": "../credential-w3c" },
13 | { "path": "../data-store" },
14 | { "path": "../did-comm" },
15 | { "path": "../did-discovery" },
16 | { "path": "../did-jwt" },
17 | { "path": "../did-manager" },
18 | { "path": "../did-provider-ethr" },
19 | { "path": "../did-provider-jwk" },
20 | { "path": "../did-provider-key" },
21 | { "path": "../did-provider-peer" },
22 | { "path": "../did-provider-pkh" },
23 | { "path": "../did-provider-web" },
24 | { "path": "../did-resolver" },
25 | { "path": "../key-manager" },
26 | { "path": "../kms-local" },
27 | { "path": "../message-handler" },
28 | { "path": "../remote-server" },
29 | { "path": "../remote-client" },
30 | { "path": "../selective-disclosure" },
31 | { "path": "../url-handler" },
32 | { "path": "../utils" }
33 | ],
34 | "include": ["src/**/*"]
35 | }
36 |
--------------------------------------------------------------------------------
/packages/did-comm/src/types/utility-types.ts:
--------------------------------------------------------------------------------
1 | import { JWE } from 'did-jwt'
2 | import { DIDCommMessageMediaType, IDIDCommMessage } from './message-types.js'
3 |
4 | /**
5 | * Represents a plaintext DIDComm v2 message object.
6 | * @internal
7 | */
8 | export type _DIDCommPlainMessage = IDIDCommMessage & { typ: DIDCommMessageMediaType.PLAIN }
9 |
10 | /**
11 | * Represents an encrypted DIDComm v2 message object
12 | * @internal
13 | */
14 | export type _DIDCommEncryptedMessage = JWE
15 |
16 | /**
17 | * Type definition of a JSON serialized JWS in flattened form (only one signer)
18 | * @internal
19 | */
20 | export type _FlattenedJWS = {
21 | payload: string
22 | protected?: string
23 | header?: Record
24 | signature: string
25 | }
26 |
27 | /**
28 | * Type definition of a JSON serialized JWS in generic form
29 | * @internal
30 | */
31 | export type _GenericJWS = {
32 | payload: string
33 | signatures: [{ protected?: string; header?: Record; signature: string }]
34 | }
35 |
36 | /**
37 | * Composite type representing the 2 accepted forms of JWS DIDComm v2 message
38 | * @internal
39 | */
40 | export type _DIDCommSignedMessage = _FlattenedJWS | _GenericJWS
41 |
--------------------------------------------------------------------------------
/packages/cli/src/createCommand.ts:
--------------------------------------------------------------------------------
1 | import { Command } from 'commander'
2 | import module from 'module'
3 |
4 | import { config } from './config.js'
5 | import { credential } from './credential.js'
6 | import { dev } from './dev.js'
7 | import { did } from './did.js'
8 | import { discover } from './discover.js'
9 | import { execute } from './execute.js'
10 | import { message } from './message.js'
11 | import { presentation } from './presentation.js'
12 | import { explore } from './explore/index.js'
13 | import { sdr } from './sdr.js'
14 | import { server } from './server.js'
15 | import { mediate } from './mediate.js'
16 |
17 | const requireCjs = module.createRequire(import.meta.url)
18 | const { version } = requireCjs('../package.json')
19 |
20 | const veramo = new Command('veramo')
21 | .version(version, '-v, --version')
22 | .option('--config ', 'Configuration file', './agent.yml')
23 | .addCommand(config)
24 | .addCommand(credential)
25 | .addCommand(dev)
26 | .addCommand(did)
27 | .addCommand(discover)
28 | .addCommand(execute)
29 | .addCommand(explore)
30 | .addCommand(message)
31 | .addCommand(presentation)
32 | .addCommand(sdr)
33 | .addCommand(server)
34 | .addCommand(mediate)
35 |
36 | export { veramo }
37 |
--------------------------------------------------------------------------------
/packages/cli/src/explore/utils.ts:
--------------------------------------------------------------------------------
1 | import { formatDistanceToNow } from 'date-fns'
2 | import os from 'os'
3 |
4 | export function shortDid(did?: string): string {
5 | if (!did) return ''
6 | did = did.replace(/\?.*$/, '')
7 | if (did.slice(0, 7) === 'did:web') {
8 | return did
9 | }
10 | return did.slice(0, did.lastIndexOf(':')) + '..' + did.slice(-4)
11 | }
12 |
13 | export function shortDate(date?: string): string {
14 | if (!date) return ''
15 | return formatDistanceToNow(new Date(date))
16 | }
17 |
18 | // return true if copy worked, false otherwise
19 | export function copyToClipboard(text: string): boolean {
20 | /**
21 | * There's probably a better way than spawning. We tried and failed at the following:
22 | * - screen.copyToClipboard didn't do anything (and is iTerm2-specific, anyway)
23 | * - clipboardy wouldn't run due to error "Must use import to load ES Module" (even though we used import)
24 | */
25 | if (os.platform() === 'darwin') {
26 | const proc = require('child_process').spawn('pbcopy')
27 | proc.stdin.write(text)
28 | proc.stdin.end()
29 | return true
30 | } else if (os.platform() === 'win32') {
31 | require('child_process').spawn('clip').stdin.end(text)
32 | return true
33 | }
34 | return false
35 | }
36 |
--------------------------------------------------------------------------------
/packages/did-manager/src/did-discovery-provider.ts:
--------------------------------------------------------------------------------
1 | import { IAgentContext, IDIDManager } from '@veramo/core-types'
2 | import {
3 | AbstractDidDiscoveryProvider,
4 | IDIDDiscoverMatch,
5 | IDIDDiscoveryProviderResult,
6 | IDIDDiscoveryDiscoverDidArgs,
7 | } from '@veramo/did-discovery'
8 |
9 | /**
10 | * A DID discovery provider that can filter DIDs by the `alias` used internally in
11 | * {@link @veramo/did-manager#DIDManager | DIDManager}
12 | *
13 | * @beta This API may change without a BREAKING CHANGE notice.
14 | */
15 | export class AliasDiscoveryProvider implements AbstractDidDiscoveryProvider {
16 | readonly name = 'alias'
17 |
18 | async discoverDid(
19 | args: IDIDDiscoveryDiscoverDidArgs,
20 | context: IAgentContext,
21 | ): Promise {
22 | const matches = []
23 | try {
24 | const identifier = await context.agent.didManagerGetByAlias({ alias: args.query })
25 | const match: IDIDDiscoverMatch = {
26 | did: identifier.did,
27 | metaData: {
28 | alias: identifier.alias,
29 | },
30 | }
31 | matches.push(match)
32 | } catch (e) {
33 | }
34 |
35 | return {
36 | provider: this.name,
37 | matches,
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/packages/cli/src/message.ts:
--------------------------------------------------------------------------------
1 | import { getAgent } from './setup.js'
2 | import { Command } from 'commander'
3 | import fs from 'fs'
4 |
5 | const message = new Command('message').description('Messages')
6 |
7 | message
8 | .command('handle', { isDefault: true })
9 | .description('Handle raw message ')
10 | .option('-r, --raw ', 'String containing raw message')
11 | .option('-f, --file ', 'Path to a file containing raw message')
12 | .option('--save ', 'Save message', true)
13 |
14 | .action(async (options: { file: string; raw: string; save: boolean }, cmd: Command) => {
15 | const agent = await getAgent(cmd.optsWithGlobals().config)
16 | try {
17 | let raw
18 |
19 | if (options.file) {
20 | raw = fs.readFileSync(options.file).toString()
21 | } else if (options.raw) {
22 | raw = options.raw
23 | } else {
24 | throw Error('Missing file path or raw string')
25 | }
26 |
27 | const message = await agent.handleMessage({
28 | raw,
29 | metaData: [{ type: 'cli' }],
30 | save: options.save,
31 | })
32 |
33 | console.dir(message, { depth: 10 })
34 | } catch (e: any) {
35 | console.error(e.message)
36 | }
37 | })
38 |
39 | export { message }
40 |
--------------------------------------------------------------------------------
/jest.config.mjs:
--------------------------------------------------------------------------------
1 | import { defaults } from 'jest-config'
2 |
3 | // @type {import('jest-config').InitialOptions}
4 | const config = {
5 | rootDir: './',
6 | moduleFileExtensions: [...defaults.moduleFileExtensions, 'mts'],
7 | collectCoverage: false,
8 | collectCoverageFrom: [
9 | 'packages/**/src/**/*.ts',
10 | '!**/examples/**',
11 | '!packages/cli/**',
12 | '!**/types/**',
13 | '!**/build/**',
14 | '!**/node_modules/**',
15 | '!packages/test-react-app/**',
16 | '!packages/test-utils/**',
17 | ],
18 | coverageReporters: ['json'],
19 | coverageDirectory: './coverage',
20 | coverageProvider: 'v8',
21 | testMatch: ['**/__tests__/**/*.test.ts'],
22 | automock: false,
23 | // // typescript 5 removes the need to specify relative imports as .js, so we should no longer need this workaround
24 | // // but webpack still requires .js specifiers, so we are keeping it for now
25 | moduleNameMapper: {
26 | '^(\\.{1,2}/.*)\\.js$': '$1',
27 | },
28 | transform: {
29 | '^.+\\.m?tsx?$': [
30 | 'ts-jest',
31 | {
32 | useESM: true,
33 | tsconfig: './packages/tsconfig.settings.json',
34 | },
35 | ],
36 | },
37 | extensionsToTreatAsEsm: ['.ts'],
38 | testEnvironment: 'node',
39 | }
40 |
41 | export default config
42 |
--------------------------------------------------------------------------------
/packages/data-store/src/migrations/2.simplifyRelations.ts:
--------------------------------------------------------------------------------
1 | import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'
2 | import { migrationGetExistingTableByName } from './migration-functions.js'
3 | import { PreMigrationKey } from '../entities/PreMigrationEntities.js'
4 |
5 | /**
6 | * Fix inconsistencies between Entity data and column data.
7 | *
8 | * @public
9 | */
10 | export class SimplifyRelations1447159020002 implements MigrationInterface {
11 |
12 | name = 'SimplifyRelations1447159020002' // Used in case this class gets minified, which would change the classname
13 |
14 | async up(queryRunner: QueryRunner): Promise {
15 | await queryRunner.changeColumn(
16 | migrationGetExistingTableByName(queryRunner, 'PreMigrationKey', true),
17 | 'identifierDid',
18 | new TableColumn({ name: 'identifierDid', type: 'varchar', isNullable: true }),
19 | )
20 | await queryRunner.changeColumn(
21 | migrationGetExistingTableByName(queryRunner, 'service'),
22 | 'identifierDid',
23 | new TableColumn({ name: 'identifierDid', type: 'varchar', isNullable: true }),
24 | )
25 |
26 | }
27 |
28 | async down(queryRunner: QueryRunner): Promise {
29 | throw new Error('illegal_operation: cannot roll back initial migration')
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/packages/message-handler/src/__tests__/default.test.ts:
--------------------------------------------------------------------------------
1 | import { IAgentContext, IMessageHandler } from '../../../core-types/src'
2 | import { createAgent } from '../../../core/src'
3 | import { MessageHandler } from '../message-handler.js'
4 | import { jest } from '@jest/globals'
5 | import { AbstractMessageHandler } from "../abstract-message-handler.js";
6 | import { Message } from "../message.js";
7 |
8 | jest.setTimeout(60000)
9 |
10 | class DummyHandler extends AbstractMessageHandler {
11 | async handle(message: Message, context: IAgentContext<{}>): Promise {
12 | return super.handle(message, context)
13 | }
14 | }
15 |
16 | describe('@veramo/message-handler', () => {
17 | const a = 100
18 | it('should run a dummy test', () => {
19 | expect(a).toEqual(100)
20 | })
21 |
22 | let agent = createAgent({
23 | plugins: [
24 | new MessageHandler({
25 | messageHandlers: [new DummyHandler()],
26 | }),
27 | ],
28 | })
29 |
30 | it('should reject unknown message', async () => {
31 | expect.assertions(1)
32 | const raw = 'some message of unknown format'
33 | await expect(agent.handleMessage({ raw, save: false, metaData: [{ type: 'test' }] })).rejects.toThrow(
34 | 'Unsupported message type',
35 | )
36 | })
37 | })
38 |
--------------------------------------------------------------------------------
/packages/cli/README.md:
--------------------------------------------------------------------------------
1 | # Veramo command line interface
2 |
3 | ## Install CLI
4 |
5 | ```
6 | npm -g i @veramo/cli
7 | ```
8 |
9 | ## Usage
10 |
11 | ```
12 | Usage: veramo [options] [command]
13 |
14 | Options:
15 | -v, --version output the version number
16 | --config Configuration file (default: "./agent.yml")
17 | -h, --help display help for command
18 |
19 | Commands:
20 | did Decentralized identifiers
21 | credential W3C Verifiable Credential
22 | presentation W3C Verifiable Presentation
23 | explore launch Verifiable Data explorer
24 | sdr Selective Disclosure Request
25 | message Messages
26 | execute [options] Executes agent method
27 | server [options] Launch OpenAPI server
28 | config Agent configuration
29 | dev Plugin developer tools
30 | help [command] display help for command
31 | ```
32 |
33 | ## Developing
34 |
35 | When developing in this package, take care to call the local veramo CLI package, rather than the globally installed one.
36 |
37 | For example, rather than doing this:
38 |
39 | ```
40 | veramo credential create
41 | ```
42 |
43 | you will need to do this:
44 |
45 | ```
46 | yarn build
47 | yarn veramo credential create
48 | ```
49 |
--------------------------------------------------------------------------------
/packages/did-comm/README.md:
--------------------------------------------------------------------------------
1 | # Veramo DIDComm
2 |
3 | Veramo messaging plugin implementing DIDComm v2, as specified by the [DIDComm v2 Spec](https://identity.foundation/didcomm-messaging/spec/) as well as certain "DIDComm Protocols"
4 |
5 | ## Spec Compliance
6 |
7 | ### [Message Formats](https://identity.foundation/didcomm-messaging/spec/#message-formats)
8 |
9 | Message Envelopes:
10 |
11 | | Envelope | Veramo 'packing' | IANA type (`typ`) | packDIDCommMessage | unpackDIDCommMessage | notes |
12 | | -------- | ---------------- | ----------------- | ------------------ | -------------------- | -------------------- |
13 | | plaintext | 'none' | `application/didcomm-plain+json` | [X] | [X] | |
14 | | signed(plaintext) | 'jws' | `application/didcomm-signed+json` | [X] | [X] | |
15 | | anoncrypt(plaintext) | 'anoncrypt' | `application/didcomm-encrypted+json` | [X] | [X] | |
16 | | authcrypt(plaintext) | 'authcrypt' | `application/didcomm-encrypted+json` | [X] | [X] | |
17 | | anoncrypt(sign(plaintext)) | 'anoncrypt+jws' | `application/didcomm-encrypted+json` | [ ] | [ ] | |
18 | | authcrypt(sign(plaintext)) | 'authcrypt+jws' | `application/didcomm-encrypted+json` | [ ] | [ ] | SHOULD NOT be emitted, but MAY be accepted |
19 | | anoncryptauthcrypt((sign(plaintext))) | '' | `application/didcomm-encrypted+json` | [ ] | [ ] | |
20 |
21 |
--------------------------------------------------------------------------------
/packages/core-types/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides {@link @veramo/core#Agent} implementation and defines {@link @veramo/core-types#IResolver},
3 | * {@link @veramo/core-types#IDIDManager}, {@link @veramo/core-types#IKeyManager}, {@link
4 | * @veramo/core-types#IDataStore}, {@link @veramo/core-types#IMessageHandler} plugin interfaces
5 | *
6 | * @packageDocumentation
7 | */
8 |
9 | export { CoreEvents } from './coreEvents.js'
10 | export * from './agent.js'
11 | export * from './types/IAgent.js'
12 | export * from './types/ICredentialPlugin.js'
13 | export * from './types/ICredentialIssuer.js'
14 | export * from './types/ICredentialVerifier.js'
15 | export * from './types/ICredentialStatus.js'
16 | export * from './types/ICredentialStatusManager.js'
17 | export * from './types/ICredentialStatusVerifier.js'
18 | export * from './types/IDataStore.js'
19 | export * from './types/IDataStoreORM.js'
20 | export * from './types/IIdentifier.js'
21 | export * from './types/IDIDManager.js'
22 | export * from './types/IKeyManager.js'
23 | export * from './types/IMessage.js'
24 | export * from './types/IMessageHandler.js'
25 | export * from './types/IResolver.js'
26 | export * from './types/IError.js'
27 | export * from './types/IVerifyResult.js'
28 | export * from './types/vc-data-model.js'
29 | export { schema } from './plugin.schema.js'
30 |
--------------------------------------------------------------------------------
/packages/did-provider-ion/src/ion-did-resolver.ts:
--------------------------------------------------------------------------------
1 | import { fetch } from 'cross-fetch'
2 | import { IIdentifier } from '@veramo/core-types'
3 | import { DIDResolutionOptions, DIDResolutionResult, DIDResolver } from 'did-resolver'
4 | import { IonDidForm } from './types/ion-provider-types.js'
5 |
6 | export const resolveDidIonFromIdentifier = async (
7 | identifier: IIdentifier,
8 | ionDidForm: IonDidForm = IonDidForm.LONG,
9 | options?: DIDResolutionOptions
10 | ): Promise => {
11 | return await resolve(ionDidForm == IonDidForm.LONG ? identifier.did : identifier.alias!, options)
12 | }
13 |
14 | export const resolveDidIon: DIDResolver = async (didUrl: string, options?: DIDResolutionOptions): Promise => {
15 | return resolve(didUrl, options)
16 | }
17 |
18 | const resolve = async (didUrl: string, options?: DIDResolutionOptions) => {
19 | return fetch(
20 | (options?.nodeEndpoint || 'https://beta.discover.did.microsoft.com/1.0/identifiers/') + didUrl,
21 | ).then(async (response) => {
22 | if (response.status >= 400) {
23 | throw new Error(`Not Found:\r\n${didUrl}\r\n${JSON.stringify(await response.json())}`)
24 | }
25 | return response.json()
26 | })
27 | }
28 |
29 | /**
30 | * @public
31 | */
32 | export function getDidIonResolver() {
33 | return { ion: resolveDidIon }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/test-react-app/src/test-utils/ethers-provider.ts:
--------------------------------------------------------------------------------
1 | import { BrowserProvider, Eip1193Provider, Wallet } from 'ethers'
2 |
3 | export function createEthersProvider(): BrowserProvider {
4 | const privateKeyHex = '0x1da6847600b0ee25e9ad9a52abbd786dd2502fa4005dd5af9310b7cc7a3b25db'
5 | const wallet = new Wallet(privateKeyHex)
6 | const mockProvider = new MockWeb3Provider(wallet)
7 | const provider = new BrowserProvider(mockProvider)
8 | return provider
9 | }
10 |
11 | class MockWeb3Provider implements Eip1193Provider {
12 | constructor(private wallet: Wallet) {}
13 |
14 | async request(request: { method: string; params?: any[] }): Promise {
15 |
16 | switch(request.method) {
17 | case 'personal_sign':
18 | // @ts-ignore
19 | return this.wallet.signMessage(request.params[1])
20 | break
21 | case 'eth_signTypedData_v4':
22 | // @ts-ignore
23 | const {domain, types, message} = JSON.parse(request.params[1])
24 | delete(types.EIP712Domain)
25 | return this.wallet.signTypedData(domain, types, message)
26 | case 'eth_accounts':
27 | return [await this.wallet.getAddress()]
28 | case 'eth_chainId':
29 | return "1337"
30 | break
31 | default:
32 | throw Error(`not_available: method ${request.method}`)
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/did-manager/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-manager",
3 | "description": "Veramo DID manager plugin",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/did-discovery": "workspace:^"
15 | },
16 | "devDependencies": {
17 | "typescript": "5.7.3"
18 | },
19 | "files": [
20 | "build/**/*",
21 | "src/**/*",
22 | "README.md",
23 | "LICENSE"
24 | ],
25 | "publishConfig": {
26 | "access": "public"
27 | },
28 | "repository": {
29 | "type": "git",
30 | "url": "https://github.com/decentralized-identity/veramo.git",
31 | "directory": "packages/did-manager"
32 | },
33 | "author": "Consensys Mesh R&D ",
34 | "contributors": [
35 | "Simonas Karuzas ",
36 | "Mircea Nistor "
37 | ],
38 | "keywords": [
39 | "Veramo",
40 | "DID",
41 | "Verifiable Credential",
42 | "veramo-plugin",
43 | "DID Manager",
44 | "aggregator"
45 | ],
46 | "license": "Apache-2.0",
47 | "type": "module",
48 | "moduleDirectories": [
49 | "node_modules",
50 | "src"
51 | ]
52 | }
53 |
--------------------------------------------------------------------------------
/packages/test-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/test-utils",
3 | "private": true,
4 | "description": "Helper methods for Veramo integration tests. This package is not meant to be used in production.",
5 | "version": "6.0.0",
6 | "main": "build/index.js",
7 | "exports": "./build/index.js",
8 | "types": "build/index.d.ts",
9 | "scripts": {
10 | "build": "tsc"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:*",
14 | "@veramo/did-discovery": "workspace:*",
15 | "@veramo/did-manager": "workspace:*",
16 | "@veramo/utils": "workspace:*",
17 | "did-resolver": "^4.1.0"
18 | },
19 | "devDependencies": {
20 | "typescript": "5.7.3"
21 | },
22 | "files": [
23 | "build/**/*",
24 | "src/**/*",
25 | "README.md",
26 | "LICENSE"
27 | ],
28 | "publishConfig": {
29 | "access": "public"
30 | },
31 | "repository": {
32 | "type": "git",
33 | "url": "https://github.com/decentralized-identity/veramo.git",
34 | "directory": "packages/test-utils"
35 | },
36 | "author": "Consensys Mesh R&D ",
37 | "contributors": [
38 | "Mircea Nistor "
39 | ],
40 | "license": "Apache-2.0",
41 | "keywords": [
42 | "Veramo",
43 | "test",
44 | "jest",
45 | "util"
46 | ],
47 | "type": "module",
48 | "moduleDirectories": [
49 | "node_modules",
50 | "src"
51 | ]
52 | }
53 |
--------------------------------------------------------------------------------
/packages/data-store/src/migrations/index.ts:
--------------------------------------------------------------------------------
1 | import { MigrationInterface } from 'typeorm'
2 | import { CreateDatabase1447159020001 } from './1.createDatabase.js'
3 | import { SimplifyRelations1447159020002 } from './2.simplifyRelations.js'
4 | import { CreatePrivateKeyStorage1629293428674 } from './3.createPrivateKeyStorage.js'
5 | import { AllowNullIssuanceDateForPresentations1637237492913 } from './4.allowNullVPIssuanceDate.js'
6 |
7 | /**
8 | * Allow others to use shared migration functions if they extend Veramo
9 | *
10 | * @public
11 | */
12 | export * from './migration-functions.js'
13 |
14 | /**
15 | * The migrations array that SHOULD be used when initializing a TypeORM database connection.
16 | *
17 | * These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
18 | *
19 | * @public
20 | */
21 | export const migrations = [
22 | CreateDatabase1447159020001,
23 | SimplifyRelations1447159020002,
24 | CreatePrivateKeyStorage1629293428674,
25 | AllowNullIssuanceDateForPresentations1637237492913,
26 | ]
27 |
28 | /**
29 | * The migrations helper that allows migrations from multiple sources to be combined into a single array.
30 | *
31 | * @public
32 | */
33 | export function migrationConcat(...migrationArrays: MigrationInterface[][]) {
34 | return migrationArrays.reduce((acc, migrationArray) => acc.concat(migrationArray), [])
35 | }
36 |
--------------------------------------------------------------------------------
/packages/message-handler/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/message-handler",
3 | "description": "Message Handler plugin for Veramo",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "debug": "^4.3.4"
15 | },
16 | "devDependencies": {
17 | "@types/debug": "4.1.8",
18 | "typescript": "5.7.3"
19 | },
20 | "files": [
21 | "build/**/*",
22 | "src/**/*",
23 | "README.md",
24 | "LICENSE"
25 | ],
26 | "publishConfig": {
27 | "access": "public"
28 | },
29 | "repository": {
30 | "type": "git",
31 | "url": "https://github.com/decentralized-identity/veramo.git",
32 | "directory": "packages/message-handler"
33 | },
34 | "author": "Consensys Mesh R&D ",
35 | "contributors": [
36 | "Simonas Karuzas ",
37 | "Mircea Nistor "
38 | ],
39 | "keywords": [
40 | "Veramo",
41 | "DID",
42 | "Verifiable Credential",
43 | "veramo-plugin",
44 | "aggregator",
45 | "messaging",
46 | "DIDComm"
47 | ],
48 | "license": "Apache-2.0",
49 | "type": "module",
50 | "moduleDirectories": [
51 | "node_modules",
52 | "src"
53 | ]
54 | }
55 |
--------------------------------------------------------------------------------
/packages/remote-server/src/request-agent-router.ts:
--------------------------------------------------------------------------------
1 | import { IAgent } from '@veramo/core-types'
2 | import { Request, Router } from 'express'
3 |
4 | export interface RequestWithAgent extends Request {
5 | agent?: IAgent
6 | }
7 |
8 | /**
9 | * @public
10 | */
11 | export interface RequestWithAgentRouterOptions {
12 | /**
13 | * Optional. Pre-configured agent
14 | */
15 | agent?: IAgent
16 |
17 | /**
18 | * Optional. Function that returns a Promise that resolves to a configured agent for specific request
19 | */
20 | getAgentForRequest?: (req: Request) => Promise
21 | }
22 |
23 | /**
24 | * Creates an expressjs router that adds a Veramo agent to the request object.
25 | *
26 | * This is needed by all other routers provided by this package to be able to perform their functions.
27 | *
28 | * @param options - Initialization option
29 | * @returns Expressjs router
30 | *
31 | * @public
32 | */
33 | export const RequestWithAgentRouter = (options: RequestWithAgentRouterOptions): Router => {
34 | const router = Router()
35 | router.use(async (req: RequestWithAgent, res, next) => {
36 | if (options.agent) {
37 | req.agent = options.agent
38 | } else if (options.getAgentForRequest) {
39 | req.agent = await options.getAgentForRequest(req)
40 | } else {
41 | throw Error('[RequestWithAgentRouter] agent or getAgentForRequest is required')
42 | }
43 | next()
44 | })
45 |
46 | return router
47 | }
48 |
--------------------------------------------------------------------------------
/packages/core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/core",
3 | "description": "Veramo Core Logic & Interfaces.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": {
7 | ".": "./build/index.js"
8 | },
9 | "types": "build/index.d.ts",
10 | "scripts": {
11 | "build": "tsc",
12 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
13 | },
14 | "dependencies": {
15 | "@veramo/core-types": "workspace:^",
16 | "debug": "^4.3.4",
17 | "events": "^3.2.0",
18 | "z-schema": "^6.0.1"
19 | },
20 | "devDependencies": {
21 | "@types/debug": "4.1.8",
22 | "@types/events": "3.0.0",
23 | "typescript": "5.7.3"
24 | },
25 | "files": [
26 | "build/**/*",
27 | "src/**/*",
28 | "README.md",
29 | "LICENSE"
30 | ],
31 | "publishConfig": {
32 | "access": "public"
33 | },
34 | "repository": {
35 | "type": "git",
36 | "url": "https://github.com/decentralized-identity/veramo.git",
37 | "directory": "packages/core"
38 | },
39 | "author": "Consensys Mesh R&D ",
40 | "contributors": [
41 | "Simonas Karuzas ",
42 | "Mircea Nistor "
43 | ],
44 | "keywords": [
45 | "Veramo",
46 | "DID",
47 | "Verifiable Credential",
48 | "plugin host"
49 | ],
50 | "license": "Apache-2.0",
51 | "type": "module",
52 | "moduleDirectories": [
53 | "node_modules",
54 | "src"
55 | ]
56 | }
57 |
--------------------------------------------------------------------------------
/__tests__/fixtures/cred1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "http://example.com/credentials/3527",
3 | "name": "begd",
4 | "type": [
5 | "VerifiableCredential",
6 | "OpenBadgeCredential"
7 | ],
8 | "proof": {
9 | "type": "Ed25519Signature2020",
10 | "created": "2023-02-11T02:40:43.841Z",
11 | "@context": [
12 | "https://w3id.org/security/suites/ed25519-2020/v1"
13 | ],
14 | "proofValue": "z3JLZ5fbUY4J4XyaaVhTyHaC5djPHKVgGYKF8necUHJhZi1Z9aNFvittgA5NkQ3obbVj5DiAD4GwfyxtSovBnWVAt",
15 | "proofPurpose": "assertionMethod",
16 | "verificationMethod": "did:key:z6MkqqPLdAy3mL5JFHEBmpuj7NjTEPnMifr2kz83XsbbgkyY#z6MkqqPLdAy3mL5JFHEBmpuj7NjTEPnMifr2kz83XsbbgkyY"
17 | },
18 | "issuer": "did:key:z6MkqqPLdAy3mL5JFHEBmpuj7NjTEPnMifr2kz83XsbbgkyY",
19 | "@context": [
20 | "https://www.w3.org/2018/credentials/v1",
21 | "https://purl.imsglobal.org/spec/ob/v3p0/context.json"
22 | ],
23 | "issuanceDate": "2023-02-11T02:40:43.832Z",
24 | "credentialSubject": {
25 | "id": "did:key:z6MkqqPLdAy3mL5JFHEBmpuj7NjTEPnMifr2kz83XsbbgkyY",
26 | "type": [
27 | "AchievementSubject"
28 | ],
29 | "achievement": {
30 | "id": "https://example.com/achievements/21st-century-skills/teamwork",
31 | "name": "begd",
32 | "type": [
33 | "Achievement"
34 | ],
35 | "criteria": {
36 | "narrative": "hcgij"
37 | },
38 | "description": "ghfh",
39 | "achievementType": "License"
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/packages/did-discovery/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-discovery",
3 | "description": "Veramo DID discovery plugin",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": {
7 | ".": "./build/index.js"
8 | },
9 | "types": "build/index.d.ts",
10 | "scripts": {
11 | "build": "tsc",
12 | "generate-plugin-schema": "node ../cli/bin/veramo.js dev generate-plugin-schema"
13 | },
14 | "veramo": {
15 | "pluginInterfaces": {
16 | "IDIDDiscovery": "./src/types.ts"
17 | }
18 | },
19 | "dependencies": {
20 | "@veramo/core-types": "workspace:^",
21 | "debug": "^4.3.3"
22 | },
23 | "devDependencies": {
24 | "@types/debug": "4.1.8",
25 | "typescript": "5.7.3"
26 | },
27 | "files": [
28 | "build/**/*",
29 | "src/**/*",
30 | "README.md",
31 | "LICENSE"
32 | ],
33 | "publishConfig": {
34 | "access": "public"
35 | },
36 | "repository": {
37 | "type": "git",
38 | "url": "https://github.com/decentralized-identity/veramo.git",
39 | "directory": "packages/did-discovery"
40 | },
41 | "author": "Consensys Mesh R&D ",
42 | "contributors": [
43 | "Simonas Karuzas ",
44 | "Mircea Nistor ",
45 | "Oliver Terbu"
46 | ],
47 | "keywords": [
48 | "Veramo",
49 | "DID",
50 | "Verifiable Credential",
51 | "veramo-plugin"
52 | ],
53 | "license": "Apache-2.0",
54 | "type": "module"
55 | }
56 |
--------------------------------------------------------------------------------
/packages/credential-jwt/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/credential-jwt",
3 | "description": "Veramo plugin for working with JWT Verifiable Credentials & Presentations.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": {
7 | ".": "./build/index.js"
8 | },
9 | "types": "build/index.d.ts",
10 | "scripts": {
11 | "build": "tsc",
12 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
13 | },
14 | "dependencies": {
15 | "@veramo/credential-w3c": "workspace:^",
16 | "@veramo/core-types": "workspace:^",
17 | "@veramo/utils": "workspace:^",
18 | "canonicalize": "^2.0.0",
19 | "debug": "^4.3.3",
20 | "did-jwt-vc": "^4.0.0"
21 | },
22 | "devDependencies": {
23 | "@types/debug": "4.1.8",
24 | "typescript": "5.7.3"
25 | },
26 | "files": [
27 | "build/**/*",
28 | "src/**/*",
29 | "README.md",
30 | "LICENSE"
31 | ],
32 | "publishConfig": {
33 | "access": "public"
34 | },
35 | "repository": {
36 | "type": "git",
37 | "url": "https://github.com/decentralized-identity/veramo.git",
38 | "directory": "packages/credential-jwt"
39 | },
40 | "author": "Nick Reynolds ",
41 | "keywords": [
42 | "Veramo",
43 | "DID",
44 | "Verifiable Credential",
45 | "JWT",
46 | "veramo-plugin"
47 | ],
48 | "license": "Apache-2.0",
49 | "type": "module",
50 | "moduleDirectories": [
51 | "node_modules",
52 | "src"
53 | ]
54 | }
--------------------------------------------------------------------------------
/AWESOME.md:
--------------------------------------------------------------------------------
1 | # Awesome list of awesome Veramo projects
2 |
3 | This is a list of projects using or enhancing the Veramo framework. This is meant to help discover interesting projects.
4 | Please help us improve the contents or format of this list by creating a pull request.
5 |
6 | ## Projects
7 |
8 | * [Sphereon SSI SDK](https://github.com/Sphereon-Opensource/ssi-sdk)
9 | * [Data Manager plugin](https://github.com/blockchain-lab-um/masca/tree/develop/packages/datamanager)
10 | * [SSI using Metamask snap (Masca)](https://masca.io/)
11 | * [SSI using Metamask snap (Identify)](https://github.com/tuum-tech/identify/tree/main/packages/snap)
12 | * [OID4VC issuer and verifier](https://github.com/blockchain-lab-um/oid4vc-monorepo)
13 | * [Plugin for did:cheqd](https://github.com/cheqd/did-provider-cheqd)
14 | * [Spherity VC revocation plugin based on ethereum](https://github.com/spherity/ethr-revocation-registry-veramo-plugin)
15 | * [BBS+ issuer](https://github.com/pcibraro/veramo-bls-issuer/tree/main)
16 | * [RN app with credential signing](https://github.com/symfoni/identity-wallet)
17 | * [ID Pocket digital identity wallet](https://rktechworks.com/idpocket)
18 | * [Spherity Aries RFCs Veramo Plugin](https://github.com/spherity/aries-rfcs-veramo-plugin)
19 | * add your own project here!
20 |
21 | ## Disclaimer
22 |
23 | The compatibility of these projects with the latest version of Veramo is not guaranteed.
24 | This list does not represent an endorsement of quality or security of these projects.
25 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/__tests__/context.loader.test.ts:
--------------------------------------------------------------------------------
1 | import { ContextDoc } from '../types.js'
2 | import { LdContextLoader } from '../ld-context-loader.js'
3 | import { LdDefaultContexts } from '../ld-default-contexts.js'
4 |
5 | describe('credential-ld context loader', () => {
6 | const customContext: Record = {
7 | 'https://example.com/custom/context': {
8 | '@context': {
9 | '@version': 1.1,
10 | id: '@id',
11 | type: '@type',
12 | nothing: 'https://example.com/nothing',
13 | },
14 | },
15 | }
16 |
17 | it('loads custom context from record', async () => {
18 | expect.assertions(2)
19 | const loader = new LdContextLoader({ contextsPaths: [customContext] })
20 | expect(loader.has('https://example.com/custom/context')).toBe(true)
21 | await expect(loader.get('https://example.com/custom/context')).resolves.toEqual({
22 | '@context': {
23 | '@version': 1.1,
24 | id: '@id',
25 | type: '@type',
26 | nothing: 'https://example.com/nothing',
27 | },
28 | })
29 | })
30 |
31 | it('loads context from default map', async () => {
32 | expect.assertions(2)
33 | const loader = new LdContextLoader({ contextsPaths: [LdDefaultContexts] })
34 | expect(loader.has('https://www.w3.org/2018/credentials/v1')).toBe(true)
35 |
36 | const credsContext = await loader.get('https://www.w3.org/2018/credentials/v1')
37 | expect(credsContext['@context']).toBeDefined()
38 | })
39 | })
40 |
--------------------------------------------------------------------------------
/__tests__/shared/credentialInterop.ts:
--------------------------------------------------------------------------------
1 | // noinspection ES6PreferShortImport
2 |
3 | import {
4 | ICredentialPlugin,
5 | IDataStore,
6 | IDataStoreORM,
7 | IDIDManager,
8 | TAgent,
9 | } from '../../packages/core-types/src'
10 |
11 | import * as fs from 'fs'
12 |
13 | type ConfiguredAgent = TAgent
14 |
15 | export default (testContext: {
16 | getAgent: () => ConfiguredAgent
17 | setup: () => Promise
18 | tearDown: () => Promise
19 | }) => {
20 | describe('credential interop', () => {
21 | let agent: ConfiguredAgent
22 |
23 | beforeAll(async () => {
24 | await testContext.setup()
25 | agent = testContext.getAgent()
26 | })
27 | afterAll(testContext.tearDown)
28 |
29 | test.each([
30 | // ['cred1.json'], // problem with context parsing (https://github.com/transmute-industries/verifiable-data/issues/238). Fixing that leads to unsupported key type "undefined"
31 | // ['cred2.json'], // non-standard EIP712 spec implementation
32 | ['cred3.json'],
33 | // ['cred4.json'], // expired
34 | ])("should verify credential from the wild: '%s'", async (text) => {
35 | let credential = (await fs.promises.readFile(`./__tests__/fixtures/${text}`, 'utf8')).toString()
36 | credential = JSON.parse(credential)
37 |
38 | const result = await agent.verifyCredential({ credential, fetchRemoteContexts: true })
39 | expect(result.verified).toBe(true)
40 | })
41 | })
42 | }
43 |
--------------------------------------------------------------------------------
/packages/kms-web3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/kms-web3",
3 | "description": "Veramo KMS implementation backed by web3 wallets",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/key-manager": "workspace:^",
15 | "debug": "^4.3.3",
16 | "ethers": "^6.13.4"
17 | },
18 | "devDependencies": {
19 | "@types/debug": "4.1.8",
20 | "typescript": "5.7.3"
21 | },
22 | "files": [
23 | "build/**/*",
24 | "src/**/*",
25 | "README.md",
26 | "LICENSE"
27 | ],
28 | "publishConfig": {
29 | "access": "public"
30 | },
31 | "repository": {
32 | "type": "git",
33 | "url": "https://github.com/decentralized-identity/veramo.git",
34 | "directory": "packages/kms-web3"
35 | },
36 | "author": "Consensys Mesh R&D ",
37 | "contributors": [
38 | "Simonas Karuzas ",
39 | "Mircea Nistor "
40 | ],
41 | "keywords": [
42 | "Veramo",
43 | "DID",
44 | "Verifiable Credential",
45 | "veramo-plugin",
46 | "KMS",
47 | "web3",
48 | "ethereum",
49 | "wallet"
50 | ],
51 | "license": "Apache-2.0",
52 | "type": "module",
53 | "moduleDirectories": [
54 | "node_modules",
55 | "src"
56 | ]
57 | }
58 |
--------------------------------------------------------------------------------
/packages/remote-client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/remote-client",
3 | "description": "A remote client plugin for Veramo. Call the methods of a remote agent locally",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "cross-fetch": "^4.0.0",
15 | "debug": "^4.3.3",
16 | "openapi-types": "12.1.3"
17 | },
18 | "devDependencies": {
19 | "@types/debug": "4.1.8",
20 | "typescript": "5.7.3"
21 | },
22 | "files": [
23 | "build/**/*",
24 | "src/**/*",
25 | "README.md",
26 | "LICENSE"
27 | ],
28 | "publishConfig": {
29 | "access": "public"
30 | },
31 | "repository": {
32 | "type": "git",
33 | "url": "https://github.com/decentralized-identity/veramo.git",
34 | "directory": "packages/remote-client"
35 | },
36 | "author": "Consensys Mesh R&D ",
37 | "contributors": [
38 | "Simonas Karuzas ",
39 | "Mircea Nistor "
40 | ],
41 | "keywords": [
42 | "Veramo",
43 | "DID",
44 | "Verifiable Credential",
45 | "veramo-plugin",
46 | "remote",
47 | "OpenAPI"
48 | ],
49 | "license": "Apache-2.0",
50 | "type": "module",
51 | "moduleDirectories": [
52 | "node_modules",
53 | "src"
54 | ]
55 | }
56 |
--------------------------------------------------------------------------------
/packages/core-types/src/agent.ts:
--------------------------------------------------------------------------------
1 | import { IAgentPlugin, IPluginMethodMap } from "./types/IAgent.js"
2 |
3 | /**
4 | * Agent configuration options.
5 | *
6 | * This interface is used to describe the constellation of plugins that this agent
7 | * will use and provide.
8 | *
9 | * You will use this to attach plugins, to setup overrides for their methods and to
10 | * explicitly set the methods that this agent instance is allowed to call.
11 | * This permissioning method is also used for internal calls made by plugin code.
12 | *
13 | * @public
14 | */
15 | export interface IAgentOptions {
16 | /**
17 | * The array of agent plugins
18 | */
19 | plugins?: IAgentPlugin[]
20 |
21 | /**
22 | * The map of plugin methods. Can be used to override methods provided by plugins,
23 | * or to add additional methods without writing a plugin
24 | */
25 | overrides?: IPluginMethodMap
26 |
27 | /**
28 | * The array of method names that will be exposed by the agent
29 | */
30 | authorizedMethods?: string[]
31 |
32 | /**
33 | * The context object that will be available to the plugin methods
34 | *
35 | * @example
36 | * ```typescript
37 | * {
38 | * authorizedDid: 'did:example:123'
39 | * }
40 | * ```
41 | */
42 | context?: Record
43 |
44 | /**
45 | * Flag that enables schema validation for plugin methods.
46 | *
47 | * Defaults to `false`.
48 | */
49 | schemaValidation?: boolean
50 | }
51 |
--------------------------------------------------------------------------------
/packages/did-provider-web/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-provider-web",
3 | "description": "Veramo plugin that can enable creation and control of did:web identifiers.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/did-manager": "workspace:^",
15 | "@veramo/utils": "workspace:^",
16 | "debug": "^4.3.3"
17 | },
18 | "devDependencies": {
19 | "@types/debug": "4.1.8",
20 | "typescript": "5.7.3"
21 | },
22 | "files": [
23 | "build/**/*",
24 | "src/**/*",
25 | "README.md",
26 | "LICENSE"
27 | ],
28 | "publishConfig": {
29 | "access": "public"
30 | },
31 | "repository": {
32 | "type": "git",
33 | "url": "https://github.com/decentralized-identity/veramo.git",
34 | "directory": "packages/did-provider-web"
35 | },
36 | "author": "Consensys Mesh R&D ",
37 | "contributors": [
38 | "Simonas Karuzas ",
39 | "Mircea Nistor "
40 | ],
41 | "keywords": [
42 | "Veramo",
43 | "DID",
44 | "Verifiable Credential",
45 | "veramo-plugin",
46 | "did:web"
47 | ],
48 | "license": "Apache-2.0",
49 | "type": "module",
50 | "moduleDirectories": [
51 | "node_modules",
52 | "src"
53 | ]
54 | }
55 |
--------------------------------------------------------------------------------
/packages/did-provider-ion/src/json-canonicalizer.ts:
--------------------------------------------------------------------------------
1 | import canonicalize from 'canonicalize'
2 | /**
3 | * Class containing reusable JSON canonicalization operations using JSON Canonicalization Scheme (JCS).
4 | */
5 | export class JsonCanonicalizer {
6 | /**
7 | * Canonicalizes the given content as a string
8 | * @param The content to canonicalize
9 | * @return The canonicalized content
10 | */
11 | static asString(content: unknown): string {
12 | if (content == null) {
13 | throw Error('Null content received in canonicalizer')
14 | }
15 | // We need to remove all properties with `undefined` as value so that JCS canonicalization will not produce invalid JSON.
16 | const contentWithoutUndefinedProperties = JsonCanonicalizer.removeAllUndefinedProperties(content)
17 | const canonicalizedString = canonicalize(contentWithoutUndefinedProperties)
18 | if (!canonicalizedString) {
19 | throw new Error('Could not canonicalize input')
20 | }
21 | return canonicalizedString
22 | }
23 | /**
24 | * Removes all properties within the given object with `undefined` as value as that would mess up the validity
25 | */
26 | private static removeAllUndefinedProperties(content: any): unknown {
27 | for (const key in content) {
28 | if (typeof content[key] === 'object') {
29 | JsonCanonicalizer.removeAllUndefinedProperties(content[key])
30 | } else if (content[key] === undefined) {
31 | delete content[key]
32 | }
33 | }
34 | return content
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages/did-jwt/src/message-handler.ts:
--------------------------------------------------------------------------------
1 | import { IAgentContext, IResolver } from '@veramo/core-types'
2 | import { AbstractMessageHandler, Message } from '@veramo/message-handler'
3 | import { verifyJWT, decodeJWT } from 'did-jwt'
4 | import Debug from 'debug'
5 | import { Resolvable } from 'did-resolver'
6 |
7 | const debug = Debug('veramo:did-jwt:message-handler')
8 |
9 | export type IContext = IAgentContext
10 |
11 | /**
12 | * A plugin for {@link @veramo/message-handler#MessageHandler} that finds and verifies a JWT in a message.
13 | * @public
14 | */
15 | export class JwtMessageHandler extends AbstractMessageHandler {
16 | async handle(message: Message, context: IContext): Promise {
17 | if (message.raw) {
18 | try {
19 | const decoded = decodeJWT(message.raw)
20 | const audience = Array.isArray(decoded.payload.aud) ? decoded.payload.aud[0] : decoded.payload.aud
21 | const resolver = { resolve: (didUrl: string) => context.agent.resolveDid({ didUrl }) } as Resolvable
22 | const result = await verifyJWT(message.raw, { resolver, audience })
23 | if (result.verified) {
24 | debug('Message.raw is a valid JWT')
25 | message.addMetaData({ type: decoded.header.typ || 'JWT', value: decoded.header.alg })
26 | message.data = result.payload
27 | } else {
28 | debug(result)
29 | }
30 | } catch (e: any) {
31 | debug(e.message)
32 | }
33 | }
34 |
35 | return super.handle(message, context)
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/did-jwt/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-jwt",
3 | "description": "Veramo message validator plugin for decoding and verifying JWT payloads.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/message-handler": "workspace:^",
15 | "debug": "^4.3.3",
16 | "did-jwt": "^8.0.0",
17 | "did-resolver": "^4.1.0"
18 | },
19 | "devDependencies": {
20 | "@types/debug": "4.1.8",
21 | "typescript": "5.7.3"
22 | },
23 | "files": [
24 | "build/**/*",
25 | "src/**/*",
26 | "README.md",
27 | "LICENSE"
28 | ],
29 | "publishConfig": {
30 | "access": "public"
31 | },
32 | "repository": {
33 | "type": "git",
34 | "url": "https://github.com/decentralized-identity/veramo.git",
35 | "directory": "packages/did-jwt"
36 | },
37 | "author": "Consensys Mesh R&D ",
38 | "contributors": [
39 | "Simonas Karuzas ",
40 | "Mircea Nistor "
41 | ],
42 | "keywords": [
43 | "Veramo",
44 | "DID",
45 | "Verifiable Credential",
46 | "veramo-plugin",
47 | "vc-jwt",
48 | "JWT",
49 | "DID-JWT"
50 | ],
51 | "license": "Apache-2.0",
52 | "type": "module",
53 | "moduleDirectories": [
54 | "node_modules",
55 | "src"
56 | ]
57 | }
58 |
--------------------------------------------------------------------------------
/packages/key-manager/src/abstract-private-key-store.ts:
--------------------------------------------------------------------------------
1 | import { RequireOnly, TKeyType } from '@veramo/core-types'
2 |
3 | /**
4 | * Represents a private key.
5 | *
6 | * The `alias` is used to refer to the key material which is stored as the hex encoding of the raw byte array
7 | * (`privateKeyHex`).
8 | *
9 | * The `type` refers to the type of key that is represented.
10 | *
11 | * @public
12 | */
13 | export interface ManagedPrivateKey {
14 | alias: string
15 | privateKeyHex: string
16 | type: TKeyType
17 | }
18 |
19 | /**
20 | * Represents private key data that can be imported. This is a subset of {@link ManagedPrivateKey}.
21 | *
22 | * The `alias` of the resulting {@link ManagedPrivateKey} can be generated automatically if none is provided.
23 | *
24 | * @public
25 | */
26 | export type ImportablePrivateKey = RequireOnly
27 |
28 | /**
29 | * This base abstract class should be extended to provide platform specific implementations that are usable by
30 | * {@link @veramo/kms-local#KeyManagementSystem | kms-local}.
31 | *
32 | * Implementations of this class are used to store mappings between key aliases and key material.
33 | *
34 | * @public
35 | */
36 | export abstract class AbstractPrivateKeyStore {
37 | abstract importKey(args: ImportablePrivateKey): Promise
38 |
39 | abstract getKey(args: { alias: string }): Promise
40 |
41 | abstract deleteKey(args: { alias: string }): Promise
42 |
43 | abstract listKeys(args: {}): Promise>
44 | }
45 |
--------------------------------------------------------------------------------
/packages/url-handler/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/url-handler",
3 | "description": "Veramo message handler plugin to decode URL messages.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/message-handler": "workspace:^",
15 | "cross-fetch": "^4.0.0",
16 | "debug": "^4.3.3",
17 | "url-parse": "^1.5.4"
18 | },
19 | "devDependencies": {
20 | "@types/debug": "4.1.8",
21 | "@types/url-parse": "1.4.8",
22 | "jest-fetch-mock": "3.0.3",
23 | "typescript": "5.7.3"
24 | },
25 | "files": [
26 | "build/**/*",
27 | "src/**/*",
28 | "README.md",
29 | "LICENSE"
30 | ],
31 | "publishConfig": {
32 | "access": "public"
33 | },
34 | "repository": {
35 | "type": "git",
36 | "url": "https://github.com/decentralized-identity/veramo.git",
37 | "directory": "packages/url-handler"
38 | },
39 | "author": "Consensys Mesh R&D ",
40 | "contributors": [
41 | "Simonas Karuzas ",
42 | "Mircea Nistor "
43 | ],
44 | "keywords": [
45 | "Veramo",
46 | "DID",
47 | "Verifiable Credential",
48 | "veramo-plugin"
49 | ],
50 | "license": "Apache-2.0",
51 | "type": "module",
52 | "moduleDirectories": [
53 | "node_modules",
54 | "src"
55 | ]
56 | }
57 |
--------------------------------------------------------------------------------
/packages/remote-server/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * {@link https://expressjs.com | Express} router for exposing `@veramo/remote-client` OpenAPI schema
3 | *
4 | * @example
5 | * ```typescript
6 | * import express from 'express'
7 | * import { agent } from './agent'
8 | * import { AgentRouter, ApiSchemaRouter, WebDidDocRouter } from '@veramo/remote-server'
9 | *
10 | * const getAgentForRequest = async (req: express.Request) => agent
11 | * const exposedMethods = agent.availableMethods()
12 | * const basePath = '/agent'
13 | * const schemaPath = '/open-api.json'
14 | *
15 | * const agentRouter = AgentRouter({
16 | * getAgentForRequest,
17 | * exposedMethods,
18 | * })
19 | *
20 | * const schemaRouter = ApiSchemaRouter({
21 | * basePath,
22 | * getAgentForRequest,
23 | * exposedMethods,
24 | * })
25 | *
26 | * const didDocRouter = WebDidDocRouter({
27 | * getAgentForRequest
28 | * })
29 | *
30 | * const app = express()
31 | * app.use(basePath, agentRouter)
32 | * app.use(schemaPath, schemaRouter)
33 | * app.use(didDocRouter)
34 | * app.listen(3002)
35 | * ```
36 | *
37 | * @packageDocumentation
38 | */
39 |
40 | export { AgentRouter, AgentRouterOptions } from './agent-router.js'
41 | export { ApiSchemaRouter, ApiSchemaRouterOptions } from './api-schema-router.js'
42 | export { WebDidDocRouter, didDocEndpoint } from './web-did-doc-router.js'
43 | export { apiKeyAuth } from './api-key-auth.js'
44 | export { RequestWithAgentRouter } from './request-agent-router.js'
45 | export { MessagingRouter } from './messaging-router.js'
46 | export { createDefaultDid } from './default-did.js'
47 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/ld-suite-loader.ts:
--------------------------------------------------------------------------------
1 | import { VeramoLdSignature } from './ld-suites.js'
2 | import { TKeyType } from '@veramo/core-types'
3 | import { asArray } from '@veramo/utils'
4 |
5 | /**
6 | * Initializes a list of Veramo-wrapped LD Signature suites and exposes those to the Agent Module
7 | */
8 | export class LdSuiteLoader {
9 | constructor(options: { veramoLdSignatures: VeramoLdSignature[] }) {
10 | options.veramoLdSignatures.forEach((ldSuite) => {
11 | const keyType = ldSuite.getSupportedVeramoKeyType()
12 | let verifierMapping = this.signatureMap[keyType] ?? {}
13 | asArray(ldSuite.getSupportedVerificationType()).forEach((verificationType) => {
14 | verifierMapping[verificationType] = [...(verifierMapping[verificationType] ?? []), ldSuite]
15 | })
16 | return (this.signatureMap[keyType] = { ...this.signatureMap[keyType], ...verifierMapping })
17 | })
18 | }
19 |
20 | private signatureMap: Record> = {}
21 |
22 | getSignatureSuiteForKeyType(type: TKeyType, verificationType: string) {
23 | const suite = this.signatureMap[type]?.[verificationType]
24 | if (suite) return suite
25 |
26 | throw new Error('No Veramo LD Signature Suite for ' + type)
27 | }
28 |
29 | getAllSignatureSuites(): VeramoLdSignature[] {
30 | return Object.values(this.signatureMap)
31 | .map((x) => Object.values(x))
32 | .flat(2)
33 | }
34 |
35 | getAllSignatureSuiteTypes() {
36 | return Object.values(this.signatureMap)
37 | .map((x) => Object.keys(x))
38 | .flat()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/packages/did-resolver/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-resolver",
3 | "description": "A DID resolver plugin for Veramo",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/utils": "workspace:^",
15 | "cross-fetch": "^4.0.0",
16 | "debug": "^4.3.3",
17 | "did-resolver": "^4.1.0"
18 | },
19 | "devDependencies": {
20 | "@types/debug": "4.1.8",
21 | "ethr-did-resolver": "11.0.3",
22 | "typescript": "5.7.3",
23 | "web-did-resolver": "2.0.29"
24 | },
25 | "files": [
26 | "build/**/*",
27 | "src/**/*",
28 | "README.md",
29 | "LICENSE"
30 | ],
31 | "publishConfig": {
32 | "access": "public"
33 | },
34 | "repository": {
35 | "type": "git",
36 | "url": "https://github.com/decentralized-identity/veramo.git",
37 | "directory": "packages/did-resolver"
38 | },
39 | "author": "Consensys Mesh R&D ",
40 | "contributors": [
41 | "Simonas Karuzas ",
42 | "Mircea Nistor "
43 | ],
44 | "keywords": [
45 | "Veramo",
46 | "DID",
47 | "Verifiable Credential",
48 | "veramo-plugin",
49 | "did-resolver",
50 | "aggregator"
51 | ],
52 | "license": "Apache-2.0",
53 | "type": "module",
54 | "moduleDirectories": [
55 | "node_modules",
56 | "src"
57 | ]
58 | }
59 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:base",
4 | "group:allNonMajor",
5 | "schedule:earlyMondays",
6 | ":preserveSemverRanges"
7 | ],
8 | "labels": [
9 | "maintenance"
10 | ],
11 | "automerge": true,
12 | "automergeType": "branch",
13 | "packageRules": [
14 | {
15 | "groupName": "did-vc-libraries",
16 | "matchPackagePatterns": [
17 | "did",
18 | "credential"
19 | ],
20 | "schedule": [
21 | "before 5am every day"
22 | ],
23 | "matchUpdateTypes": [
24 | "major",
25 | "minor",
26 | "patch",
27 | "bump",
28 | "digest"
29 | ],
30 | "commitMessagePrefix": "fix(deps):"
31 | },
32 | {
33 | "groupName": "builders-and-testers",
34 | "matchPackagePatterns": [
35 | "jest",
36 | "codecov",
37 | "lint",
38 | "jsdoc",
39 | "bundle",
40 | "prettier",
41 | "webpack",
42 | "typescript",
43 | "@microsoft"
44 | ],
45 | "matchUpdateTypes": [
46 | "major",
47 | "minor"
48 | ]
49 | },
50 | {
51 | "groupName": "automation",
52 | "matchPackagePatterns": [
53 | "semantic",
54 | "lerna"
55 | ],
56 | "matchUpdateTypes": [
57 | "major",
58 | "minor"
59 | ]
60 | },
61 | {
62 | "groupName": "devDeps",
63 | "matchDepTypes": [
64 | "devDependencies"
65 | ],
66 | "matchUpdateTypes": [
67 | "major",
68 | "minor"
69 | ]
70 | }
71 | ]
72 | }
73 |
--------------------------------------------------------------------------------
/packages/credential-status/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/credential-status",
3 | "description": "Veramo plugin for resolving a credential status",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/utils": "workspace:^",
15 | "credential-status": "^3.0.0",
16 | "did-jwt": "^8.0.0",
17 | "did-resolver": "^4.1.0"
18 | },
19 | "devDependencies": {
20 | "@types/debug": "4.1.8",
21 | "typescript": "5.7.3"
22 | },
23 | "files": [
24 | "build/**/*",
25 | "src/**/*",
26 | "README.md",
27 | "LICENSE"
28 | ],
29 | "publishConfig": {
30 | "access": "public"
31 | },
32 | "repository": {
33 | "type": "git",
34 | "url": "https://github.com/decentralized-identity/veramo.git",
35 | "directory": "packages/credential-status"
36 | },
37 | "author": "Konstantin Tsabolov ",
38 | "contributors": [
39 | "Consensys Mesh R&D ",
40 | "Simonas Karuzas ",
41 | "Mircea Nistor "
42 | ],
43 | "keywords": [
44 | "Veramo",
45 | "DID",
46 | "Verifiable Credential",
47 | "credentialStatus",
48 | "aggregator",
49 | "veramo-plugin"
50 | ],
51 | "license": "Apache-2.0",
52 | "type": "module",
53 | "moduleDirectories": [
54 | "node_modules",
55 | "src"
56 | ]
57 | }
58 |
--------------------------------------------------------------------------------
/packages/did-provider-ethr/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-provider-ethr",
3 | "description": "Veramo ethr-did based identity controller plugin.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/did-manager": "workspace:^",
15 | "@veramo/utils": "workspace:^",
16 | "debug": "^4.3.3",
17 | "ethers": "^6.13.4",
18 | "ethr-did": "^3.0.21"
19 | },
20 | "devDependencies": {
21 | "@types/debug": "4.1.8",
22 | "typescript": "5.7.3"
23 | },
24 | "files": [
25 | "build/**/*",
26 | "src/**/*",
27 | "README.md",
28 | "LICENSE"
29 | ],
30 | "publishConfig": {
31 | "access": "public"
32 | },
33 | "repository": {
34 | "type": "git",
35 | "url": "https://github.com/decentralized-identity/veramo.git",
36 | "directory": "packages/did-provider-ethr"
37 | },
38 | "author": "Consensys Mesh R&D ",
39 | "contributors": [
40 | "Simonas Karuzas ",
41 | "Mircea Nistor "
42 | ],
43 | "keywords": [
44 | "Veramo",
45 | "DID",
46 | "Verifiable Credential",
47 | "veramo-plugin",
48 | "did:ethr",
49 | "EIP1056",
50 | "ethr-did",
51 | "Ethereum"
52 | ],
53 | "license": "Apache-2.0",
54 | "type": "module",
55 | "moduleDirectories": [
56 | "node_modules",
57 | "src"
58 | ]
59 | }
60 |
--------------------------------------------------------------------------------
/packages/mediation-manager/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/mediation-manager",
3 | "description": "Mediation Manager Plugin for Veramo",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "test": "jest --config=../../jest.config.mjs",
11 | "test:ci": "jest --config=../../jest.config.mjs",
12 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
13 | },
14 | "dependencies": {
15 | "@veramo/core-types": "workspace:^",
16 | "@veramo/kv-store": "workspace:^",
17 | "debug": "^4.3.4",
18 | "uuid": "^11.0.0"
19 | },
20 | "devDependencies": {
21 | "eslint": "8.57.1",
22 | "eslint-plugin-promise": "6.6.0",
23 | "timekeeper": "2.3.1",
24 | "typescript": "5.7.3"
25 | },
26 | "files": [
27 | "build/**/*",
28 | "src/**/*",
29 | "README.md",
30 | "LICENSE"
31 | ],
32 | "publishConfig": {
33 | "access": "public"
34 | },
35 | "repository": {
36 | "type": "git",
37 | "url": "https://github.com/decentralized-identity/veramo.git",
38 | "directory": "packages/mediation-manager"
39 | },
40 | "author": "Radley Sidwell-Lewis ",
41 | "contributors": [
42 | "Paul Desmond Parker ",
43 | "Mircea Nistor "
44 | ],
45 | "keywords": [
46 | "Veramo",
47 | "mediation-manager",
48 | "veramo-plugin"
49 | ],
50 | "license": "Apache-2.0",
51 | "type": "module",
52 | "moduleDirectories": [
53 | "node_modules",
54 | "src"
55 | ]
56 | }
57 |
--------------------------------------------------------------------------------
/packages/test-react-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.settings.json",
3 | "compilerOptions": {
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "types": [
6 | "puppeteer",
7 | "jest-environment-puppeteer",
8 | "expect-puppeteer"
9 | ],
10 | "skipLibCheck": true,
11 | "allowSyntheticDefaultImports": true,
12 | "forceConsistentCasingInFileNames": true,
13 | "moduleResolution": "node",
14 | "isolatedModules": true,
15 | "noEmit": true,
16 | "jsx": "react-jsx"
17 | },
18 | "include": [
19 | "src/**/*.ts[x]?"
20 | ],
21 | "references": [
22 | { "path": "../core-types" },
23 | { "path": "../core" },
24 | { "path": "../credential-ld" },
25 | { "path": "../credential-w3c" },
26 | { "path": "../data-store" },
27 | { "path": "../data-store-json" },
28 | { "path": "../did-comm" },
29 | { "path": "../did-discovery" },
30 | { "path": "../did-jwt" },
31 | { "path": "../did-manager" },
32 | { "path": "../did-provider-ethr" },
33 | { "path": "../did-provider-jwk" },
34 | { "path": "../did-provider-key" },
35 | { "path": "../did-provider-peer" },
36 | { "path": "../did-provider-pkh" },
37 | { "path": "../did-provider-web" },
38 | { "path": "../did-resolver" },
39 | { "path": "../key-manager" },
40 | { "path": "../kms-local" },
41 | { "path": "../message-handler" },
42 | { "path": "../remote-client" },
43 | { "path": "../remote-server" },
44 | { "path": "../selective-disclosure" },
45 | { "path": "../url-handler" },
46 | { "path": "../test-utils" },
47 | { "path": "../utils" }
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/packages/key-manager/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/key-manager",
3 | "description": "Key Manager plugin for Veramo",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@noble/curves": "^1.4.2",
14 | "@veramo/core-types": "workspace:^",
15 | "@veramo/utils": "workspace:^",
16 | "debug": "^4.3.4",
17 | "did-jwt": "^8.0.0",
18 | "ethers": "^6.13.4",
19 | "uint8arrays": "^4.0.6",
20 | "uuid": "^11.0.0"
21 | },
22 | "devDependencies": {
23 | "@types/debug": "4.1.8",
24 | "@types/uuid": "9.0.2",
25 | "typescript": "5.7.3"
26 | },
27 | "files": [
28 | "build/**/*",
29 | "src/**/*",
30 | "README.md",
31 | "LICENSE"
32 | ],
33 | "publishConfig": {
34 | "access": "public"
35 | },
36 | "repository": {
37 | "type": "git",
38 | "url": "https://github.com/decentralized-identity/veramo.git",
39 | "directory": "packages/key-manager"
40 | },
41 | "author": "Consensys Mesh R&D ",
42 | "contributors": [
43 | "Simonas Karuzas ",
44 | "Mircea Nistor "
45 | ],
46 | "keywords": [
47 | "Veramo",
48 | "DID",
49 | "Verifiable Credential",
50 | "veramo-plugin",
51 | "aggregator",
52 | "key-manager",
53 | "KMS"
54 | ],
55 | "license": "Apache-2.0",
56 | "type": "module",
57 | "moduleDirectories": [
58 | "node_modules",
59 | "src"
60 | ]
61 | }
62 |
--------------------------------------------------------------------------------
/packages/data-store/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/data-store",
3 | "description": "Veramo data storage plugin based on TypeORM database drivers",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "types": "build/index.d.ts",
7 | "scripts": {
8 | "build": "tsc",
9 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
10 | },
11 | "dependencies": {
12 | "@veramo/core-types": "workspace:^",
13 | "@veramo/did-discovery": "workspace:^",
14 | "@veramo/did-manager": "workspace:^",
15 | "@veramo/key-manager": "workspace:^",
16 | "@veramo/utils": "workspace:^",
17 | "debug": "^4.3.3",
18 | "did-jwt-vc": "^4.0.0",
19 | "typeorm": "^0.3.20",
20 | "uuid": "^11.0.0"
21 | },
22 | "devDependencies": {
23 | "@types/debug": "4.1.8",
24 | "@types/uuid": "9.0.2",
25 | "sqlite3": "5.1.7",
26 | "typescript": "5.7.3"
27 | },
28 | "files": [
29 | "build/**/*",
30 | "src/**/*",
31 | "README.md",
32 | "LICENSE"
33 | ],
34 | "publishConfig": {
35 | "access": "public"
36 | },
37 | "repository": {
38 | "type": "git",
39 | "url": "https://github.com/decentralized-identity/veramo.git",
40 | "directory": "packages/data-store"
41 | },
42 | "author": "Consensys Mesh R&D ",
43 | "contributors": [
44 | "Simonas Karuzas ",
45 | "Mircea Nistor "
46 | ],
47 | "keywords": [
48 | "Veramo",
49 | "DID",
50 | "Verifiable Credential",
51 | "data store",
52 | "TypeORM",
53 | "database",
54 | "veramo-plugin"
55 | ],
56 | "license": "Apache-2.0",
57 | "type": "module"
58 | }
59 |
--------------------------------------------------------------------------------
/packages/core-types/src/types/IMessageHandler.ts:
--------------------------------------------------------------------------------
1 | import { IAgentContext, IPluginMethodMap } from './IAgent.js'
2 | import { IMessage, IMetaData } from './IMessage.js'
3 | import { IDataStore } from './IDataStore.js'
4 |
5 | /**
6 | * Input arguments for {@link IMessageHandler.handleMessage | handleMessage}
7 | * @public
8 | */
9 | export interface IHandleMessageArgs {
10 | /**
11 | * Raw message data
12 | */
13 | raw: string
14 |
15 | /**
16 | * Optional. Message meta data
17 | */
18 | metaData?: IMetaData[]
19 |
20 | /**
21 | * Optional. If set to `true`, the message will be saved using
22 | * {@link @veramo/core-types#IDataStore.dataStoreSaveMessage | dataStoreSaveMessage}
23 | *
24 | * @deprecated Please call {@link @veramo/core-types#IDataStore.dataStoreSaveMessage | dataStoreSaveMessage()} after
25 | * handling the message and determining that it must be saved.
26 | */
27 | save?: boolean
28 | }
29 |
30 | /**
31 | * Message handler plugin interface.
32 | * @public
33 | */
34 | export interface IMessageHandler extends IPluginMethodMap {
35 | /**
36 | * Parses a raw message.
37 | *
38 | * After the message is parsed, you can decide if it should be saved, and pass the result to
39 | * {@link @veramo/core-types#IDataStore.dataStoreSaveMessage | dataStoreSaveMessage()} to save it.
40 | *
41 | * @param args - The `raw` message to be handled along with optional `metadata` about the origin.
42 | * @param context - Execution context. Requires agent with {@link @veramo/core-types#IDataStore} methods
43 | */
44 | handleMessage(args: IHandleMessageArgs, context: IAgentContext): Promise
45 | }
46 |
--------------------------------------------------------------------------------
/packages/did-comm/src/encryption/xc20pkw.ts:
--------------------------------------------------------------------------------
1 | import type { Decrypter, KeyWrapper, WrappingResult } from 'did-jwt'
2 | import { randomBytes } from '@noble/hashes/utils'
3 | import { concat } from '@veramo/utils'
4 | import { xchacha20poly1305 } from '@noble/ciphers/chacha'
5 |
6 | export const xc20pKeyWrapper: KeyWrapper = {
7 | from: (wrappingKey: Uint8Array) => {
8 | const wrap = async (cek: Uint8Array): Promise => {
9 | const iv = randomBytes(xchacha20poly1305.nonceLength)
10 | const cipher = xchacha20poly1305(wrappingKey, iv)
11 | const sealed = cipher.encrypt(cek)
12 | return {
13 | ciphertext: sealed.subarray(0, sealed.length - xchacha20poly1305.tagLength),
14 | tag: sealed.subarray(sealed.length - xchacha20poly1305.tagLength),
15 | iv,
16 | }
17 | }
18 | return { wrap }
19 | },
20 |
21 | alg: 'XC20PKW',
22 | }
23 |
24 | export function xc20pDecrypter(key: Uint8Array): Decrypter {
25 |
26 | async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise {
27 | const cipher = xchacha20poly1305(key, iv, aad)
28 | return cipher.decrypt(sealed)
29 | }
30 |
31 | return { alg: 'dir', enc: 'XC20P', decrypt }
32 | }
33 |
34 | export function xc20pKeyUnwrapper(wrappingKey: Uint8Array) {
35 | const unwrap = async (
36 | wrappedCek: Uint8Array,
37 | iv: Uint8Array,
38 | tag: Uint8Array,
39 | ): Promise => {
40 | try {
41 | const sealed = concat([wrappedCek, tag])
42 | return xc20pDecrypter(wrappingKey).decrypt(sealed, iv)
43 | } catch (e) {
44 | return null
45 | }
46 | }
47 | return { unwrap, alg: 'XC20PKW' }
48 | }
49 |
--------------------------------------------------------------------------------
/packages/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts:
--------------------------------------------------------------------------------
1 | import { MigrationInterface, QueryRunner, Table } from 'typeorm'
2 | import Debug from 'debug'
3 | const debug = Debug('veramo:data-store:initial-migration')
4 |
5 | /**
6 | * Create the database layout for Veramo 3.0
7 | *
8 | * @public
9 | */
10 | export class CreateKVDatabaseMigration implements MigrationInterface {
11 | private readonly _tableName: string
12 | readonly name: string
13 |
14 | constructor(tableName?: string) {
15 | this._tableName = tableName || 'keyvaluestore'
16 | this.name = `CreateKVDatabase${tableName}1680297189001`
17 | }
18 |
19 | async up(queryRunner: QueryRunner): Promise {
20 | function getTableName(givenName: string): string {
21 | return (
22 | queryRunner.connection.entityMetadatas.find((meta) => meta.givenTableName === givenName)?.tableName ||
23 | givenName
24 | )
25 | }
26 |
27 | debug(`creating ${this._tableName} table`)
28 | // CREATE TABLE "keyvaluestore" ("key" varchar PRIMARY KEY NOT NULL, "data" text NOT NULL)
29 | await queryRunner.createTable(
30 | new Table({
31 | name: getTableName(this._tableName),
32 | columns: [
33 | { name: 'key', type: 'varchar', isPrimary: true },
34 | { name: 'data', type: 'text', isNullable: false },
35 | ],
36 | indices: [
37 | {
38 | columnNames: ['key'],
39 | isUnique: true,
40 | },
41 | ],
42 | }),
43 | true,
44 | )
45 | }
46 |
47 | async down(queryRunner: QueryRunner): Promise {
48 | throw new Error('illegal_operation: cannot roll back initial migration')
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/packages/credential-ld/src/contexts/www.w3.org_ns_did_v1.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@protected": true,
4 | "id": "@id",
5 | "type": "@type",
6 | "alsoKnownAs": {
7 | "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
8 | "@type": "@id"
9 | },
10 | "assertionMethod": {
11 | "@id": "https://w3id.org/security#assertionMethod",
12 | "@type": "@id",
13 | "@container": "@set"
14 | },
15 | "authentication": {
16 | "@id": "https://w3id.org/security#authenticationMethod",
17 | "@type": "@id",
18 | "@container": "@set"
19 | },
20 | "capabilityDelegation": {
21 | "@id": "https://w3id.org/security#capabilityDelegationMethod",
22 | "@type": "@id",
23 | "@container": "@set"
24 | },
25 | "capabilityInvocation": {
26 | "@id": "https://w3id.org/security#capabilityInvocationMethod",
27 | "@type": "@id",
28 | "@container": "@set"
29 | },
30 | "controller": {
31 | "@id": "https://w3id.org/security#controller",
32 | "@type": "@id"
33 | },
34 | "keyAgreement": {
35 | "@id": "https://w3id.org/security#keyAgreementMethod",
36 | "@type": "@id",
37 | "@container": "@set"
38 | },
39 | "service": {
40 | "@id": "https://www.w3.org/ns/did#service",
41 | "@type": "@id",
42 | "@context": {
43 | "@protected": true,
44 | "id": "@id",
45 | "type": "@type",
46 | "serviceEndpoint": {
47 | "@id": "https://www.w3.org/ns/did#serviceEndpoint",
48 | "@type": "@id"
49 | }
50 | }
51 | },
52 | "verificationMethod": {
53 | "@id": "https://w3id.org/security#verificationMethod",
54 | "@type": "@id"
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/packages/remote-client/src/client.ts:
--------------------------------------------------------------------------------
1 | import { IAgentPlugin, IPluginMethodMap, IAgentPluginSchema } from '@veramo/core-types'
2 |
3 | /**
4 | * This plugin can be used to access the methods of a remote Veramo agent as if they were implemented locally.
5 | *
6 | * The remote agent should be provided by {@link @veramo/remote-server#AgentRouter | AgentRouter}, or a similar
7 | * implementation of this API.
8 | *
9 | * The schema of the remote agent is usually provided by {@link @veramo/remote-server#ApiSchemaRouter |
10 | * ApiSchemaRouter}.
11 | *
12 | * @public
13 | */
14 | export class AgentRestClient implements IAgentPlugin {
15 | readonly methods: IPluginMethodMap = {}
16 | readonly schema?: IAgentPluginSchema
17 | private url: string
18 |
19 | constructor(options: {
20 | url: string
21 | enabledMethods: string[]
22 | schema?: IAgentPluginSchema
23 | headers?: Record | (() => Promise>)
24 | }) {
25 | this.url = options.url
26 | this.schema = options.schema
27 |
28 | for (const method of options.enabledMethods) {
29 | this.methods[method] = async (args: any) => {
30 | // in case headers is an async call, we will wait for it to resolve
31 | const headers = typeof options.headers === 'function' ? await options.headers() : options.headers
32 | const res = await fetch(this.url + '/' + method, {
33 | headers: { ...headers, 'Content-Type': 'application/json' },
34 | method: 'post',
35 | body: JSON.stringify(args),
36 | })
37 | const json = await res.json()
38 |
39 | if (res.status >= 400) {
40 | throw Error(json.error)
41 | }
42 |
43 | return json
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/packages/credential-eip712/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/credential-eip712",
3 | "description": "Veramo plugin for working with EIP712 Verifiable Credentials & Presentations.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": {
7 | ".": "./build/index.js"
8 | },
9 | "types": "build/index.d.ts",
10 | "scripts": {
11 | "build": "tsc",
12 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
13 | },
14 | "dependencies": {
15 | "@metamask/eth-sig-util": "^7.0.0",
16 | "@veramo/credential-w3c": "workspace:^",
17 | "@veramo/core-types": "workspace:^",
18 | "@veramo/utils": "workspace:^",
19 | "debug": "^4.3.3",
20 | "eip-712-types-generation": "^0.1.6"
21 | },
22 | "devDependencies": {
23 | "@types/debug": "4.1.8",
24 | "typescript": "5.7.3"
25 | },
26 | "files": [
27 | "build/**/*",
28 | "src/**/*",
29 | "README.md",
30 | "LICENSE"
31 | ],
32 | "publishConfig": {
33 | "access": "public"
34 | },
35 | "repository": {
36 | "type": "git",
37 | "url": "https://github.com/decentralized-identity/veramo.git",
38 | "directory": "packages/credential-eip712"
39 | },
40 | "author": "Consensys Mesh R&D ",
41 | "contributors": [
42 | "Nick Reynolds ",
43 | "Italo Borssatto",
44 | "Mircea Nistor ",
45 | "Simonas Karuzas "
46 | ],
47 | "keywords": [
48 | "Veramo",
49 | "DID",
50 | "Verifiable Credential",
51 | "EIP712",
52 | "EthereumEIP712Signature2021",
53 | "veramo-plugin"
54 | ],
55 | "license": "Apache-2.0",
56 | "type": "module",
57 | "moduleDirectories": [
58 | "node_modules",
59 | "src"
60 | ]
61 | }
--------------------------------------------------------------------------------
/packages/did-provider-jwk/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-provider-jwk",
3 | "version": "6.0.0",
4 | "description": "Veramo plugin that can enable creation and control of did:jwk identifiers.",
5 | "main": "build/index.js",
6 | "types": "build/index.d.ts",
7 | "exports": "./build/index.js",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@noble/curves": "^1.4.2",
14 | "@veramo/core-types": "workspace:^",
15 | "@veramo/did-manager": "workspace:^",
16 | "@veramo/utils": "workspace:^",
17 | "debug": "^4.3.3",
18 | "did-resolver": "^4.1.0"
19 | },
20 | "devDependencies": {
21 | "@types/debug": "4.1.8",
22 | "@veramo/core": "workspace:*",
23 | "@veramo/did-resolver": "workspace:*",
24 | "@veramo/key-manager": "workspace:*",
25 | "@veramo/kms-local": "workspace:*",
26 | "typescript": "5.7.3"
27 | },
28 | "repository": {
29 | "type": "git",
30 | "url": "https://github.com/decentralized-identity/veramo.git",
31 | "directory": "packages/did-provider-jwk"
32 | },
33 | "author": "Tadej Podrekar",
34 | "contributors": [
35 | "Consensys Mesh R&D ",
36 | "Mircea Nistor "
37 | ],
38 | "keywords": [
39 | "Veramo",
40 | "DID",
41 | "Verifiable Credential",
42 | "veramo-plugin",
43 | "did:jwk",
44 | "JWK"
45 | ],
46 | "license": "Apache-2.0",
47 | "files": [
48 | "build/**/*",
49 | "src/**/*",
50 | "README.md",
51 | "LICENSE"
52 | ],
53 | "type": "module",
54 | "moduleDirectories": [
55 | "node_modules",
56 | "src"
57 | ],
58 | "publishConfig": {
59 | "access": "public"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/packages/data-store/src/entities/key.ts:
--------------------------------------------------------------------------------
1 | import { KeyMetadata, TKeyType } from '@veramo/core-types'
2 | import { Entity, Column, PrimaryColumn, BaseEntity, ManyToOne, Relation } from 'typeorm'
3 | import { Identifier } from './identifier.js'
4 |
5 | /**
6 | * Mirrors {@link @veramo/core-types#TKeyType | TKeyType}
7 | *
8 | * @beta - This API may change without a BREAKING CHANGE notice.
9 | */
10 | export type KeyType = TKeyType
11 |
12 | /**
13 | * Represents some properties of a {@link @veramo/core-types#IKey | IKey} that are stored in a TypeORM
14 | * database for the purpose of keeping track of the {@link @veramo/key-manager#AbstractKeyManagementSystem}
15 | * implementations and the keys they are able to use.
16 | *
17 | * @see {@link @veramo/data-store#KeyStore | KeyStore} for the implementation used by the
18 | * {@link @veramo/key-manager#KeyManager | KeyManager}.
19 | *
20 | * @beta This API may change without a BREAKING CHANGE notice.
21 | */
22 | @Entity('key')
23 | export class Key extends BaseEntity {
24 | @PrimaryColumn()
25 | // @ts-ignore
26 | kid: string
27 |
28 | @Column()
29 | // @ts-ignore
30 | kms: string
31 |
32 | @Column()
33 | // @ts-ignore
34 | type: KeyType
35 |
36 | @Column()
37 | // @ts-ignore
38 | publicKeyHex: string
39 |
40 | @Column({
41 | type: 'simple-json',
42 | nullable: true,
43 | transformer: {
44 | to: (value: any): KeyMetadata | null => {
45 | return value
46 | },
47 | from: (value: KeyMetadata | null): object | null => {
48 | return value
49 | },
50 | },
51 | })
52 | meta?: KeyMetadata | null
53 |
54 | @ManyToOne((type) => Identifier, (identifier) => identifier?.keys, { onDelete: 'CASCADE' })
55 | identifier?: Relation
56 | }
57 |
--------------------------------------------------------------------------------
/packages/utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/utils",
3 | "description": "Helper methods for Veramo plugins",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@ipld/dag-pb": "^4.0.5",
14 | "@noble/curves": "^1.4.2",
15 | "@veramo/core-types": "workspace:^",
16 | "credential-status": "^3.0.0",
17 | "cross-fetch": "^4.0.0",
18 | "debug": "^4.3.3",
19 | "did-jwt": "^8.0.0",
20 | "did-jwt-vc": "^4.0.0",
21 | "did-resolver": "^4.1.0",
22 | "ethers": "^6.13.4",
23 | "ipfs-unixfs": "^11.1.0",
24 | "multiformats": "^13.0.0",
25 | "uint8arrays": "^4.0.6"
26 | },
27 | "devDependencies": {
28 | "@types/debug": "4.1.8",
29 | "@types/uuid": "9.0.2"
30 | },
31 | "files": [
32 | "build/**/*",
33 | "src/**/*",
34 | "README.md",
35 | "LICENSE"
36 | ],
37 | "publishConfig": {
38 | "access": "public"
39 | },
40 | "repository": {
41 | "type": "git",
42 | "url": "https://github.com/decentralized-identity/veramo.git",
43 | "directory": "packages/utils"
44 | },
45 | "author": "Consensys Mesh R&D ",
46 | "contributors": [
47 | "Mircea Nistor ",
48 | "Simonas Karuzas "
49 | ],
50 | "keywords": [
51 | "Veramo",
52 | "DID",
53 | "Verifiable Credential",
54 | "veramo-plugin",
55 | "utils",
56 | "encoding",
57 | "crypto"
58 | ],
59 | "license": "Apache-2.0",
60 | "type": "module",
61 | "moduleDirectories": [
62 | "node_modules",
63 | "src"
64 | ]
65 | }
66 |
--------------------------------------------------------------------------------
/packages/did-provider-pkh/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-provider-pkh",
3 | "description": "Veramo plugin that can enable creation and control of did:pkh identifiers.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/did-manager": "workspace:^",
15 | "@veramo/utils": "workspace:^",
16 | "caip": "^1.1.0",
17 | "debug": "^4.3.3",
18 | "did-resolver": "^4.1.0",
19 | "ethers": "^6.13.4"
20 | },
21 | "devDependencies": {
22 | "@types/debug": "4.1.8",
23 | "typescript": "5.7.3"
24 | },
25 | "files": [
26 | "build/**/*",
27 | "src/**/*",
28 | "README.md",
29 | "LICENSE"
30 | ],
31 | "publishConfig": {
32 | "access": "public"
33 | },
34 | "repository": {
35 | "type": "git",
36 | "url": "https://github.com/decentralized-identity/veramo.git",
37 | "directory": "packages/did-provider-pkh"
38 | },
39 | "author": "Diego Chagastelles ",
40 | "contributors": [
41 | "Consensys Mesh R&D ",
42 | "Mircea Nistor ",
43 | "Simonas Karuzas "
44 | ],
45 | "keywords": [
46 | "Veramo",
47 | "DID",
48 | "Verifiable Credential",
49 | "veramo-plugin",
50 | "did:pkh",
51 | "public key",
52 | "hash",
53 | "blockchainAccountId",
54 | "ethereum",
55 | "cosmos"
56 | ],
57 | "license": "Apache-2.0",
58 | "type": "module",
59 | "moduleDirectories": [
60 | "node_modules",
61 | "src"
62 | ]
63 | }
64 |
--------------------------------------------------------------------------------
/packages/credential-w3c/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/credential-w3c",
3 | "description": "Veramo plugin for working with W3C Verifiable Credentials & Presentations.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": {
7 | ".": "./build/index.js"
8 | },
9 | "types": "build/index.d.ts",
10 | "scripts": {
11 | "build": "tsc",
12 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
13 | },
14 | "dependencies": {
15 | "@veramo/core-types": "workspace:^",
16 | "@veramo/message-handler": "workspace:^",
17 | "@veramo/utils": "workspace:^",
18 | "canonicalize": "^2.0.0",
19 | "debug": "^4.3.3",
20 | "did-jwt": "^8.0.0",
21 | "did-jwt-vc": "^4.0.0",
22 | "did-resolver": "^4.1.0",
23 | "uuid": "^11.0.0"
24 | },
25 | "devDependencies": {
26 | "@types/debug": "4.1.8",
27 | "@types/uuid": "9.0.2",
28 | "typescript": "5.7.3"
29 | },
30 | "files": [
31 | "build/**/*",
32 | "src/**/*",
33 | "README.md",
34 | "LICENSE"
35 | ],
36 | "publishConfig": {
37 | "access": "public"
38 | },
39 | "repository": {
40 | "type": "git",
41 | "url": "https://github.com/decentralized-identity/veramo.git",
42 | "directory": "packages/credential-w3c"
43 | },
44 | "author": "Consensys Mesh R&D ",
45 | "contributors": [
46 | "Simonas Karuzas ",
47 | "Mircea Nistor "
48 | ],
49 | "keywords": [
50 | "Veramo",
51 | "DID",
52 | "Verifiable Credential",
53 | "JWT",
54 | "W3C",
55 | "aggregator",
56 | "vc-jwt",
57 | "veramo-plugin"
58 | ],
59 | "license": "Apache-2.0",
60 | "type": "module",
61 | "moduleDirectories": [
62 | "node_modules",
63 | "src"
64 | ]
65 | }
66 |
--------------------------------------------------------------------------------
/packages/selective-disclosure/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/selective-disclosure",
3 | "description": "Veramo plugin to enable the uPort selective disclosure protocol with W3C compatibility.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": {
7 | ".": "./build/index.js"
8 | },
9 | "types": "build/index.d.ts",
10 | "scripts": {
11 | "build": "tsc",
12 | "generate-plugin-schema": "node ../cli/bin/veramo.js dev generate-plugin-schema"
13 | },
14 | "veramo": {
15 | "pluginInterfaces": {
16 | "ISelectiveDisclosure": "./src/types.ts"
17 | }
18 | },
19 | "dependencies": {
20 | "@veramo/core-types": "workspace:^",
21 | "@veramo/message-handler": "workspace:^",
22 | "@veramo/utils": "workspace:^",
23 | "debug": "^4.3.3",
24 | "did-jwt": "^8.0.0",
25 | "uuid": "^11.0.0"
26 | },
27 | "devDependencies": {
28 | "@types/debug": "4.1.8",
29 | "@types/uuid": "9.0.2",
30 | "typescript": "5.7.3"
31 | },
32 | "files": [
33 | "build/**/*",
34 | "src/**/*",
35 | "README.md",
36 | "LICENSE"
37 | ],
38 | "publishConfig": {
39 | "access": "public"
40 | },
41 | "repository": {
42 | "type": "git",
43 | "url": "https://github.com/decentralized-identity/veramo.git",
44 | "directory": "packages/selective-disclosure"
45 | },
46 | "author": "Consensys Mesh R&D ",
47 | "contributors": [
48 | "Simonas Karuzas ",
49 | "Mircea Nistor "
50 | ],
51 | "keywords": [
52 | "Veramo",
53 | "DID",
54 | "Verifiable Credential",
55 | "veramo-plugin"
56 | ],
57 | "license": "Apache-2.0",
58 | "type": "module",
59 | "moduleDirectories": [
60 | "node_modules",
61 | "src"
62 | ]
63 | }
64 |
--------------------------------------------------------------------------------
/packages/utils/src/type-utils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if a variable is defined and not null.
3 | * After this check, typescript sees the variable as defined.
4 | *
5 | * @param arg - The input to be verified
6 | *
7 | * @returns true if the input variable is defined.
8 | *
9 | * @beta This API may change without a BREAKING CHANGE notice.
10 | */
11 | export function isDefined(arg: T): arg is Exclude {
12 | return arg !== null && typeof arg !== 'undefined'
13 | }
14 |
15 | /**
16 | * Ensures that a given input is an array. If the input is a single item, it is converted to an array with a single
17 | * entry.
18 | *
19 | * @param arg - a variable that needs to be converted to array
20 | *
21 | * @beta This API may change without a BREAKING CHANGE notice.
22 | */
23 | export function asArray(arg?: T | T[] | any): (T | any)[] {
24 | return isDefined(arg) ? (Array.isArray(arg) ? arg : [arg]) : []
25 | }
26 |
27 | /**
28 | * Checks if an object is iterable (can be used for `for..of`)
29 | * @param obj - the variable to be checked
30 | *
31 | * @beta This API may change without a BREAKING CHANGE notice.
32 | */
33 | export function isIterable(obj: any): obj is Iterable {
34 | return obj != null && typeof obj[Symbol.iterator] === 'function'
35 | }
36 |
37 | /**
38 | * Compute the intersection of two arrays
39 | * Elements are compared by reference so object types will appear as unique even if they contain the same data.
40 | *
41 | * @param a - first array
42 | * @param b - second array
43 | * @returns The intersection of the two arrays.
44 | *
45 | * @public
46 | */
47 | export function intersect(a: T[] | any, b: any[] | any): T[] {
48 | const setB = new Set(asArray(b));
49 | return [...new Set(asArray(a))].filter(x => setB.has(x));
50 | }
51 |
--------------------------------------------------------------------------------
/authors.md:
--------------------------------------------------------------------------------
1 | # Contributors Highlight
2 |
3 | ### Veramolabs Team, including former members
4 | - [Mircea Nistor](https://github.com/mirceanis)
5 | - [Simonas Karuzas](https://github.com/simonas-notcat)
6 | - [Nick Reynolds](https://github.com/nickreynolds)
7 | - [Italo Borsatto](https://github.com/italobb)
8 | - [Oliver Terbu](https://github.com/awoie)
9 | - [Jason Healy](https://github.com/jasheal)
10 | - [Greg Bugyis](https://github.com/gbugyis)
11 | - [Martin Riedel](https://github.com/rado0x54)
12 |
13 | Special thanks to the following extraordinary individuals, for their contributions to the Veramo project:
14 |
15 | - [Nick L.](https://github.com/nick-verida)
16 | - [Richard Braman](https://github.com/fhirfly)
17 | - [Tasos Derisiotis](https://github.com/Eengineer1)
18 | - [Ron Kreutzer](https://github.com/rkreutzer)
19 | - [Duranteau Ludovic](https://github.com/duranteau-l-i)
20 | - [Ilya Nevolin](https://github.com/inevolin)
21 | - [Andraz](https://github.com/andyv09)
22 | - [Konstantin Tsabolov](https://github.com/tsabolov)
23 | - [Emile Baizel](https://github.com/ebaizel)
24 | - [Moe Jangda](https://github.com/mistermoe)
25 | - [Martijn de Bruijn](https://github.com/martijndebruijn)
26 | - [Leo Ribeiro](https://github.com/leordev)
27 | - [Oriel Steele](https://github.com/OR13)
28 | - [Trent Larson](https://github.com/trentlarson)
29 | - [Andres Junge](https://github.com/ajunge)
30 | - [Roderik van der Veer](https://github.com/roderik)
31 | - [Jan Christoph Ebersbach](https://github.com/jceb)
32 | - [Dan Bolser](https://github.com/CholoTook)
33 | - [Walker Flynn](https://github.com/walfly)
34 | - [Devraj Singh Rawat](https://github.com/devrajsinghrawat)
35 | - [Eseoghene Mentie](https://github.com/Eseoghene)
36 | - [Ilan Olkies](https://github.com/ilanolkies)
37 | - [Niels Klomp](https://github.com/nklomp)
38 |
--------------------------------------------------------------------------------
/packages/did-provider-key/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@veramo/did-provider-key",
3 | "description": "Veramo plugin that can enable creation and control of did:key identifiers.",
4 | "version": "6.0.0",
5 | "main": "build/index.js",
6 | "exports": "./build/index.js",
7 | "types": "build/index.d.ts",
8 | "scripts": {
9 | "build": "tsc",
10 | "extract-api": "node ../cli/bin/veramo.js dev extract-api"
11 | },
12 | "dependencies": {
13 | "@veramo/core-types": "workspace:^",
14 | "@veramo/did-manager": "workspace:^",
15 | "@veramo/utils": "workspace:^",
16 | "debug": "^4.3.3",
17 | "did-resolver": "^4.1.0",
18 | "ethers": "^6.13.4"
19 | },
20 | "devDependencies": {
21 | "@types/debug": "4.1.8",
22 | "typescript": "5.7.3"
23 | },
24 | "resolutions": {
25 | "jsonld": "npm:@digitalcredentials/jsonld@^6.0.0"
26 | },
27 | "files": [
28 | "build/**/*",
29 | "src/**/*",
30 | "README.md",
31 | "LICENSE"
32 | ],
33 | "publishConfig": {
34 | "access": "public"
35 | },
36 | "repository": {
37 | "type": "git",
38 | "url": "https://github.com/decentralized-identity/veramo.git",
39 | "directory": "packages/did-provider-key"
40 | },
41 | "author": "Consensys Mesh R&D ",
42 | "contributors": [
43 | "Oliver Terbu",
44 | "Simonas Karuzas ",
45 | "Mircea Nistor "
46 | ],
47 | "keywords": [
48 | "Veramo",
49 | "DID",
50 | "Verifiable Credential",
51 | "veramo-plugin",
52 | "did:key",
53 | "multibase",
54 | "multiformats",
55 | "Ed25519",
56 | "X25519",
57 | "Secp256k1"
58 | ],
59 | "license": "Apache-2.0",
60 | "type": "module",
61 | "moduleDirectories": [
62 | "node_modules",
63 | "src"
64 | ]
65 | }
66 |
--------------------------------------------------------------------------------