-
Notifications
You must be signed in to change notification settings - Fork 1
/
agent.yml
282 lines (262 loc) · 8.65 KB
/
agent.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
##
## This is an example configuration that uses the plugin and customizations from this template
## alongside other default plugins to create an agent using `@veramo/cli`.
##
## Look for the `template: ` prefix in comments to see where things fit
##
version: 3.0
constants:
baseUrl: http://localhost:3335
port: 3335
# please use your own X25519 key, this is only an example
secretKey: 29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c
databaseFile: ./database.sqlite
methods:
# This is the list of methods that may be executed on this agent.
# Methods that are NOT listed here cannot be executed, even if the plugins that implement them are installed.
- keyManagerGetKeyManagementSystems
- keyManagerCreate
- keyManagerGet
- keyManagerDelete
- keyManagerImport
- keyManagerEncryptJWE
- keyManagerDecryptJWE
- keyManagerSign
- keyManagerSharedSecret
- keyManagerSignJWT
- keyManagerSignEthTX
- didManagerGetProviders
- didManagerFind
- didManagerGet
- didManagerCreate
- didManagerGetOrCreate
- didManagerImport
- didManagerDelete
- didManagerAddKey
- didManagerRemoveKey
- didManagerAddService
- didManagerRemoveService
- resolveDid
- getDIDComponentById
- dataStoreGetMessage
- dataStoreSaveMessage
- dataStoreGetVerifiableCredential
- dataStoreSaveVerifiableCredential
- dataStoreGetVerifiablePresentation
- dataStoreSaveVerifiablePresentation
- dataStoreORMGetIdentifiers
- dataStoreORMGetIdentifiersCount
- dataStoreORMGetMessages
- dataStoreORMGetMessagesCount
- dataStoreORMGetVerifiableCredentialsByClaims
- dataStoreORMGetVerifiableCredentialsByClaimsCount
- dataStoreORMGetVerifiableCredentials
- dataStoreORMGetVerifiableCredentialsCount
- dataStoreORMGetVerifiablePresentations
- dataStoreORMGetVerifiablePresentationsCount
- handleMessage
- packDIDCommMessage
- unpackDIDCommMessage
- sendDIDCommMessage
- sendMessageDIDCommAlpha1
- createVerifiablePresentation
- createVerifiableCredential
- createSelectiveDisclosureRequest
- getVerifiableCredentialsForSdr
- validatePresentationAgainstSdr
# template: add your plugin methods here too. This assumes that your plugin is added to the agent. See below, toward the end of this config file.
- createVerifiableCredentialEIP712
# Database
dbConnection:
$require: typeorm?t=function#createConnection
$args:
- type: sqlite
database:
$ref: /constants/databaseFile
synchronize: false
migrationsRun: true
migrations:
$require: '@veramo/data-store?t=object#migrations'
logging: false
entities:
$require: '@veramo/data-store?t=object#Entities'
# Server configuration
server:
baseUrl:
$ref: /constants/baseUrl
port:
$ref: /constants/port
use:
# CORS
- - $require: 'cors'
# Add agent to the request object
- - $require: '@veramo/remote-server?t=function#RequestWithAgentRouter'
$args:
- agent:
$ref: /agent
# DID Documents
- - $require: '@veramo/remote-server?t=function#WebDidDocRouter'
# API base path
- - /messaging
- $require: '@veramo/remote-server?t=function#MessagingRouter'
$args:
- metaData:
type: DIDComm
value: https
# API base path
- - /agent
- $require: '@veramo/remote-server?t=function#apiKeyAuth'
$args:
# Please configure your own API key. This is used when executing agent methods through ${baseUrl}/agent or ${baseUrl}/api-docs
- apiKey: test123
- $require: '@veramo/remote-server?t=function#AgentRouter'
$args:
- exposedMethods:
$ref: /constants/methods
# Open API schema
- - /open-api.json
- $require: '@veramo/remote-server?t=function#ApiSchemaRouter'
$args:
- basePath: :3335/agent
securityScheme: bearer
apiName: Agent
apiVersion: '1.0.0'
exposedMethods:
$ref: /constants/methods
# Swagger docs
- - /api-docs
- $require: swagger-ui-express?t=object#serve
- $require: swagger-ui-express?t=function#setup
$args:
- null
- swaggerOptions:
url: '/open-api.json'
# Execute during server initialization
init:
- $require: '@veramo/remote-server?t=function#createDefaultDid'
$args:
- agent:
$ref: /agent
baseUrl:
$ref: /constants/baseUrl
messagingServiceEndpoint: /messaging
# Message handler plugin
messageHandler:
$require: '@veramo/message-handler#MessageHandler'
$args:
- messageHandlers:
# order matters
- $require: '@veramo/did-comm#DIDCommMessageHandler'
- $require: '@veramo/did-jwt#JwtMessageHandler'
- $require: '@veramo/credential-w3c#W3cMessageHandler'
- $require: '@veramo/selective-disclosure#SdrMessageHandler'
# DID resolvers
didResolver:
$require: '@veramo/did-resolver#DIDResolverPlugin'
$args:
- resolver:
$require: did-resolver#Resolver
$args:
- ethr:
$ref: /ethr-did-resolver
web:
$ref: /web-did-resolver
key:
$ref: /did-key-resolver
elem:
$ref: /universal-resolver
io:
$ref: /universal-resolver
ion:
$ref: /universal-resolver
sov:
$ref: /universal-resolver
ethr-did-resolver:
$require: ethr-did-resolver?t=function&p=/ethr#getResolver
$args:
- infuraProjectId: 5ffc47f65c4042ce847ef66a3fa70d4c
web-did-resolver:
$require: web-did-resolver?t=function&p=/web#getResolver
universal-resolver:
$require: '@veramo/did-resolver#UniversalResolver'
$args:
- url: https://dev.uniresolver.io/1.0/identifiers/
did-key-resolver:
$require: '@veramo/did-provider-key?t=function&p=/key#getDidKeyResolver'
# Key Manager
keyManager:
$require: '@veramo/key-manager#KeyManager'
$args:
- store:
$require: '@veramo/data-store#KeyStore' # template: or you can use './build#MyKeyStore' instead
$args:
- $ref: /dbConnection
kms:
local:
$require: '@veramo/kms-local#KeyManagementSystem'
$args:
- $require: '@veramo/data-store#PrivateKeyStore' # template: or you can use './build#MyPrivateKeyStore' instead
$args:
- $ref: /dbConnection
- $require: '@veramo/kms-local#SecretBox'
$args:
- $ref: /constants/secretKey
# template: you can install your own Key Management System implementation too
my:
$require: ./build#MyKeyManagementSystem
# DID Manager
didManager:
$require: '@veramo/did-manager#DIDManager'
$args:
- store:
$require: '@veramo/data-store#DIDStore' # template: or you can use './build#MyDIDStore'
$args:
- $ref: /dbConnection
defaultProvider: did:ethr:rinkeby
providers:
# template: you can install your customized DID provider like so
did:my:
$require: ./build#MyIdentifierProvider
$args:
- defaultKms: local
did:ethr:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: mainnet
rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 1000001
ttl: 31104001
did:ethr:rinkeby:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: rinkeby
rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
gas: 1000001
ttl: 31104001
did:web:
$require: '@veramo/did-provider-web#WebDIDProvider'
$args:
- defaultKms: local
# Agent
agent:
$require: '@veramo/core#Agent'
$args:
- schemaValidation: false
plugins:
- $ref: /keyManager
- $ref: /didManager
- $ref: /didResolver
- $ref: /messageHandler
- $require: '@veramo/did-comm#DIDComm'
- $require: '@veramo/credential-w3c#CredentialIssuer'
- $require: '@veramo/selective-disclosure#SelectiveDisclosure'
- $require: '@veramo/data-store#DataStore'
$args:
- $ref: /dbConnection
- $require: '@veramo/data-store#DataStoreORM'
$args:
- $ref: /dbConnection
# template: install your plugin on the `@veramo/cli` agent
- $require: ./build/agent/CredentialEIP712