Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(did-provider-dht): Implement DID Provider for did:dht #1412

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/did-provider-dht/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"apiReport": {
"enabled": true,
"reportFolder": "./api",
"reportTempFolder": "./api"
},

"docModel": {
"enabled": true,
"apiJsonFilePath": "./api/<unscopedPackageName>.api.json"
},

"dtsRollup": {
"enabled": false
},
"mainEntryPointFilePath": "<projectFolder>/build/index.d.ts"
}
40 changes: 40 additions & 0 deletions packages/did-provider-dht/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "did-provider-dht",
"version": "1.0.0",
"description": "Veramo plugin that enables creation and control of did:dht method.",
"main": "build/index.js",
"exports": "./build/index.js",
"types": "build/index.d.ts",
"scripts": {
"build": "tsc",
"extract-api": "node ../cli/bin/veramo.js dev extract-api"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/decentralized-identity/veramo.git",
"directory": "packages/did-provider-dht"
},
"keywords": [
"Veramo",
"DID",
"Verifiable",
"Credential",
"veramo-plugin",
"did:dht"
],
"author": "Consensys Mesh R&D <[email protected]>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/decentralized-identity/veramo/issues"
},
"homepage": "https://github.com/decentralized-identity/veramo#readme",
"dependencies": {
"@veramo/core": "^6.0.0",
"@veramo/core-types": "^6.0.0",
"@veramo/did-manager": "^6.0.0",
"debug": "^4.3.6"
}
}
31 changes: 31 additions & 0 deletions packages/did-provider-dht/src/dht-did-provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { DIDDocument, IAgentContext, IIdentifier, IKey, IKeyManager, IService } from '@veramo/core-types'

import { AbstractIdentifierProvider } from '@veramo/did-manager'

/**
* {@link @veramo/did-manager#DIDManager} identifier provider for `did:web` identifiers
* @public
*/
export class DHTDIDProvider extends AbstractIdentifierProvider {
createIdentifier(args: { kms?: string | undefined; alias?: string | undefined; options?: any }, context: IAgentContext<IKeyManager>): Promise<Omit<IIdentifier, 'provider'>> {
throw new Error('Method not implemented.')
}
updateIdentifier?(args: { did: string; document: Partial<DIDDocument>; options?: { [x: string]: any } | undefined }, context: IAgentContext<IKeyManager>): Promise<IIdentifier> {
throw new Error('Method not implemented.')
}
deleteIdentifier(args: IIdentifier, context: IAgentContext<IKeyManager>): Promise<boolean> {
throw new Error('Method not implemented.')
}
addKey(args: { identifier: IIdentifier; key: IKey; options?: any }, context: IAgentContext<IKeyManager>): Promise<any> {
throw new Error('Method not implemented.')
}
removeKey(args: { identifier: IIdentifier; kid: string; options?: any }, context: IAgentContext<IKeyManager>): Promise<any> {
throw new Error('Method not implemented.')
}
addService(args: { identifier: IIdentifier; service: IService; options?: any }, context: IAgentContext<IKeyManager>): Promise<any> {
throw new Error('Method not implemented.')
}
removeService(args: { identifier: IIdentifier; id: string; options?: any }, context: IAgentContext<IKeyManager>): Promise<any> {
throw new Error('Method not implemented.')
}
}
7 changes: 7 additions & 0 deletions packages/did-provider-dht/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Provides `did:dht` {@link @veramo/did-provider-dht#DHTDIDProvider | identifier provider } for the
* {@link @veramo/did-manager#DIDManager}
*
* @packageDocumentation
*/
export { DHTDIDProvider } from './dht-did-provider.js'
12 changes: 12 additions & 0 deletions packages/did-provider-dht/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.settings.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build",
"declarationDir": "build"
},
"references": [
{ "path": "../core-types" },
{ "path": "../did-discovery" }
]
}