Skip to content

Commit

Permalink
feat: verifiable presentation poc
Browse files Browse the repository at this point in the history
  • Loading branch information
Harasz committed Mar 28, 2022
1 parent a97b006 commit 29d8a36
Show file tree
Hide file tree
Showing 32 changed files with 1,634 additions and 679 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Deploy

on:
push:
branches: ["develop", "master"]
branches: ['develop', 'master']
pull_request:
branches: ["develop", "master"]

jobs:
cancel-previous:
name: "Cancel Previous Runs"
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
Expand All @@ -26,7 +25,7 @@ jobs:
token: ${{ secrets.SECRET_NAME }}
- uses: actions/setup-node@v2-beta
with:
node-version: "16.10.0"
node-version: '16.10.0'
registry-url: https://registry.npmjs.org/

- name: Configure Git
Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/ClaimsService.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ ___

getUserClaims

**`description`** get user claims
**`description`** get published offchain claims

#### Parameters

Expand Down
105 changes: 32 additions & 73 deletions docs/api/classes/VerifiableCredentialsServiceBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@

- [constructor](VerifiableCredentialsServiceBase.md#constructor)

### Properties

- [completeIssueCredential](VerifiableCredentialsServiceBase.md#completeissuecredential)
- [prepareIssueCredential](VerifiableCredentialsServiceBase.md#prepareissuecredential)
- [verifyCredential](VerifiableCredentialsServiceBase.md#verifycredential)

### Methods

- [signVerifiableCredential](VerifiableCredentialsServiceBase.md#signverifiablecredential)
- [verifyVerifiableCredential](VerifiableCredentialsServiceBase.md#verifyverifiablecredential)
- [createPresentation](VerifiableCredentialsServiceBase.md#createpresentation)
- [createVerifiableCredential](VerifiableCredentialsServiceBase.md#createverifiablecredential)
- [createVerifiablePresentation](VerifiableCredentialsServiceBase.md#createverifiablepresentation)
- [verify](VerifiableCredentialsServiceBase.md#verify)
- [create](VerifiableCredentialsServiceBase.md#create)

## Constructors
Expand All @@ -30,116 +26,79 @@
| :------ | :------ |
| `_signerService` | [`SignerService`](SignerService.md) |

## Properties

### completeIssueCredential

`Abstract` **completeIssueCredential**: (`credential`: `string`, `preparation`: `string`, `signature`: `string`) => `Promise`<`string`\>
## Methods

#### Type declaration
### createPresentation

(`credential`, `preparation`, `signature`): `Promise`<`string`\>
**createPresentation**(`verifiableCredential`, `options?`): [`Presentation`](../interfaces/Presentation.md)

##### Parameters
#### Parameters

| Name | Type |
| :------ | :------ |
| `credential` | `string` |
| `preparation` | `string` |
| `signature` | `string` |
| `verifiableCredential` | [`VerifiableCredential`](../interfaces/VerifiableCredential.md)<[`EWFCredentialSubject`](../interfaces/EWFCredentialSubject.md)\>[] |
| `options?` | [`CreatePresentationParams`](../interfaces/CreatePresentationParams.md) |

##### Returns
#### Returns

`Promise`<`string`\>
[`Presentation`](../interfaces/Presentation.md)

___

### prepareIssueCredential
### createVerifiableCredential

`Abstract` **prepareIssueCredential**: (`credential`: `string`, `linked_data_proof_options`: `string`, `public_key`: `string`) => `Promise`<`string`\>
**createVerifiableCredential**(`credentialOptions`, `options?`): `Promise`<[`VerifiableCredential`](../interfaces/VerifiableCredential.md)<[`EWFCredentialSubject`](../interfaces/EWFCredentialSubject.md)\>\>

#### Type declaration

▸ (`credential`, `linked_data_proof_options`, `public_key`): `Promise`<`string`\>

##### Parameters
#### Parameters

| Name | Type |
| :------ | :------ |
| `credential` | `string` |
| `linked_data_proof_options` | `string` |
| `public_key` | `string` |
| `credentialOptions` | [`CreateCredentialParams`](../interfaces/CreateCredentialParams.md) |
| `options?` | [`ProofOptions`](../interfaces/ProofOptions.md) |

##### Returns
#### Returns

`Promise`<`string`\>
`Promise`<[`VerifiableCredential`](../interfaces/VerifiableCredential.md)<[`EWFCredentialSubject`](../interfaces/EWFCredentialSubject.md)\>\>

___

### verifyCredential

`Abstract` **verifyCredential**: (`vc`: `string`, `proof_options`: `string`) => `Promise`<`string`\>

#### Type declaration

▸ (`vc`, `proof_options`): `Promise`<`string`\>
### createVerifiablePresentation

##### Parameters

| Name | Type |
| :------ | :------ |
| `vc` | `string` |
| `proof_options` | `string` |

##### Returns

`Promise`<`string`\>

## Methods

### signVerifiableCredential

**signVerifiableCredential**<`T`\>(`credential`, `options?`): `Promise`<[`SignedVerifiableCredential`](../interfaces/SignedVerifiableCredential.md)<`T`\>\>

#### Type parameters

| Name |
| :------ |
| `T` |
**createVerifiablePresentation**(`verifiableCredential`, `options?`): `Promise`<[`VerifiablePresentation`](../interfaces/VerifiablePresentation.md)\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `credential` | [`VerifiableCredential`](../interfaces/VerifiableCredential.md)<`T`\> |
| `options?` | [`SignVerifiableCredentialOptions`](../interfaces/SignVerifiableCredentialOptions.md) |
| `verifiableCredential` | [`VerifiableCredential`](../interfaces/VerifiableCredential.md)<[`EWFCredentialSubject`](../interfaces/EWFCredentialSubject.md)\>[] |
| `options?` | [`ProofOptions`](../interfaces/ProofOptions.md) |

#### Returns

`Promise`<[`SignedVerifiableCredential`](../interfaces/SignedVerifiableCredential.md)<`T`\>\>
`Promise`<[`VerifiablePresentation`](../interfaces/VerifiablePresentation.md)\>

___

### verifyVerifiableCredential
### verify

**verifyVerifiableCredential**<`T`\>(`vc`, `options?`): `Promise`<`boolean`\>
**verify**<`T`\>(`vp`, `options?`): `any`

#### Type parameters

| Name |
| :------ |
| `T` |
| Name | Type |
| :------ | :------ |
| `T` | extends `ICredentialSubject` |

#### Parameters

| Name | Type |
| :------ | :------ |
| `vc` | [`SignedVerifiableCredential`](../interfaces/SignedVerifiableCredential.md)<`T`\> |
| `options?` | [`VerifyVerifiableCredentialOptions`](../interfaces/VerifyVerifiableCredentialOptions.md) |
| `vp` | [`VerifiablePresentation`](../interfaces/VerifiablePresentation.md) \| [`VerifiableCredential`](../interfaces/VerifiableCredential.md)<`T`\> |
| `options?` | [`ProofOptions`](../interfaces/ProofOptions.md) |

#### Returns

`Promise`<`boolean`\>
`any`

___

Expand Down
34 changes: 34 additions & 0 deletions docs/api/interfaces/CreateCredentialParams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Interface: CreateCredentialParams

## Table of contents

### Properties

- [issuerFields](CreateCredentialParams.md#issuerfields)
- [namespace](CreateCredentialParams.md#namespace)
- [subject](CreateCredentialParams.md#subject)
- [version](CreateCredentialParams.md#version)

## Properties

### issuerFields

`Optional` **issuerFields**: [`IssuerFields`](IssuerFields.md)[]

___

### namespace

**namespace**: `string`

___

### subject

**subject**: `string`

___

### version

**version**: `string`
13 changes: 13 additions & 0 deletions docs/api/interfaces/CreatePresentationParams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Interface: CreatePresentationParams

## Table of contents

### Properties

- [presentationDefinition](CreatePresentationParams.md#presentationdefinition)

## Properties

### presentationDefinition

`Optional` **presentationDefinition**: `IPresentationDefinition`
31 changes: 31 additions & 0 deletions docs/api/interfaces/Credential.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Interface: Credential<T\>

## Type parameters

| Name | Type |
| :------ | :------ |
| `T` | extends `ICredentialSubject` |

## Hierarchy

- `IJsonLdCredential`

**`Credential`**

↳↳ [`VerifiableCredential`](VerifiableCredential.md)

## Table of contents

### Properties

- [credentialSubject](Credential.md#credentialsubject)

## Properties

### credentialSubject

**credentialSubject**: `T`

#### Overrides

IJsonLdCredential.credentialSubject
44 changes: 44 additions & 0 deletions docs/api/interfaces/EWFCredentialSubject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Interface: EWFCredentialSubject

## Hierarchy

- `ICredentialSubject`

**`EWFCredentialSubject`**

## Table of contents

### Properties

- [id](EWFCredentialSubject.md#id)
- [issuerFields](EWFCredentialSubject.md#issuerfields)
- [role](EWFCredentialSubject.md#role)

## Properties

### id

**id**: `string`

#### Overrides

ICredentialSubject.id

___

### issuerFields

**issuerFields**: [`IssuerFields`](IssuerFields.md)[]

___

### role

**role**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `namespace` | `string` |
| `version` | `string` |
20 changes: 20 additions & 0 deletions docs/api/interfaces/IssuerFields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Interface: IssuerFields

## Table of contents

### Properties

- [key](IssuerFields.md#key)
- [value](IssuerFields.md#value)

## Properties

### key

**key**: `string`

___

### value

**value**: `string` \| `number`
32 changes: 32 additions & 0 deletions docs/api/interfaces/Presentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Interface: Presentation

## Hierarchy

- `IPresentation`

**`Presentation`**

↳↳ [`VerifiablePresentation`](VerifiablePresentation.md)

## Table of contents

### Properties

- [id](Presentation.md#id)
- [verifiableCredential](Presentation.md#verifiablecredential)

## Properties

### id

**id**: `string`

___

### verifiableCredential

**verifiableCredential**: [`VerifiableCredential`](VerifiableCredential.md)<`ICredentialSubject`\>[]

#### Overrides

IPresentation.verifiableCredential
Loading

0 comments on commit 29d8a36

Please sign in to comment.