-
Notifications
You must be signed in to change notification settings - Fork 22
feat: 🎸 Add verifier for w3c-did identityProof #80
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ node_modules/ | |
| dist/ | ||
| .idea | ||
| *.iml | ||
| .vscode/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,10 @@ | ||
| export const INFURA_API_KEY = "92c9a51428b946c1b8c1ac5a237616e4"; | ||
|
|
||
| // DID Universal Resolver parameters | ||
| export const BASE_RESOLVER_URL = "https://uniresolver.io"; | ||
| export const RESOLVER_VERSION = "1.0"; | ||
| export const RESOLVER_PATH = "identifiers"; | ||
|
|
||
| // w3c-dids | ||
| export const ETHR_DID_METHOD = "ethr"; | ||
| export const SUPPORTED_DID_AUTH = ["Secp256k1SignatureAuthentication2018"]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| export interface Identity { | ||
| identified: true; | ||
| ethereumAddress: string; | ||
| smartContract: string; | ||
| } | ||
|
|
||
| export interface DIDDocument { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can use some of the types/methods from here https://github.com/decentralized-identity/did-common-typescript/blob/master/lib/IDidDocument.ts
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually pulled direct from the did-resolver here: https://github.com/decentralized-identity/did-resolver/blob/02bdaf1687151bb934b10093042e576ed54b229c/src/resolver.ts#L15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it make sense to then install it as a dependency and use the exported types?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That feels like a good solution. Then also as types inevitably evolve we can just bump version of the package instead of having to replicate changes manually... I like it. |
||
| "@context": "https://w3id.org/did/v1"; | ||
| id: string; | ||
| publicKey: PublicKey[]; | ||
| authentication?: Authentication[]; | ||
| uportProfile?: any; | ||
| service?: ServiceEndpoint[]; | ||
| created?: string; | ||
| updated?: string; | ||
| proof?: LinkedDataProof; | ||
| } | ||
|
|
||
| export interface ServiceEndpoint { | ||
| id: string; | ||
| type: string; | ||
| serviceEndpoint: string; | ||
| description?: string; | ||
| } | ||
|
|
||
| export interface PublicKey { | ||
| id: string; | ||
| type: string; | ||
| owner: string; | ||
| ethereumAddress?: string; | ||
| publicKeyBase64?: string; | ||
| publicKeyBase58?: string; | ||
| publicKeyHex?: string; | ||
| publicKeyPem?: string; | ||
| } | ||
|
|
||
| export interface Authentication { | ||
| type: string; | ||
| publicKey: string[]; | ||
| } | ||
|
|
||
| export interface LinkedDataProof { | ||
| type: string; | ||
| created: string; | ||
| creator: string; | ||
| nonce: string; | ||
| signatureValue: string; | ||
| } | ||
|
|
||
| export interface Params { | ||
| [index: string]: string; | ||
| } | ||
|
|
||
| export interface ParsedDID { | ||
| did: string; | ||
| didUrl: string; | ||
| method: string; | ||
| id: string; | ||
| path?: string; | ||
| fragment?: string; | ||
| query?: string; | ||
| params?: Params; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually use axios with async/await