Skip to content

Commit

Permalink
feat: Adding createProfilePresentation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Oct 19, 2020
1 parent 86b6f9e commit ae5e73f
Show file tree
Hide file tree
Showing 20 changed files with 3,523 additions and 2,531 deletions.
143 changes: 143 additions & 0 deletions agent-alice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
server:
hostname: localhost
port: 3337
schemaPath: /open-api.json
apiBasePath: /agent
apiDocsPath: /api-docs
defaultIdentity:
create: true
messagingServiceEndpoint: /messaging
publicProfileServiceEndpoint: /public-profile
publicName: Alice
publicPicture: https://picsum.photos/200
ngrok:
connect: true
subdomain: alice-did
region: eu
# exposedMethods:
# - resolveDid
# - dataStoreORMGetIdentities
constants:
secretKey: 29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c
databaseFile: ./data/alice-database.sqlite
dbConnection:
$require: typeorm?t=function#createConnection
$args:
- type: sqlite
database:
$ref: /constants/databaseFile
synchronize: true
logging: false
entities:
$require: daf-typeorm?t=object#Entities
messageHandler:
$require: daf-message-handler#MessageHandler
$args:
- messageHandlers:
- $require: daf-did-comm#DIDCommMessageHandler
- $require: daf-did-jwt#JwtMessageHandler
- $require: daf-w3c#W3cMessageHandler
- $require: daf-selective-disclosure#SdrMessageHandler
agent:
$require: daf-core#Agent
$args:
- plugins:
- $require: daf-key-manager#KeyManager
$args:
- store:
$require: daf-typeorm#KeyStore
$args:
- $ref: /dbConnection
- $require: daf-libsodium#SecretBox
$args:
- $ref: /constants/secretKey
kms:
local:
$require: daf-libsodium#KeyManagementSystem
- $require: daf-identity-manager#IdentityManager
$args:
- store:
$require: daf-typeorm#IdentityStore
$args:
- $ref: /dbConnection
defaultProvider: did:ethr:rinkeby
providers:
did:ethr:
$require: daf-ethr-did#EthrIdentityProvider
$args:
- defaultKms: local
network: mainnet
rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 10001
ttl: 31104001
did:ethr:rinkeby:
$require: daf-ethr-did#EthrIdentityProvider
$args:
- defaultKms: local
network: rinkeby
rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 10001
ttl: 31104001
did:ethr:ropsten:
$require: daf-ethr-did#EthrIdentityProvider
$args:
- defaultKms: local
network: ropsten
rpcUrl: https://ropsten.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 10001
ttl: 31104001
did:ethr:kovan:
$require: daf-ethr-did#EthrIdentityProvider
$args:
- defaultKms: local
network: kovan
rpcUrl: https://kovan.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 10001
ttl: 31104001
did:ethr:goerli:
$require: daf-ethr-did#EthrIdentityProvider
$args:
- defaultKms: local
network: goerli
rpcUrl: https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 10001
ttl: 31104001
# did:elem:ropsten:
# $require: daf-elem-did#ElemIdentityProvider
# $args:
# - defaultKms: local
# network: ropsten
# apiUrl: https://element-did.com/api/v1/sidetree
did:web:
$require: daf-web-did#WebIdentityProvider
$args:
- defaultKms: local
- $require: daf-resolver#DafResolver
$args:
- networks:
- name: mainnet
rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
- name: rinkeby
rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
- name: ropsten
rpcUrl: https://ropsten.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
- name: kovan
rpcUrl: https://kovan.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
- name: goerli
rpcUrl: https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
- name: private
rpcUrl: http://localhost:8545/
registry: '0x05cc574b19a3c11308f761b3d7263bd8608bc532'
# - $require: daf-resolver-universal#DafUniversalResolver
# $args:
# - url: https://dev.uniresolver.io/1.0/identifiers/
- $require: daf-typeorm#DataStore
$args:
- $ref: /dbConnection
- $require: daf-typeorm#DataStoreORM
$args:
- $ref: /dbConnection
- $ref: /messageHandler
- $require: daf-did-comm#DIDComm
- $require: daf-w3c#CredentialIssuer
- $require: daf-selective-disclosure#SelectiveDisclosure
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [holder](./daf-selective-disclosure.icreateprofilecredentialsargs.holder.md)

## ICreateProfileCredentialsArgs.holder property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Holder DID

<b>Signature:</b>

```typescript
holder: string;
```
29 changes: 29 additions & 0 deletions docs/api/daf-selective-disclosure.icreateprofilecredentialsargs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md)

## ICreateProfileCredentialsArgs interface

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Profile data

<b>Signature:</b>

```typescript
export interface ICreateProfileCredentialsArgs
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [holder](./daf-selective-disclosure.icreateprofilecredentialsargs.holder.md) | string | <b><i>(BETA)</i></b> Holder DID |
| [name](./daf-selective-disclosure.icreateprofilecredentialsargs.name.md) | string | <b><i>(BETA)</i></b> Optional. Name |
| [picture](./daf-selective-disclosure.icreateprofilecredentialsargs.picture.md) | string | <b><i>(BETA)</i></b> Optional. Picture URL |
| [save](./daf-selective-disclosure.icreateprofilecredentialsargs.save.md) | boolean | <b><i>(BETA)</i></b> Save presentation |
| [send](./daf-selective-disclosure.icreateprofilecredentialsargs.send.md) | boolean | <b><i>(BETA)</i></b> Send presentation |
| [url](./daf-selective-disclosure.icreateprofilecredentialsargs.url.md) | string | <b><i>(BETA)</i></b> Optional. URL |
| [verifier](./daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md) | string | <b><i>(BETA)</i></b> Optional. Verifier DID |

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [name](./daf-selective-disclosure.icreateprofilecredentialsargs.name.md)

## ICreateProfileCredentialsArgs.name property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Optional. Name

<b>Signature:</b>

```typescript
name?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [picture](./daf-selective-disclosure.icreateprofilecredentialsargs.picture.md)

## ICreateProfileCredentialsArgs.picture property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Optional. Picture URL

<b>Signature:</b>

```typescript
picture?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [save](./daf-selective-disclosure.icreateprofilecredentialsargs.save.md)

## ICreateProfileCredentialsArgs.save property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Save presentation

<b>Signature:</b>

```typescript
save: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [send](./daf-selective-disclosure.icreateprofilecredentialsargs.send.md)

## ICreateProfileCredentialsArgs.send property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Send presentation

<b>Signature:</b>

```typescript
send: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [url](./daf-selective-disclosure.icreateprofilecredentialsargs.url.md)

## ICreateProfileCredentialsArgs.url property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Optional. URL

<b>Signature:</b>

```typescript
url?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) &gt; [verifier](./daf-selective-disclosure.icreateprofilecredentialsargs.verifier.md)

## ICreateProfileCredentialsArgs.verifier property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Optional. Verifier DID

<b>Signature:</b>

```typescript
verifier?: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [ISelectiveDisclosure](./daf-selective-disclosure.iselectivedisclosure.md) &gt; [createProfilePresentation](./daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md)

## ISelectiveDisclosure.createProfilePresentation() method

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
<b>Signature:</b>

```typescript
createProfilePresentation(args: ICreateProfileCredentialsArgs, context: IAgentContext<ICredentialIssuer & IIdentityManager>): Promise<VerifiablePresentation>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| args | [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) | |
| context | [IAgentContext](./daf-core.iagentcontext.md)<!-- -->&lt;[ICredentialIssuer](./daf-w3c.icredentialissuer.md) &amp; [IIdentityManager](./daf-core.iidentitymanager.md)<!-- -->&gt; | |

<b>Returns:</b>

Promise&lt;[VerifiablePresentation](./daf-core.verifiablepresentation.md)<!-- -->&gt;

1 change: 1 addition & 0 deletions docs/api/daf-selective-disclosure.iselectivedisclosure.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ See [Selective Disclosure Request](https://github.com/uport-project/specs/blob/d
| Method | Description |
| --- | --- |
| [createProfilePresentation(args, context)](./daf-selective-disclosure.iselectivedisclosure.createprofilepresentation.md) | <b><i>(BETA)</i></b> |
| [createSelectiveDisclosureRequest(args, context)](./daf-selective-disclosure.iselectivedisclosure.createselectivedisclosurerequest.md) | <b><i>(BETA)</i></b> |
| [getVerifiableCredentialsForSdr(args, context)](./daf-selective-disclosure.iselectivedisclosure.getverifiablecredentialsforsdr.md) | <b><i>(BETA)</i></b> |
| [validatePresentationAgainstSdr(args, context)](./daf-selective-disclosure.iselectivedisclosure.validatepresentationagainstsdr.md) | <b><i>(BETA)</i></b> |
Expand Down
1 change: 1 addition & 0 deletions docs/api/daf-selective-disclosure.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Provides a [plugin](./daf-selective-disclosure.iselectivedisclosure.md) for the

| Interface | Description |
| --- | --- |
| [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) | <b><i>(BETA)</i></b> Profile data |
| [ICreateSelectiveDisclosureRequestArgs](./daf-selective-disclosure.icreateselectivedisclosurerequestargs.md) | <b><i>(BETA)</i></b> Contains the parameters of a Selective Disclosure Request. |
| [ICredentialRequestInput](./daf-selective-disclosure.icredentialrequestinput.md) | <b><i>(BETA)</i></b> Describes a particular credential that is being requested |
| [ICredentialsForSdr](./daf-selective-disclosure.icredentialsforsdr.md) | <b><i>(BETA)</i></b> The credentials that make up a response of a Selective Disclosure |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [daf-selective-disclosure](./daf-selective-disclosure.md) &gt; [SelectiveDisclosure](./daf-selective-disclosure.selectivedisclosure.md) &gt; [createProfilePresentation](./daf-selective-disclosure.selectivedisclosure.createprofilepresentation.md)

## SelectiveDisclosure.createProfilePresentation() method

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Creates profile credentials

<b>Signature:</b>

```typescript
createProfilePresentation(args: ICreateProfileCredentialsArgs, context: IAgentContext<ICredentialIssuer & IIdentityManager>): Promise<VerifiablePresentation>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| args | [ICreateProfileCredentialsArgs](./daf-selective-disclosure.icreateprofilecredentialsargs.md) | |
| context | [IAgentContext](./daf-core.iagentcontext.md)<!-- -->&lt;[ICredentialIssuer](./daf-w3c.icredentialissuer.md) &amp; [IIdentityManager](./daf-core.iidentitymanager.md)<!-- -->&gt; | |

<b>Returns:</b>

Promise&lt;[VerifiablePresentation](./daf-core.verifiablepresentation.md)<!-- -->&gt;

Loading

0 comments on commit ae5e73f

Please sign in to comment.