@affinidi/cli 1.41.2 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +289 -142
- package/dist/commands/analytics.d.ts +4 -0
- package/dist/commands/analytics.js +19 -0
- package/dist/commands/analytics.js.map +1 -1
- package/dist/commands/config/index.d.ts +7 -0
- package/dist/commands/config/index.js +46 -0
- package/dist/commands/config/index.js.map +1 -1
- package/dist/commands/config/username.d.ts +18 -0
- package/dist/commands/config/username.js +91 -0
- package/dist/commands/config/username.js.map +1 -0
- package/dist/commands/config/view.js +1 -1
- package/dist/commands/config/view.js.map +1 -1
- package/dist/commands/login/index.js +20 -6
- package/dist/commands/login/index.js.map +1 -1
- package/dist/errors/index.d.ts +2 -1
- package/dist/errors/index.js +3 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/services/analytics/analytics.api.d.ts +1 -1
- package/dist/services/analytics/analytics.api.js.map +1 -1
- package/dist/services/config/index.d.ts +9 -0
- package/dist/services/config/index.js +55 -3
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/verification/verifier.api.d.ts +1 -1
- package/dist/services/verification/verifier.api.js +1 -1
- package/dist/user-actions/prompts.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
# Affinidi CLI
|
|
2
|
-
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
2
|
+
|
|
3
|
+
[Introduction](#introduction)
|
|
4
|
+
[Features](#features)
|
|
5
|
+
[Installation](#installation)
|
|
6
|
+
[Quick Start](#quick-start)
|
|
7
|
+
[CLI Commands](#cli-commands)
|
|
8
|
+
[About Schemas and Verifiable Credentials](#about-schemas-and-verifiable-credentials)
|
|
9
|
+
[Feedback & Support](#feedback--support)
|
|
9
10
|
[FAQ](#faq)
|
|
10
11
|
|
|
11
|
-
#
|
|
12
|
+
#
|
|
13
|
+
|
|
12
14
|
## Introduction
|
|
15
|
+
|
|
13
16
|
Affinidi’s vision is to empower communities with control and ownership of their data,
|
|
14
17
|
creating new business models and greater trust.
|
|
15
18
|
|
|
@@ -18,7 +21,8 @@ becoming increasingly important for developers to better manage data privacy and
|
|
|
18
21
|
within their apps. With our tooling, you can start creating a privacy-preserving app within minutes.
|
|
19
22
|
|
|
20
23
|
### What are privacy-preserving apps?
|
|
21
|
-
|
|
24
|
+
|
|
25
|
+
Privacy-preserving apps make it easy to give your customers more control over how their information is used and shared. We enable this data ownership and control through Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs).
|
|
22
26
|
|
|
23
27
|
Learn more about [VCs](https://academy.affinidi.com/what-are-verifiable-credentials-79f1846a7b9), [trust triangle](https://academy.affinidi.com/what-is-the-trust-triangle-9a9caf36b321), [Decentralized Identifiers (DIDs)](https://academy.affinidi.com/demystifying-decentralized-identifiers-dids-2dc6fc3148fd), and [selective disclosure](https://academy.affinidi.com/a-detailed-guide-on-selective-disclosure-87b89cea1602).
|
|
24
28
|
|
|
@@ -26,95 +30,118 @@ Learn more about [VCs](https://academy.affinidi.com/what-are-verifiable-credenti
|
|
|
26
30
|
|
|
27
31
|
|
|
28
32
|
## Features
|
|
29
|
-
|
|
33
|
+
|
|
34
|
+
The following features are available through Affinidi CLI:
|
|
35
|
+
|
|
30
36
|
### Affinidi account
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
|
|
38
|
+
- create and manage your Affinidi account
|
|
39
|
+
- create projects, to better organise and manage what you are building
|
|
40
|
+
- access your API keys
|
|
34
41
|
|
|
35
42
|
### Schemas
|
|
36
|
-
|
|
43
|
+
|
|
44
|
+
- create and manage schemas, which serve as templates to issue credentials
|
|
37
45
|
|
|
38
46
|
### Verifiable Credentials (VCs)
|
|
39
|
-
|
|
47
|
+
|
|
48
|
+
VCs are tamper-evident credentials that can be verified cryptographically.
|
|
40
49
|
With Affinidi CLI you can:
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
|
|
51
|
+
- issue VCs in bulk or individually
|
|
52
|
+
- verify VCs
|
|
43
53
|
|
|
44
54
|
### Reference App
|
|
55
|
+
|
|
45
56
|
Generate a ready-to-use application that provides a web interface for:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
|
|
58
|
+
- issuing VCs
|
|
59
|
+
- claiming and managing VCs
|
|
60
|
+
- verifying VCs
|
|
61
|
+
|
|
50
62
|
|
|
51
63
|
|
|
64
|
+
|
|
52
65
|
#
|
|
66
|
+
|
|
53
67
|
## Installation
|
|
68
|
+
|
|
54
69
|
### Prerequisites:
|
|
55
70
|
|
|
56
71
|
You need to have installed on your machine:
|
|
72
|
+
|
|
57
73
|
- [git](https://git-scm.com/)
|
|
58
74
|
- [NodeJs](https://nodejs.org). (it's recommended to use [nvm](https://github.com/nvm-sh/nvm))
|
|
59
75
|
|
|
60
|
-
|
|
61
76
|
Run the installation command:
|
|
77
|
+
|
|
62
78
|
```
|
|
63
79
|
npm install -g @affinidi/cli
|
|
64
80
|
```
|
|
65
|
-
|
|
66
81
|
|
|
82
|
+
|
|
67
83
|
|
|
68
84
|
## Quick Start
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
|
|
86
|
+
To start using our privacy-preserving tools, please follow the next two steps:
|
|
87
|
+
|
|
88
|
+
1. authenticate by creating an account, or logging in to your account if you already have one
|
|
71
89
|
2. create a project, or activate a project if you already created one
|
|
90
|
+
|
|
72
91
|
### Authentication:
|
|
92
|
+
|
|
73
93
|
You will need your email address, and then the code sent to your email to confirm authentication.
|
|
74
94
|
|
|
75
95
|
To create an account:
|
|
96
|
+
|
|
76
97
|
```
|
|
77
98
|
affinidi sign-up
|
|
78
99
|
```
|
|
100
|
+
|
|
79
101
|
If you already have an account:
|
|
102
|
+
|
|
80
103
|
```
|
|
81
104
|
affinidi login
|
|
82
105
|
```
|
|
83
106
|
|
|
84
|
-
Full reference for each command can be found here:
|
|
85
|
-
[`sign-up`](#affinidi-sign-up)
|
|
107
|
+
Full reference for each command can be found here:
|
|
108
|
+
[`sign-up`](#affinidi-sign-up)
|
|
86
109
|
[`login`](#affinidi-login)
|
|
87
110
|
|
|
88
|
-
|
|
89
111
|
### Create or activate a project:
|
|
112
|
+
|
|
90
113
|
The `create` command creates and activates a project. Follow the prompts to choose a name or add a name directly after the command.
|
|
114
|
+
|
|
91
115
|
```
|
|
92
116
|
affinidi create project
|
|
93
117
|
```
|
|
94
118
|
|
|
95
119
|
The `use` command activates an already existing project:
|
|
120
|
+
|
|
96
121
|
```
|
|
97
122
|
affinidi use project [<project-id>]
|
|
98
123
|
```
|
|
99
124
|
|
|
100
|
-
You can also simply type this and follow the prompts to choose from a list of existing projects:
|
|
125
|
+
You can also simply type this and follow the prompts to choose from a list of existing projects:
|
|
126
|
+
|
|
101
127
|
```
|
|
102
128
|
affinidi use project
|
|
103
129
|
```
|
|
104
|
-
|
|
105
|
-
|
|
130
|
+
|
|
131
|
+
Full reference for each command can be found here:
|
|
132
|
+
[`create`](#affinidi-create)
|
|
106
133
|
[`use`](#affinidi-use)
|
|
107
134
|
|
|
108
135
|
### Schemas
|
|
136
|
+
|
|
109
137
|
To issue a VC you first have to create a schema or choose an existing one:
|
|
110
138
|
|
|
111
|
-
1. A schema can be created using the `create` command. You will need to provide a
|
|
139
|
+
1. A schema can be created using the `create` command. You will need to provide a _schemaName_ and a _description_ in text format as well as a _source_ with the path to the json file with the schema properties.
|
|
112
140
|
|
|
113
141
|
```
|
|
114
142
|
$ affinidi create schema [schemaName] --description=<value> --source=<value>
|
|
115
143
|
```
|
|
116
144
|
|
|
117
|
-
|
|
118
145
|
2. To see available schemas:
|
|
119
146
|
|
|
120
147
|
```
|
|
@@ -123,16 +150,16 @@ To issue a VC you first have to create a schema or choose an existing one:
|
|
|
123
150
|
|
|
124
151
|
You will need the value of the property `jsonSchemaUrl` of the created or chosen schema to issue VCs.
|
|
125
152
|
|
|
126
|
-
Please see [About Schemas and Verifiable Credentials](#about-schemas-and-verifiable-credentials) for a detailed explanation on schema structures and how to create and find schemas using the [Schema Manager](https://affinidi-schema-manager.prod.affinity-project.org/api-docs/#).
|
|
127
|
-
Full reference for each command can be found here:
|
|
128
|
-
[`create`](#affinidi-create)
|
|
153
|
+
Please see [About Schemas and Verifiable Credentials](#about-schemas-and-verifiable-credentials) for a detailed explanation on schema structures and how to create and find schemas using the [Schema Manager](https://affinidi-schema-manager.prod.affinity-project.org/api-docs/#).
|
|
154
|
+
Full reference for each command can be found here:
|
|
155
|
+
[`create`](#affinidi-create)
|
|
129
156
|
[`list`](#affinidi-list)
|
|
130
157
|
|
|
131
|
-
|
|
132
158
|
### Verifiable Credentials
|
|
159
|
+
|
|
133
160
|
You can issue and verify VCs within Affinidi CLI.
|
|
134
161
|
|
|
135
|
-
1. To issue a VC you need to provide the
|
|
162
|
+
1. To issue a VC you need to provide the _email_ of the VC's owner, the `jsonSchemaUrl` of the _schema_ on which the VC is based, and a path to the json file with credential _data_.
|
|
136
163
|
|
|
137
164
|
```
|
|
138
165
|
$ affinidi issue-vc [EMAIL] --schema=<value> --data <value>
|
|
@@ -140,22 +167,26 @@ $ affinidi issue-vc [EMAIL] --schema=<value> --data <value>
|
|
|
140
167
|
|
|
141
168
|
Please see [How to structure a JSON file to issue a VC](#how-to-structure-a-json-file-to-issue-a-vc) for more details.
|
|
142
169
|
|
|
143
|
-
2. To verify a VC you need to provide a path to the json file with the credential
|
|
170
|
+
2. To verify a VC you need to provide a path to the json file with the credential _data_ to be verified.
|
|
144
171
|
|
|
145
172
|
```
|
|
146
|
-
$ affinidi verify-vc --data=<value>
|
|
173
|
+
$ affinidi verify-vc --data=<value>
|
|
147
174
|
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
[
|
|
175
|
+
|
|
176
|
+
Full reference for each command can be found here:
|
|
177
|
+
[issue-vc](#affinidi-issue-vc)
|
|
178
|
+
[verify-vc](#affinidi-verify-vc)
|
|
151
179
|
|
|
152
180
|
### Generate an application
|
|
153
|
-
|
|
181
|
+
|
|
182
|
+
The [Affinidi Reference App](https://github.com/affinidi/elements-reference-app-frontend) provides a simple web interface for issuing, claiming and verifying VCs. It can be quickly generated by typing:
|
|
154
183
|
|
|
155
184
|
```
|
|
156
185
|
$ affinidi generate-application
|
|
157
186
|
```
|
|
187
|
+
|
|
158
188
|
You can also specify a name with:
|
|
189
|
+
|
|
159
190
|
```
|
|
160
191
|
$ affinidi generate-application --name=<value>
|
|
161
192
|
```
|
|
@@ -167,26 +198,33 @@ For the full reference, please see the [`affinidi generate-application`](#affini
|
|
|
167
198
|
|
|
168
199
|
|
|
169
200
|
#
|
|
170
|
-
|
|
201
|
+
|
|
202
|
+
## CLI Commands
|
|
203
|
+
|
|
171
204
|
### **autocomplete**
|
|
205
|
+
|
|
172
206
|
Display autocomplete installation instructions.
|
|
173
207
|
|
|
174
208
|
USAGE
|
|
209
|
+
|
|
175
210
|
```
|
|
176
211
|
$ affinidi autocomplete [SHELL] [FLAGS]
|
|
177
212
|
```
|
|
178
213
|
|
|
179
214
|
ARGUMENTS
|
|
215
|
+
|
|
180
216
|
```
|
|
181
217
|
SHELL Shell type
|
|
182
218
|
```
|
|
183
219
|
|
|
184
220
|
FLAGS
|
|
221
|
+
|
|
185
222
|
```
|
|
186
223
|
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
187
224
|
```
|
|
188
225
|
|
|
189
226
|
EXAMPLES
|
|
227
|
+
|
|
190
228
|
```
|
|
191
229
|
$ affinidi autocomplete
|
|
192
230
|
|
|
@@ -198,77 +236,107 @@ EXAMPLES
|
|
|
198
236
|
```
|
|
199
237
|
|
|
200
238
|
You can also see the help for the command in the CLI:
|
|
239
|
+
|
|
201
240
|
```
|
|
202
241
|
$ affinidi autocomplete --help
|
|
203
242
|
```
|
|
204
243
|
|
|
205
|
-
### **affinidi config
|
|
244
|
+
### **affinidi config**
|
|
245
|
+
|
|
206
246
|
Use this command to configure the format of the output. Supported options are: `plaintext` and `json`.
|
|
207
247
|
|
|
208
248
|
USAGE
|
|
249
|
+
|
|
209
250
|
```
|
|
210
251
|
$ affinidi config SUBCOMMAND [ARGS]
|
|
211
252
|
```
|
|
212
253
|
|
|
213
254
|
SUBCOMMAND
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
view Configures the output view format
|
|
258
|
+
username Persists a username in config file to be used in the future when not providing a username when loggin in
|
|
214
259
|
```
|
|
215
|
-
view
|
|
216
|
-
```
|
|
217
260
|
|
|
218
261
|
EXAMPLES
|
|
219
262
|
Configures output in json format:
|
|
263
|
+
|
|
220
264
|
```
|
|
221
265
|
affinidi config view json
|
|
266
|
+
affinidi config username email@example.com
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
USERNAME FLAGS
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
273
|
+
-u, --unset-all remove username from config
|
|
222
274
|
```
|
|
223
275
|
|
|
224
276
|
You can also see the help for the command in the CLI:
|
|
277
|
+
|
|
225
278
|
```
|
|
226
279
|
affinidi config --help
|
|
227
280
|
```
|
|
281
|
+
|
|
228
282
|
### **affinidi create**
|
|
283
|
+
|
|
229
284
|
Use this command to create a new resource. Current supported resource types are:
|
|
285
|
+
|
|
230
286
|
- Affinidi project
|
|
231
287
|
- schema
|
|
232
288
|
|
|
233
289
|
USAGE
|
|
290
|
+
|
|
234
291
|
```
|
|
235
292
|
$ affinidi create SUBCOMMAND [ARGS...] [FLAGS]
|
|
236
293
|
```
|
|
237
294
|
|
|
238
295
|
SUBCOMMANDS
|
|
296
|
+
|
|
239
297
|
```
|
|
240
298
|
project Creates a new Affinidi project.
|
|
241
299
|
schema Creates a new schema for a verifiable credential.
|
|
242
300
|
```
|
|
243
301
|
|
|
244
302
|
To create a project:
|
|
303
|
+
|
|
245
304
|
```
|
|
246
305
|
$ affinidi create project [projectName]
|
|
247
306
|
```
|
|
307
|
+
|
|
248
308
|
Or simply type this and follow the prompts:
|
|
309
|
+
|
|
249
310
|
```
|
|
250
311
|
$ affinidi create project
|
|
251
312
|
```
|
|
313
|
+
|
|
252
314
|
Note: When a project is created, its API keys are displayed only once. Full project details are stored locally in `~/.affinidi/credentials.json`. This file is deleted at the end of the authenticated session.
|
|
253
315
|
|
|
254
316
|
PROJECT FLAGS
|
|
317
|
+
|
|
255
318
|
```
|
|
256
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
319
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
257
320
|
```
|
|
258
321
|
|
|
259
322
|
To create a schema:
|
|
323
|
+
|
|
260
324
|
```
|
|
261
325
|
$ affinidi create schema [schemaName] [FLAGS]
|
|
262
326
|
```
|
|
327
|
+
|
|
263
328
|
SCHEMA FLAGS
|
|
329
|
+
|
|
264
330
|
```
|
|
265
331
|
-d, --description=<value> (required) Description of schema
|
|
266
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
332
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
267
333
|
-p, --public=(true|false) [default: false] To specify if you want to create public or private schemas
|
|
268
|
-
-s, --source=<value> (required) Path to the json file with schema properties
|
|
269
|
-
|
|
270
|
-
|
|
334
|
+
-s, --source=<value> (required) Path to the json file with schema properties
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Please see [How to structure a schema](#how-to-structure-a-schema) for guidance on how to create the _source_ file.
|
|
271
338
|
EXAMPLES
|
|
339
|
+
|
|
272
340
|
```
|
|
273
341
|
$ affinidi create project "Example Project"
|
|
274
342
|
|
|
@@ -276,6 +344,7 @@ $ affinidi create schema "Example Name" -d "An example description" -s "/example
|
|
|
276
344
|
```
|
|
277
345
|
|
|
278
346
|
You can also see the help for the command in the CLI:
|
|
347
|
+
|
|
279
348
|
```
|
|
280
349
|
$ affinidi create --help
|
|
281
350
|
$ affinidi create project --help
|
|
@@ -283,86 +352,107 @@ $ affinidi create schema --help
|
|
|
283
352
|
```
|
|
284
353
|
|
|
285
354
|
### **affinidi generate-application**
|
|
286
|
-
|
|
355
|
+
|
|
356
|
+
Use this command to generate a privacy-preserving app. Please see [Affinidi Reference App](https://github.com/affinidi/elements-reference-app-frontend) for more details.
|
|
287
357
|
|
|
288
358
|
USAGE
|
|
359
|
+
|
|
289
360
|
```
|
|
290
361
|
$ affinidi generate-application [-n <value>] [-w]
|
|
291
362
|
```
|
|
363
|
+
|
|
292
364
|
FLAGS
|
|
365
|
+
|
|
293
366
|
```
|
|
294
367
|
-n, --name=<value> [default: my-app] Name of the application
|
|
295
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
368
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
296
369
|
-w, --with-proxy Add backend-proxy to protect credentials
|
|
297
370
|
```
|
|
298
371
|
|
|
299
372
|
You can use this to generate the application with the default values:
|
|
373
|
+
|
|
300
374
|
```
|
|
301
375
|
$ affinidi generate-application
|
|
302
376
|
```
|
|
303
377
|
|
|
304
378
|
EXAMPLES
|
|
379
|
+
|
|
305
380
|
```
|
|
306
381
|
$ affinidi generate-application -n ExampleApp
|
|
307
382
|
```
|
|
308
383
|
|
|
309
384
|
You can also see the help for the command in the CLI:
|
|
385
|
+
|
|
310
386
|
```
|
|
311
387
|
$ affinidi generate-application --help
|
|
312
388
|
```
|
|
389
|
+
|
|
313
390
|
### **affinidi help**
|
|
391
|
+
|
|
314
392
|
Display help for affinidi
|
|
315
393
|
|
|
316
394
|
USAGE
|
|
395
|
+
|
|
317
396
|
```
|
|
318
397
|
affinidi help
|
|
319
398
|
```
|
|
320
399
|
|
|
321
|
-
|
|
322
400
|
### **affinidi issue-vc**
|
|
401
|
+
|
|
323
402
|
Issues a verifiable credential based on a given schema
|
|
324
403
|
|
|
325
404
|
USAGE
|
|
405
|
+
|
|
326
406
|
```
|
|
327
407
|
$ affinidi issue-vc [EMAIL] [FLAGS]
|
|
328
408
|
```
|
|
329
409
|
|
|
330
410
|
FLAGS
|
|
411
|
+
|
|
331
412
|
```
|
|
332
413
|
-b, --bulk Defines that issuance happens in bulk
|
|
333
414
|
-d, --data=<value> (required) The source file with credential data, either .json or .csv
|
|
334
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
415
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
335
416
|
-s, --schema=<value> (required) Json schema url
|
|
336
417
|
-w, --wallet=<value> [default: https://wallet.affinidi.com/claim] Configure your own wallet to store VCs
|
|
337
418
|
```
|
|
338
419
|
|
|
339
420
|
EXAMPLES
|
|
421
|
+
|
|
340
422
|
```
|
|
341
423
|
$ affinidi issue-vc example@email.com -s "https://example.org/exampleSchema.json" -d "/exampleCredential.json"
|
|
342
424
|
|
|
343
425
|
```
|
|
426
|
+
|
|
344
427
|
You can also see the help for the command in the CLI:
|
|
428
|
+
|
|
345
429
|
```
|
|
346
430
|
$ affinidi issue-vc --help
|
|
347
431
|
```
|
|
432
|
+
|
|
348
433
|
### **affinidi list**
|
|
349
|
-
|
|
434
|
+
|
|
435
|
+
Use the list command to display resources that you have created or are available.
|
|
350
436
|
The current types of resources are:
|
|
437
|
+
|
|
351
438
|
- schemas
|
|
352
439
|
- projects
|
|
353
440
|
|
|
354
441
|
USAGE
|
|
442
|
+
|
|
355
443
|
```
|
|
356
444
|
$ affinidi list [SUBCOMMAND] [ARGS...] [FLAGS]
|
|
357
445
|
```
|
|
358
446
|
|
|
359
|
-
SUBCOMMANDS
|
|
360
|
-
|
|
447
|
+
SUBCOMMANDS
|
|
448
|
+
|
|
449
|
+
```
|
|
361
450
|
projects Shows you the list of your projects
|
|
362
451
|
schemas Shows a list of available schemas
|
|
363
452
|
```
|
|
364
453
|
|
|
365
454
|
FLAGS for project listing
|
|
455
|
+
|
|
366
456
|
```
|
|
367
457
|
-l, --limit=<value> [default: 10] Maximum number of projects which will be listed
|
|
368
458
|
-o, --output=(json|table|csv) [default: json] Project listing output format
|
|
@@ -371,7 +461,8 @@ FLAGS for project listing
|
|
|
371
461
|
```
|
|
372
462
|
|
|
373
463
|
FLAGS for schema listing
|
|
374
|
-
|
|
464
|
+
|
|
465
|
+
```
|
|
375
466
|
-c, --scope=(default|public|unlisted) [default: default] The type of scope
|
|
376
467
|
-l, --limit=<value> [default: 10] The number of schemas to display
|
|
377
468
|
-o, --output=(json|table|csv) [default: json] The type of output
|
|
@@ -386,7 +477,8 @@ FLAGS for schema listing
|
|
|
386
477
|
--sort=<value> property to sort by (prepend '-' for descending)
|
|
387
478
|
```
|
|
388
479
|
|
|
389
|
-
EXAMPLES
|
|
480
|
+
EXAMPLES
|
|
481
|
+
|
|
390
482
|
```
|
|
391
483
|
$ affinidi list projects
|
|
392
484
|
|
|
@@ -394,179 +486,220 @@ EXAMPLES
|
|
|
394
486
|
```
|
|
395
487
|
|
|
396
488
|
You can also see the help for the command in the CLI:
|
|
489
|
+
|
|
397
490
|
```
|
|
398
491
|
$ affinidi list --help
|
|
399
492
|
$ affinidi list projects --help
|
|
400
493
|
$ affinidi list schemas --help
|
|
401
494
|
```
|
|
402
495
|
|
|
403
|
-
|
|
404
496
|
### **affinidi login**
|
|
405
|
-
|
|
497
|
+
|
|
498
|
+
Log in with your email address to use Affinidi privacy-preserving services. You will receive a confirmation code via email, which you will need to complete the authentication.
|
|
406
499
|
|
|
407
500
|
USAGE
|
|
501
|
+
|
|
408
502
|
```
|
|
409
503
|
$ affinidi login [EMAIL]
|
|
410
504
|
```
|
|
411
505
|
|
|
412
|
-
You can also simply type this and follow the prompts:
|
|
506
|
+
You can also simply type this and follow the prompts:
|
|
507
|
+
|
|
413
508
|
```
|
|
414
509
|
$ affinidi login
|
|
415
510
|
```
|
|
416
511
|
|
|
417
512
|
FLAGS
|
|
513
|
+
|
|
418
514
|
```
|
|
419
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
515
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
420
516
|
```
|
|
421
517
|
|
|
422
518
|
You can also see the help for the command in the CLI:
|
|
519
|
+
|
|
423
520
|
```
|
|
424
521
|
$ affinidi login --help
|
|
425
522
|
```
|
|
523
|
+
|
|
426
524
|
### **affinidi logout**
|
|
525
|
+
|
|
427
526
|
Use this command to end your affinidi session
|
|
428
527
|
|
|
429
528
|
USAGE
|
|
529
|
+
|
|
430
530
|
```
|
|
431
531
|
$ affinidi logout
|
|
432
532
|
```
|
|
433
533
|
|
|
434
534
|
You can also see the help for the command in the CLI:
|
|
535
|
+
|
|
435
536
|
```
|
|
436
537
|
affinidi logout --help
|
|
437
538
|
```
|
|
438
539
|
|
|
439
540
|
FLAGS
|
|
541
|
+
|
|
440
542
|
```
|
|
441
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
543
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
442
544
|
```
|
|
443
545
|
|
|
444
|
-
|
|
546
|
+
### **affinidi show**
|
|
547
|
+
|
|
445
548
|
This command displays the details of a resource. The current available resource types are:
|
|
549
|
+
|
|
446
550
|
- project
|
|
447
551
|
- schema
|
|
448
552
|
|
|
449
553
|
USAGE
|
|
554
|
+
|
|
450
555
|
```
|
|
451
556
|
$ affinidi show [SUBCOMMAND] [ARG...] [FLAGS]
|
|
452
557
|
```
|
|
453
558
|
|
|
454
559
|
SUBCOMMANDS
|
|
560
|
+
|
|
455
561
|
```
|
|
456
562
|
project Shows information about a given project
|
|
457
563
|
schema Shows the details of a schema
|
|
458
564
|
```
|
|
459
565
|
|
|
460
566
|
FLAGS
|
|
567
|
+
|
|
461
568
|
```
|
|
462
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
569
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
463
570
|
```
|
|
464
571
|
|
|
465
572
|
To show a project:
|
|
573
|
+
|
|
466
574
|
```
|
|
467
|
-
$ affinidi show [<project-id>]
|
|
575
|
+
$ affinidi show [<project-id>]
|
|
468
576
|
```
|
|
469
|
-
|
|
577
|
+
|
|
578
|
+
if you simply type this, the CLI will prompt you to choose from a list of available projects:
|
|
579
|
+
|
|
470
580
|
```
|
|
471
581
|
$ affinidi show project
|
|
472
582
|
```
|
|
583
|
+
|
|
473
584
|
To show a schema:
|
|
585
|
+
|
|
474
586
|
```
|
|
475
587
|
$ affinidi show schema [<schema-id>] [--output json]
|
|
476
588
|
```
|
|
477
589
|
|
|
478
590
|
EXAMPLES
|
|
591
|
+
|
|
479
592
|
```
|
|
480
593
|
$ affinidi show project example-id
|
|
481
594
|
$ affinidi show schema example-id
|
|
482
|
-
|
|
595
|
+
```
|
|
483
596
|
|
|
484
597
|
You can also see the help for the command in the CLI:
|
|
598
|
+
|
|
485
599
|
```
|
|
486
600
|
$ affinidi show --help
|
|
487
601
|
$ affinidi show project --help
|
|
488
602
|
$ affinidi show schema --help
|
|
489
603
|
```
|
|
490
|
-
|
|
491
|
-
|
|
604
|
+
|
|
605
|
+
### **affinidi sign-up**
|
|
606
|
+
|
|
607
|
+
Create an Affinidi account with this command to use our privacy-preserving tools. You will need your email address, and then confirm the authentication with the code sent to your email.
|
|
492
608
|
|
|
493
609
|
USAGE
|
|
610
|
+
|
|
494
611
|
```
|
|
495
612
|
$ affinidi sign-up [EMAIL]
|
|
496
613
|
```
|
|
497
614
|
|
|
498
|
-
You can also simply type this and follow the prompts:
|
|
615
|
+
You can also simply type this and follow the prompts:
|
|
616
|
+
|
|
499
617
|
```
|
|
500
618
|
$ affinidi sign-up
|
|
501
619
|
```
|
|
502
620
|
|
|
503
621
|
You can also see the help for the command in the CLI:
|
|
622
|
+
|
|
504
623
|
```
|
|
505
624
|
$ affinidi sign-up --help
|
|
506
625
|
```
|
|
507
626
|
|
|
508
|
-
|
|
627
|
+
### **affinidi use**
|
|
628
|
+
|
|
509
629
|
The Use command lets you choose and activate a project. An active project is a prerequisite for executing most commands.
|
|
510
630
|
|
|
511
631
|
USAGE
|
|
632
|
+
|
|
512
633
|
```
|
|
513
634
|
$ affinidi use project [<project-id>] [FLAGS]
|
|
514
635
|
```
|
|
515
636
|
|
|
516
637
|
FLAGS
|
|
638
|
+
|
|
639
|
+
```
|
|
640
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view of the chosen project's details
|
|
517
641
|
```
|
|
518
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view of the chosen project's details
|
|
519
|
-
```
|
|
520
642
|
|
|
643
|
+
EXAMPLES
|
|
521
644
|
|
|
522
|
-
EXAMPLES
|
|
523
645
|
```
|
|
524
646
|
$ affinidi use project example-id
|
|
525
647
|
```
|
|
526
648
|
|
|
527
649
|
You can also see the help for the command in the CLI:
|
|
650
|
+
|
|
528
651
|
```
|
|
529
652
|
$ affinidi use --help
|
|
530
653
|
$ affinidi use project --help
|
|
531
654
|
```
|
|
532
655
|
|
|
533
|
-
|
|
656
|
+
### **affinidi verify-vc**
|
|
657
|
+
|
|
534
658
|
Verifies a verifiable credential
|
|
535
659
|
|
|
536
660
|
USAGE
|
|
661
|
+
|
|
537
662
|
```
|
|
538
663
|
$ affinidi verify-vc -d <value>
|
|
539
664
|
```
|
|
665
|
+
|
|
540
666
|
FLAGS
|
|
667
|
+
|
|
541
668
|
```
|
|
542
669
|
-d, --data=<value> (required) Source json file with credentials to be verified
|
|
543
|
-
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
670
|
+
-o, --output=(plaintext|json) [default: plaintext] Formats output view
|
|
544
671
|
```
|
|
672
|
+
|
|
545
673
|
EXAMPLES
|
|
674
|
+
|
|
546
675
|
```
|
|
547
676
|
$ affinidi verify-vc -d "/exampleVc.json"
|
|
548
677
|
```
|
|
549
678
|
|
|
550
679
|
You can also see the help for the command in the CLI:
|
|
680
|
+
|
|
551
681
|
```
|
|
552
682
|
$ affinidi verify-vc --help
|
|
553
683
|
```
|
|
554
|
-
|
|
555
684
|
|
|
556
685
|
|
|
557
686
|
|
|
687
|
+
|
|
558
688
|
|
|
559
689
|
#
|
|
690
|
+
|
|
560
691
|
## About Schemas and Verifiable Credentials
|
|
561
692
|
|
|
562
693
|
Schemas are representations of the properties that define a VC. They are a composite of [JSON Schema](https://json-schema.org/specification.html), [JSON-LD](https://www.w3.org/TR/json-ld11/) context and metadata (description, version and ownership). You can use Affinidi's [Schema Manager](https://affinidi-schema-manager.prod.affinity-project.org/api-docs) to find the right schema for your verifiable credential or to create a new one – either on the basis of an already existing schema,
|
|
563
|
-
or completely from scratch.
|
|
694
|
+
or completely from scratch.
|
|
564
695
|
|
|
565
696
|
### What is Affinidi's Schema Manager?
|
|
697
|
+
|
|
566
698
|
The Schema Manager provides URLs for two kinds of schema representations: JSON Schema and JSON-LD context.
|
|
567
699
|
Any schema can be referenced in a verifiable credential or an application by these URLs. Before creating a new schema for your verifiable credentials, it is recommended to search for an existing one, which may fit your purpose. There are both a number of standard schemas and some user-generated schemas already available in the Schema Manager, and you can search for them by “Credential schema type”. That is why it is important to provide a meaningful and expressive type for your newly created schemas.
|
|
568
700
|
|
|
569
701
|
### How to structure a schema
|
|
702
|
+
|
|
570
703
|
The JSON representation of a schema must follow this structure:
|
|
571
704
|
|
|
572
705
|
```
|
|
@@ -587,6 +720,7 @@ The JSON representation of a schema must follow this structure:
|
|
|
587
720
|
```
|
|
588
721
|
|
|
589
722
|
And here is an example of that structure used to represent a simple form with two fields (`First Name` and `Last Name`):
|
|
723
|
+
|
|
590
724
|
```
|
|
591
725
|
{
|
|
592
726
|
"type": "object",
|
|
@@ -608,8 +742,8 @@ And here is an example of that structure used to represent a simple form with tw
|
|
|
608
742
|
}
|
|
609
743
|
```
|
|
610
744
|
|
|
611
|
-
|
|
612
745
|
### What attribute types are available?
|
|
746
|
+
|
|
613
747
|
- Nested attribute – a container for attributes
|
|
614
748
|
- DID – a decentralized identifier
|
|
615
749
|
- Example of VC value: "did:example:123"
|
|
@@ -630,71 +764,73 @@ Example of schema source with all the types:
|
|
|
630
764
|
|
|
631
765
|
```json
|
|
632
766
|
{
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
"required": []
|
|
647
|
-
},
|
|
648
|
-
"didType": {
|
|
649
|
-
"title": "didType",
|
|
650
|
-
"type": "string",
|
|
651
|
-
"format": "did",
|
|
652
|
-
"description": "DID attribute"
|
|
653
|
-
},
|
|
654
|
-
"testType": {
|
|
655
|
-
"title": "testType",
|
|
656
|
-
"type": "string",
|
|
657
|
-
"description": "Text attribute"
|
|
658
|
-
},
|
|
659
|
-
"uriType": {
|
|
660
|
-
"title": "uriType",
|
|
661
|
-
"type": "string",
|
|
662
|
-
"format": "uri",
|
|
663
|
-
"description": "URI attribute"
|
|
664
|
-
},
|
|
665
|
-
"dateType": {
|
|
666
|
-
"title": "dateType",
|
|
667
|
-
"type": "string",
|
|
668
|
-
"format": "date",
|
|
669
|
-
"description": "Date attribute"
|
|
670
|
-
},
|
|
671
|
-
"dateTimeType": {
|
|
672
|
-
"title": "dateTimeType",
|
|
673
|
-
"type": "string",
|
|
674
|
-
"format": "date-time",
|
|
675
|
-
"description": "DateTime attribute"
|
|
676
|
-
},
|
|
677
|
-
"numberType": {
|
|
678
|
-
"title": "numberType",
|
|
679
|
-
"type": "number",
|
|
680
|
-
"description": "Number attribute"
|
|
681
|
-
},
|
|
682
|
-
"booleanType": {
|
|
683
|
-
"title": "booleanType",
|
|
684
|
-
"type": "boolean",
|
|
685
|
-
"description": "Boolean attribute"
|
|
767
|
+
"type": "object",
|
|
768
|
+
"properties": {
|
|
769
|
+
"nestedType": {
|
|
770
|
+
"title": "nestedType",
|
|
771
|
+
"type": "object",
|
|
772
|
+
"description": "Field with nested attributes",
|
|
773
|
+
"properties": {
|
|
774
|
+
"nestedTextType": {
|
|
775
|
+
"title": "nestedTextType",
|
|
776
|
+
"type": "string",
|
|
777
|
+
"description": "Nested text field "
|
|
686
778
|
}
|
|
779
|
+
},
|
|
780
|
+
"required": []
|
|
781
|
+
},
|
|
782
|
+
"didType": {
|
|
783
|
+
"title": "didType",
|
|
784
|
+
"type": "string",
|
|
785
|
+
"format": "did",
|
|
786
|
+
"description": "DID attribute"
|
|
787
|
+
},
|
|
788
|
+
"testType": {
|
|
789
|
+
"title": "testType",
|
|
790
|
+
"type": "string",
|
|
791
|
+
"description": "Text attribute"
|
|
792
|
+
},
|
|
793
|
+
"uriType": {
|
|
794
|
+
"title": "uriType",
|
|
795
|
+
"type": "string",
|
|
796
|
+
"format": "uri",
|
|
797
|
+
"description": "URI attribute"
|
|
798
|
+
},
|
|
799
|
+
"dateType": {
|
|
800
|
+
"title": "dateType",
|
|
801
|
+
"type": "string",
|
|
802
|
+
"format": "date",
|
|
803
|
+
"description": "Date attribute"
|
|
687
804
|
},
|
|
688
|
-
"
|
|
805
|
+
"dateTimeType": {
|
|
806
|
+
"title": "dateTimeType",
|
|
807
|
+
"type": "string",
|
|
808
|
+
"format": "date-time",
|
|
809
|
+
"description": "DateTime attribute"
|
|
810
|
+
},
|
|
811
|
+
"numberType": {
|
|
812
|
+
"title": "numberType",
|
|
813
|
+
"type": "number",
|
|
814
|
+
"description": "Number attribute"
|
|
815
|
+
},
|
|
816
|
+
"booleanType": {
|
|
817
|
+
"title": "booleanType",
|
|
818
|
+
"type": "boolean",
|
|
819
|
+
"description": "Boolean attribute"
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"required": []
|
|
689
823
|
}
|
|
690
|
-
|
|
691
824
|
```
|
|
825
|
+
|
|
692
826
|
### How to create or find a schema
|
|
827
|
+
|
|
693
828
|
1. You can directly create a schema in the CLI with the [`create`](#affinidi-create) command or using the [Schema Manager API](https://affinidi-schema-manager.prod.affinity-project.org/api-docs/#/Schema/CreateSchema).
|
|
694
829
|
|
|
695
830
|
2. You can list available schemas with the [`list`](#affinidi-list) command or search via the [Schema Manager API](https://affinidi-schema-manager.prod.affinity-project.org/api-docs/#/Schema/SearchSchemas) specifying `scope`, `type` or `authorDID`.
|
|
696
831
|
|
|
697
832
|
### What is the difference between a version and a revision?
|
|
833
|
+
|
|
698
834
|
Essentially, all the revisions of the single version should be compatible with each other,
|
|
699
835
|
whereas new versions could feature breaking changes, e.g. new mandatory fields. Currently, adherence to this principle is not enforced, but it is good to keep in mind when choosing between new version or revision for your forked schema.
|
|
700
836
|
|
|
@@ -710,9 +846,10 @@ and are maintained by the system in parallel.
|
|
|
710
846
|
However, you can always fork your private (unlisted) schema in order to make it public and vice versa.
|
|
711
847
|
|
|
712
848
|
### How to structure a JSON file to issue a VC:
|
|
849
|
+
|
|
713
850
|
The JSON file that is the source for the VC to be issued must follow the structure of the schema on which the VC is based. Use the properties of the schema's `credentialSubject` as the template for the new VC.
|
|
714
851
|
|
|
715
|
-
Example for [Event
|
|
852
|
+
Example for [Event Eligibility Schema](https://schema.affinidi.com/EventElegibilityV1-0.json):
|
|
716
853
|
|
|
717
854
|
```
|
|
718
855
|
{
|
|
@@ -730,26 +867,31 @@ Example for [Event Elegibility Schema](https://schema.affinidi.com/EventElegibil
|
|
|
730
867
|
|
|
731
868
|
|
|
732
869
|
#
|
|
870
|
+
|
|
733
871
|
## Feedback & Support
|
|
872
|
+
|
|
734
873
|
Click [here](https://github.com/affinidi/affinidi-cli/issues) to create a ticket and we will get on it right away. If you are facing technical or other issues, you can reach out to us on [Discord](https://discord.com/invite/jx2hGBk5xE).
|
|
735
874
|
|
|
736
875
|
|
|
737
876
|
|
|
738
|
-
|
|
739
|
-
|
|
740
877
|
## FAQ
|
|
878
|
+
|
|
741
879
|
### A note from Affinidi
|
|
880
|
+
|
|
742
881
|
Affinidi Developer Tools are currently in the open beta phase and we are refining our product every day. The Affinidi Developer Tools may be incomplete and may contain errors – they may be unstable and may cause a loss of functionality and data. Use of the Affinidi Developer Tools will be at your own risk. As our engineers seek to improve our platform, we would not have the resources to provide any maintenance or tech support at this time. Please bear with us as we continue to improve the platform.
|
|
743
882
|
|
|
744
883
|
### What can I develop?
|
|
884
|
+
|
|
745
885
|
You are only limited by your imagination! Affinidi Developer Tools is a toolbox with which you can build software applications for personal or commercial use.
|
|
746
886
|
|
|
747
887
|
### Is there anything I should not develop?
|
|
888
|
+
|
|
748
889
|
We only provide the tools - how you use them is largely up to you. We have no control over what you develop with our tools - but please use our tools responsibly!
|
|
749
890
|
|
|
750
891
|
We hope that you would not develop anything that contravenes any applicable laws or regulations. Your projects should also not infringe on Affinidi’s or any third party’s intellectual property (for instance, misusing other parties’ data, code, logos, etc).
|
|
751
892
|
|
|
752
893
|
### What responsibilities do I have to my end-users?
|
|
894
|
+
|
|
753
895
|
Please ensure that you have in place your own terms and conditions, privacy policies, and other safeguards to ensure that the projects you build are secure for your end users.
|
|
754
896
|
|
|
755
897
|
If you are processing personal data, please protect the privacy and other legal rights of your end-users and store their personal or sensitive information securely.
|
|
@@ -757,18 +899,23 @@ If you are processing personal data, please protect the privacy and other legal
|
|
|
757
899
|
Some of our components would also require you to incorporate our end-user notices into your terms and conditions.
|
|
758
900
|
|
|
759
901
|
### Are Affinidi Developer Tools free for use?
|
|
902
|
+
|
|
760
903
|
Affinidi Developer Tools are free during the open beta phase, so come onboard and experiment with our tools and see what you can build! We may bill for certain components in the future, but we will inform you beforehand.
|
|
761
904
|
|
|
762
905
|
### Is there any limit or cap to my usage of the Affinidi Developer Tools?
|
|
906
|
+
|
|
763
907
|
We may from time to time impose limits on your use of the Affinidi Developer Tools, such as limiting the number of API requests that you may make in a given duration. This is to ensure the smooth operation of the Affinidi Developer Tools so that you and all our other users can have a pleasant experience as we continue to scale and improve the Affinidi Developer Tools.
|
|
764
908
|
|
|
765
909
|
### Do I need to provide you with anything?
|
|
910
|
+
|
|
766
911
|
From time to time, we may request certain information from you to ensure that you are complying with the [Terms of Use](https://build.affinidi.com/dev-tools/terms-of-use.pdf).
|
|
767
912
|
|
|
768
913
|
### Can I share my developer’s account with others?
|
|
914
|
+
|
|
769
915
|
When you create a developer’s account with us, we will issue you your private login credentials. Please do not share this with anyone else, as you would be responsible for activities that happen under your account. If you have friends who are interested, ask them to sign up – let's build together!
|
|
770
916
|
|
|
771
917
|
### Telemetry
|
|
918
|
+
|
|
772
919
|
Affinidi collects usage data to improve our products and services. For information on what data we collect and how we use your data, please refer to our [Privacy Policy](https://build.affinidi.com/dev-tools/privacy-policy.pdf).
|
|
773
920
|
|
|
774
921
|
Disclaimer:
|