@affinidi/cli 2.0.0-beta.6 → 2.0.0-beta.8

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.
Files changed (95) hide show
  1. package/README.md +143 -227
  2. package/dist/commands/generate/app.d.ts +1 -0
  3. package/dist/commands/generate/app.js +77 -16
  4. package/dist/commands/generate/app.js.map +1 -1
  5. package/dist/commands/iam/add-principal.js +9 -1
  6. package/dist/commands/iam/add-principal.js.map +1 -1
  7. package/dist/commands/iam/get-policies.js +9 -1
  8. package/dist/commands/iam/get-policies.js.map +1 -1
  9. package/dist/commands/iam/remove-principal.js +9 -1
  10. package/dist/commands/iam/remove-principal.js.map +1 -1
  11. package/dist/commands/iam/update-policies.js +26 -14
  12. package/dist/commands/iam/update-policies.js.map +1 -1
  13. package/dist/commands/login/add-user-to-group.js +9 -1
  14. package/dist/commands/login/add-user-to-group.js.map +1 -1
  15. package/dist/commands/login/create-config.js +22 -10
  16. package/dist/commands/login/create-config.js.map +1 -1
  17. package/dist/commands/login/create-group.js +7 -1
  18. package/dist/commands/login/create-group.js.map +1 -1
  19. package/dist/commands/login/delete-config.js +10 -3
  20. package/dist/commands/login/delete-config.js.map +1 -1
  21. package/dist/commands/login/delete-group.js +10 -3
  22. package/dist/commands/login/delete-group.js.map +1 -1
  23. package/dist/commands/login/get-config.js +8 -1
  24. package/dist/commands/login/get-config.js.map +1 -1
  25. package/dist/commands/login/get-group.js +8 -1
  26. package/dist/commands/login/get-group.js.map +1 -1
  27. package/dist/commands/login/list-users-in-group.js +8 -1
  28. package/dist/commands/login/list-users-in-group.js.map +1 -1
  29. package/dist/commands/login/remove-user-from-group.js +10 -2
  30. package/dist/commands/login/remove-user-from-group.js.map +1 -1
  31. package/dist/commands/login/update-config.js +12 -8
  32. package/dist/commands/login/update-config.js.map +1 -1
  33. package/dist/commands/project/create-project.d.ts +1 -0
  34. package/dist/commands/project/create-project.js +14 -1
  35. package/dist/commands/project/create-project.js.map +1 -1
  36. package/dist/commands/project/select-project.js +8 -2
  37. package/dist/commands/project/select-project.js.map +1 -1
  38. package/dist/commands/start.js +4 -3
  39. package/dist/commands/start.js.map +1 -1
  40. package/dist/commands/stop.js +8 -5
  41. package/dist/commands/stop.js.map +1 -1
  42. package/dist/commands/token/create-token.js +4 -3
  43. package/dist/commands/token/create-token.js.map +1 -1
  44. package/dist/commands/token/delete-token.js +2 -1
  45. package/dist/commands/token/delete-token.js.map +1 -1
  46. package/dist/commands/token/get-token.js +2 -1
  47. package/dist/commands/token/get-token.js.map +1 -1
  48. package/dist/commands/token/update-token.js +5 -4
  49. package/dist/commands/token/update-token.js.map +1 -1
  50. package/dist/commands/whoami.d.ts +9 -0
  51. package/dist/commands/whoami.js +37 -0
  52. package/dist/commands/whoami.js.map +1 -0
  53. package/dist/common/base-command.d.ts +1 -0
  54. package/dist/common/base-command.js +4 -0
  55. package/dist/common/base-command.js.map +1 -1
  56. package/dist/common/constants.d.ts +4 -0
  57. package/dist/common/constants.js +6 -1
  58. package/dist/common/constants.js.map +1 -1
  59. package/dist/helpers/generate-error-message.d.ts +1 -0
  60. package/dist/helpers/generate-error-message.js +8 -0
  61. package/dist/helpers/generate-error-message.js.map +1 -0
  62. package/dist/helpers/input-length-validation.d.ts +4 -0
  63. package/dist/helpers/input-length-validation.js +15 -0
  64. package/dist/helpers/input-length-validation.js.map +1 -0
  65. package/dist/helpers/prompt-required-flags.js +8 -1
  66. package/dist/helpers/prompt-required-flags.js.map +1 -1
  67. package/dist/services/affinidi/auth/index.d.ts +4 -4
  68. package/dist/services/affinidi/auth/index.js +6 -11
  69. package/dist/services/affinidi/auth/index.js.map +1 -1
  70. package/dist/services/affinidi/auth/token.d.ts +11 -7
  71. package/dist/services/affinidi/auth/token.js +25 -21
  72. package/dist/services/affinidi/auth/token.js.map +1 -1
  73. package/dist/services/affinidi/errors/index.d.ts +2 -0
  74. package/dist/services/affinidi/errors/index.js +6 -5
  75. package/dist/services/affinidi/errors/index.js.map +1 -1
  76. package/dist/services/affinidi/iam/iam.api.d.ts +1 -0
  77. package/dist/services/affinidi/iam/iam.api.js.map +1 -1
  78. package/dist/services/affinidi/iam/index.d.ts +3 -3
  79. package/dist/services/affinidi/iam/index.js +9 -3
  80. package/dist/services/affinidi/iam/index.js.map +1 -1
  81. package/dist/services/config/index.js +4 -4
  82. package/dist/services/config/index.js.map +1 -1
  83. package/dist/services/generator/auth0.d.ts +5 -0
  84. package/dist/services/generator/auth0.js +80 -0
  85. package/dist/services/generator/auth0.js.map +1 -0
  86. package/dist/services/generator/env-configurer.d.ts +1 -0
  87. package/dist/services/generator/env-configurer.js +22 -0
  88. package/dist/services/generator/env-configurer.js.map +1 -0
  89. package/dist/services/urls.d.ts +0 -1
  90. package/dist/services/urls.js +1 -4
  91. package/dist/services/urls.js.map +1 -1
  92. package/package.json +3 -4
  93. package/dist/services/auth0/index.d.ts +0 -7
  94. package/dist/services/auth0/index.js +0 -104
  95. package/dist/services/auth0/index.js.map +0 -1
package/README.md CHANGED
@@ -45,7 +45,7 @@ Your login configuration will be created under your CLI's active project. Learn
45
45
 
46
46
  #### User Groups
47
47
 
48
- You may also want to create user groups for your application. They allow you to set access privileges for your users inside your application. Learn more about user groups [here](https://docs.affinidi.com/docs/affinidi-login/user-groups/).
48
+ You may also want to create user groups for your application. They allow you to set access privileges for your users inside your application. A user's Affinidi Login ID token contains the groups the user belongs to, which can be used in your application to differentiate users and grant them access. Learn more about user groups [here](https://docs.affinidi.com/docs/affinidi-login/user-groups/).
49
49
 
50
50
  To create a user group use: [`affinidi login create-group`](#affinidi-login-create-group)
51
51
 
@@ -102,7 +102,9 @@ For convenience, the CLI adds the concept of Active Project. This is the project
102
102
 
103
103
  To programmatically call Affinidi APIs in your applications or in your automation you will require a Personal Access Token (PAT). Think of Personal Access Tokens as machine users that can perform operations on your behalf. PATs live outside of projects, meaning that they can be granted access to multiple projects.
104
104
 
105
- PATs use asymmetric keys where you are responsible of creating and maintaining the key pair. Please read about more about how PAT authentication works and how you can create the keys [here](#how-does-pat-authentication-work).
105
+ PATs use asymmetric keys where you are responsible of creating and maintaining the key pair.
106
+
107
+ Please read about more about how PAT authentication works and how you can create the keys [here](https://docs.affinidi.com/dev-tools/affinidi-cli/manage-token/#how-does-pat-authentication-works).
106
108
 
107
109
  All PAT commands can be found under `affinidi token <command>`
108
110
 
@@ -118,7 +120,7 @@ All IAM commands can be found under `affinidi iam <command>`
118
120
 
119
121
  1. Add a user or a PAT to the project with [`affinidi iam add-principal`](#affinidi-iam-add-principal) - _Principals are either users or PATs (machine users)_
120
122
 
121
- 2. Set the principal's access policies with [`affinidi iam update-policies`](#affinidi-iam-update-policies) - _Read more about policies [here](#how-do-policies-work)_
123
+ 2. Set the principal's access policies with [`affinidi iam update-policies`](#affinidi-iam-update-policies) - _Read more about policies [here](https://docs.affinidi.com/dev-tools/affinidi-cli/manage-iam/#defining-a-policy)_
122
124
 
123
125
  #### Journey summary
124
126
 
@@ -160,7 +162,7 @@ Once you have registered, authenticate in the CLI with:
160
162
  affinidi start
161
163
  ```
162
164
 
163
- ### Command structure and ways to call commands
165
+ ### Understanding commands
164
166
 
165
167
  Commands in Affinidi CLI have the following structure:
166
168
 
@@ -173,40 +175,41 @@ affinidi <topic> <command> [flags]
173
175
  3. Commands corresponds to the actions to perform
174
176
  4. Flags are a way to provide the parameters required by the command
175
177
 
176
- You can input flags in different ways. All of the following will work:
178
+ ### Available commands
177
179
 
178
- ```bash
179
- affinidi login create-config --file="config.json"
180
- affinidi login create-config --file "config.json"
181
- affinidi login create-config --file=config.json
182
- affinidi login create-config --file config.json
183
- affinidi login create-config -f "config.json"
184
- affinidi login create-config -f="config.json"
185
- affinidi login create-config -f"config.json"
186
- affinidi login create-config -f config.json
187
- affinidi login create-config -f=config.json
188
- affinidi login create-config -fconfig.json
189
- ```
180
+ In the [All Commands](#all-commands) section below you can find all of the CLI commands, with their help information, which includes usage, descriptions, flags and examples.
190
181
 
191
- ### Finding commands
182
+ #### Useful commands:
192
183
 
193
- In the [All Commands](#all-commands) section below you can find all of the CLI commands, with their help information, which includes usage, descriptions, flags and examples.
184
+ [`affinidi start`](#affinidi-start) Log in to Affinidi
194
185
 
195
- There are some notable commands that don't belong to any topic and may be of use for you:
186
+ [`affinidi stop`](#affinidi-stop) Log out of Affinidi
196
187
 
197
- [`affinidi commands`](#affinidi-commands) - List all available commands
188
+ [`affinidi whoami`](#affinidi-whoami) - Show the current signed in user identifiers
189
+
190
+ [`affinidi help`](#affinidi-help-commands) - Print the help information of a topic or command
198
191
 
199
192
  [`affinidi search`](#affinidi-search) - Search and navigate through available commands
200
193
 
194
+ [`affinidi commands`](#affinidi-commands) - List all available commands
195
+
196
+ [`affinidi generate app`](#affinidi-generate-app) Clones and configures a reference application
197
+
201
198
  [`affinidi autocomplete`](#affinidi-autocomplete-shell) - Print the instructions to set up command autocomplete
202
199
 
203
- [`affinidi help`](#affinidi-help-commands) - Print the help information of a topic or command
200
+ `affinidi --version` - Show the current version of the Affinidi CLI installed on your machine
204
201
 
205
- [`affinidi start`](#affinidi-start) Log in to Affinidi
202
+ ### Help
206
203
 
207
- [`affinidi stop`](#affinidi-stop) Log out of Affinidi
204
+ All commands and topics have a help document with usage, descriptions, flags and examples.
205
+
206
+ View it with the help flag: `affinidi login create-config --help`
208
207
 
209
- ### Global flags
208
+ With the help root command: `affinidi help login create-config`
209
+
210
+ Or by searching and selecting a command: `affinidi search`
211
+
212
+ ### Flags
210
213
 
211
214
  All commands have some global flags at their disposal.
212
215
 
@@ -216,6 +219,23 @@ All commands have some global flags at their disposal.
216
219
 
217
220
  `--no-color` Disables color in the output. Useful if you have trouble distinguishing colors.
218
221
 
222
+ `--no-input` Disables all the interactive prompts. Useful for automation anc ci.
223
+
224
+ You can input flags in multiple ways. All of the following will work:
225
+
226
+ ```bash
227
+ affinidi login create-config --file="config.json"
228
+ affinidi login create-config --file "config.json"
229
+ affinidi login create-config --file=config.json
230
+ affinidi login create-config --file config.json
231
+ affinidi login create-config -f "config.json"
232
+ affinidi login create-config -f="config.json"
233
+ affinidi login create-config -f"config.json"
234
+ affinidi login create-config -f config.json
235
+ affinidi login create-config -f=config.json
236
+ affinidi login create-config -fconfig.json
237
+ ```
238
+
219
239
  ### Active Project
220
240
 
221
241
  Affinidi CLI introduces a local concept of "Active Project" for convenience. Commands under the `login` and `iam` topics perform actions under a particular project. In order to not have to ask for the project and create the necessary credentials each time you call one of these commands, we ask you to define the CLI's working project once.
@@ -236,170 +256,6 @@ When you authenticate to Affinidi with `affinidi start` the CLI will create a fo
236
256
 
237
257
  When you run `affinidi stop` your session information is deleted.
238
258
 
239
- ## How does PAT authentication work?
240
-
241
- In the following diagram you can find the flow of how you can set up a Personal Access Token and use it to call Affinidi APIs.
242
-
243
- ```mermaid
244
- flowchart TB
245
- subgraph CLI
246
- user_token["1.1. Authenticate to Affinidi"]
247
- create_project["1.2. Create project"]
248
- project_access["1.3. Get project credentials"]
249
- create_token["3.1. Create PAT"]
250
- add_token_project["3.2. Add PAT to project"]
251
- set_policies["3.3. Set PAT policies"]
252
-
253
- user_token --> create_project
254
- create_project --> project_access
255
- user_token --> create_token
256
- create_token --> add_token_project
257
- project_access --> add_token_project
258
- add_token_project --> set_policies
259
- end
260
-
261
- subgraph Application
262
- direction TB
263
- sign_jwt["4.1. Sign JWT"]
264
- delegate_token["4.2. Exchange for delegate token"]
265
- call_project_api["4.3. Call Affinidi APIs"]
266
-
267
- sign_jwt --> delegate_token
268
- delegate_token --> call_project_api
269
- end
270
-
271
- create_keys["2. Create key pair"]
272
- create_keys -. "public key PEM" .-> create_token
273
- create_keys -. "private key PEM" .-> sign_jwt
274
- set_policies -. "allows" .-> call_project_api
275
- ```
276
-
277
- 1. Authenticate with Affinidi and set up your project
278
-
279
- 1. Authenticate with Affinidi - [`affinidi start`](#affinidi-start)
280
- 2. Create project - [`affinidi project create-project`](#affinidi-project-create-project)
281
- 3. Get project credentials - [`affinidi project select-project`](#affinidi-project-select-project)
282
-
283
- 2. Create and secure a key pair
284
-
285
- You can create a key pair using [openssl](https://www.openssl.org/docs/man1.1.1/man1/):
286
-
287
- ```bash
288
- # Create an encrypted RSA private key with passphrase "hello"
289
- openssl genpkey -algorithm RSA -out privateKey.pem -aes-128-cbc -pass pass:hello
290
-
291
- # Extract the public key from the private key
292
- openssl rsa -in privateKey.pem -pubout -out publicKey.pem
293
- ```
294
-
295
- Remember your passphrase as you will need it later to sign with your private key.
296
-
297
- Optionally you can rely on a cloud provider to securely manage your keys, such as [AWS KMS](https://aws.amazon.com/kms/), [GCP's Cloud KMS](https://cloud.google.com/security-key-management) or [Azure Key Vault](https://azure.microsoft.com/products/key-vault/)
298
-
299
- 3. Create a PAT and grant it permissions
300
-
301
- 1. Create PAT - [`affinidi token create-token`](#affinidi-token-create-token)
302
- 2. Add PAT to project - [`affinidi iam add-principal`](#affinidi-iam-add-principal)
303
- 3. Set PAT policies - [`affinidi iam update-policies`](#affinidi-iam-update-policies)
304
-
305
- Remember the PAT Key ID as you will need it to sign with your private key. Read more about how to set policies [below](#how-do-policies-work).
306
-
307
- 4. Use the private key to call Affinidi APIs from your application
308
-
309
- Learn more how to create a Delegate Tokens to call APIs in the next section.
310
-
311
- ### Delegate tokens
312
-
313
- 1. To create a delegate token you first need to sign a JWT with your private key. In the snippet below this is done with `signJWT(...)`. This should also be possible with third party key managers.
314
-
315
- 2. Once you have a signed JWT you can use it to exchange it for a user scoped token. In the snippet this is done with `getUserToken(...)`. You can use this token to call some Affinidi APIs, however most APIs require a project scoped token.
316
-
317
- 3. In the snippet we get a project scope token with `getProjectToken(...)`.
318
-
319
- ```javascript
320
- import jwt from 'jsonwebtoken'
321
- import qs from 'qs'
322
-
323
- // Parameters required to sign JWT
324
- const PRIVATE_KEY = process.env.PRIVATE_KEY
325
- const ALGORITHM = process.env.ALGORITHM
326
- const PASSPHRASE = process.env.PASSPHRASE
327
- const KEY_ID = process.env.KEY_ID
328
-
329
- // Parameter required to sign JWT and get User Scoped Token
330
- const TOKEN_ID = process.env.TOKEN_ID
331
-
332
- // Parameter required to get Project Scoped Token
333
- const PROJECT_ID = process.env.PROJECT_ID
334
-
335
- function signJWT(privateKey, algorithm, passphrase, keyId, tokenId) {
336
- const issueTimeSeconds = Math.floor(new Date().getTime() / 1000)
337
- const payload = {
338
- iss: tokenId,
339
- sub: tokenId,
340
- aud: 'https://euw1.elements.auth.affinidi.io/oauth2/token',
341
- jti: new Date().toString() + Math.random(),
342
- exp: issueTimeSeconds + 5 * 60,
343
- iat: issueTimeSeconds,
344
- }
345
- const secret = { key: privateKey, passphrase }
346
- const options = { algorithm: algorithm, keyid: keyId }
347
- return jwt.sign(payload, secret, options)
348
- }
349
-
350
- async function getUserToken(tokenId, signedJWT) {
351
- const formData = qs.stringify({
352
- grant_type: 'client_credentials',
353
- scope: 'openid',
354
- client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
355
- client_assertion: signedJWT,
356
- client_id: tokenId,
357
- })
358
- const response = await fetch('https://euw1.elements.auth.affinidi.io/oauth2/token', {
359
- method: 'POST',
360
- body: formData,
361
- headers: {
362
- 'Content-Type': 'application/x-www-form-urlencoded',
363
- },
364
- })
365
- if (response.status !== 200) throw new Error('Could not get user token')
366
- return response.json()
367
- }
368
-
369
- async function getProjectToken(projectId, userScopeToken) {
370
- const response = await fetch('https://apse1.api.affinidi.io/iam/v1/create-project-scoped-token', {
371
- method: 'POST',
372
- body: JSON.stringify({ projectId }),
373
- headers: {
374
- Authorization: `Bearer ${userScopeToken}`,
375
- 'Content-Type': 'application/json',
376
- },
377
- })
378
- if (response.status !== 200) throw new Error('Could not get project token')
379
- return response.json()
380
- }
381
-
382
- const signedJWT = signJWT(PRIVATE_KEY, ALGORITHM, PASSPHRASE, KEY_ID, TOKEN_ID)
383
- const userScopeToken = (await getUserToken(TOKEN_ID, signedJWT)).access_token
384
- const projectScopeToken = (await getProjectToken(PROJECT_ID, userScopeToken)).accessToken
385
- ```
386
-
387
- 4. With these tokens you can now call Affinidi APIs:
388
-
389
- ```javascript
390
- const response = await fetch('https://apse1.api.affinidi.io/vpa/v1/login/configurations', {
391
- headers: {
392
- Authorization: `Bearer ${projectScopeToken}`,
393
- },
394
- })
395
- const configurations = await response.json()
396
- console.log(configurations)
397
- ```
398
-
399
- ## How do policies work?
400
-
401
- WIP
402
-
403
259
  ## Support & Feedback
404
260
 
405
261
  If you face any issue or have some suggestion for us please don't hesitate to create a ticket [here](https://share.hsforms.com/1i-4HKZRXSsmENzXtPdIG4g8oa2v).
@@ -489,6 +345,7 @@ Please note that this FAQ is provided for informational purposes only and is not
489
345
  * [`affinidi token get-token`](#affinidi-token-get-token)
490
346
  * [`affinidi token list-tokens`](#affinidi-token-list-tokens)
491
347
  * [`affinidi token update-token`](#affinidi-token-update-token)
348
+ * [`affinidi whoami`](#affinidi-whoami)
492
349
 
493
350
  ## `affinidi autocomplete [SHELL]`
494
351
 
@@ -555,26 +412,36 @@ _See code: [@oclif/plugin-commands](https://github.com/oclif/plugin-commands/blo
555
412
 
556
413
  ## `affinidi generate app`
557
414
 
558
- Generates a reference application and configures an Auth0 connection. Requires git
415
+ Generates a NextJS reference application that integrates Affinidi Login. Requires git
559
416
 
560
417
  ```
561
418
  USAGE
562
- $ affinidi generate app [--json] [--no-color] [-p <value>] [--force]
419
+ $ affinidi generate app [--json] [--no-color] [--no-input] [-s
420
+ affinidi-nextjs-nextauthjs|auth0-nextjs-nextauthjs] [-p <value>] [--force]
563
421
 
564
422
  FLAGS
565
- -p, --path=<value> Relative or absolute path where reference application should be cloned into
566
- --force Override destination directory if exists
423
+ -p, --path=<value> Relative or absolute path where reference application should be cloned into
424
+ -s, --sample=<option> Sample to generate
425
+ <options: affinidi-nextjs-nextauthjs|auth0-nextjs-nextauthjs>
426
+ --force Override destination directory if exists
567
427
 
568
428
  GLOBAL FLAGS
569
429
  --json Format output as json.
570
430
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
431
+ --no-input Disables all the interactive prompts
571
432
 
572
433
  EXAMPLES
573
434
  $ affinidi generate app
574
435
 
575
- $ affinidi generate app -p <destination_path>
436
+ $ affinidi generate app -p "../my-app" -s affinidi-nextjs-nextauthjs
576
437
 
577
- $ affinidi generate app --path <destination_path> --force
438
+ $ affinidi generate app --path "../my-app" --sample auth0-nextjs-nextauthjs --force
439
+
440
+ FLAG DESCRIPTIONS
441
+ -s, --sample=affinidi-nextjs-nextauthjs|auth0-nextjs-nextauthjs Sample to generate
442
+
443
+ Use affinidi-nextjs-nextauthjs to generate a Next.js+NextAuth.js app that integrates Affinidi Login directly
444
+ Use auth0-nextjs-nextauthjs to generate a Next.js+NextAuth.js app that integrates Affinidi Login through Auth0
578
445
  ```
579
446
 
580
447
  ## `affinidi help [COMMANDS]`
@@ -603,7 +470,7 @@ Adds a principal (user or token) to the active project
603
470
 
604
471
  ```
605
472
  USAGE
606
- $ affinidi iam add-principal [--json] [--no-color] [-i <value>] [-t machine_user|user]
473
+ $ affinidi iam add-principal [--json] [--no-color] [--no-input] [-i <value>] [-t machine_user|user]
607
474
 
608
475
  FLAGS
609
476
  -i, --principal-id=<value> ID of the principal
@@ -613,6 +480,7 @@ FLAGS
613
480
  GLOBAL FLAGS
614
481
  --json Format output as json.
615
482
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
483
+ --no-input Disables all the interactive prompts
616
484
 
617
485
  DESCRIPTION
618
486
  Adds a principal (user or token) to the active project
@@ -636,7 +504,7 @@ Gets the policies of a principal (user or token)
636
504
 
637
505
  ```
638
506
  USAGE
639
- $ affinidi iam get-policies [--json] [--no-color] [-i <value>] [-t machine_user|user]
507
+ $ affinidi iam get-policies [--json] [--no-color] [--no-input] [-i <value>] [-t machine_user|user]
640
508
 
641
509
  FLAGS
642
510
  -i, --principal-id=<value> ID of the principal
@@ -646,6 +514,7 @@ FLAGS
646
514
  GLOBAL FLAGS
647
515
  --json Format output as json.
648
516
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
517
+ --no-input Disables all the interactive prompts
649
518
 
650
519
  DESCRIPTION
651
520
  Gets the policies of a principal (user or token)
@@ -670,11 +539,12 @@ Lists the principals (users and tokens) in the active project
670
539
 
671
540
  ```
672
541
  USAGE
673
- $ affinidi iam list-principals [--json] [--no-color]
542
+ $ affinidi iam list-principals [--json] [--no-color] [--no-input]
674
543
 
675
544
  GLOBAL FLAGS
676
545
  --json Format output as json.
677
546
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
547
+ --no-input Disables all the interactive prompts
678
548
 
679
549
  DESCRIPTION
680
550
  Lists the principals (users and tokens) in the active project
@@ -691,7 +561,7 @@ Removes a principal (user or token) from the active project
691
561
 
692
562
  ```
693
563
  USAGE
694
- $ affinidi iam remove-principal [--json] [--no-color] [-i <value>] [-t machine_user|user]
564
+ $ affinidi iam remove-principal [--json] [--no-color] [--no-input] [-i <value>] [-t machine_user|user]
695
565
 
696
566
  FLAGS
697
567
  -i, --principal-id=<value> ID of the principal
@@ -701,6 +571,7 @@ FLAGS
701
571
  GLOBAL FLAGS
702
572
  --json Format output as json.
703
573
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
574
+ --no-input Disables all the interactive prompts
704
575
 
705
576
  DESCRIPTION
706
577
  Removes a principal (user or token) from the active project
@@ -724,7 +595,7 @@ Updates the policies of a principal (user or token) in the active project
724
595
 
725
596
  ```
726
597
  USAGE
727
- $ affinidi iam update-policies [--json] [--no-color] [-i <value>] [-t machine_user|user] [-f <value>]
598
+ $ affinidi iam update-policies [--json] [--no-color] [--no-input] [-i <value>] [-t machine_user|user] [-f <value>]
728
599
 
729
600
  FLAGS
730
601
  -f, --file=<value> Location of a json file containing principal policies
@@ -735,6 +606,7 @@ FLAGS
735
606
  GLOBAL FLAGS
736
607
  --json Format output as json.
737
608
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
609
+ --no-input Disables all the interactive prompts
738
610
 
739
611
  DESCRIPTION
740
612
  Updates the policies of a principal (user or token) in the active project
@@ -759,7 +631,7 @@ Adds a user to a user group
759
631
 
760
632
  ```
761
633
  USAGE
762
- $ affinidi login add-user-to-group [--json] [--no-color] [--group-name <value>] [--user-sub <value>]
634
+ $ affinidi login add-user-to-group [--json] [--no-color] [--no-input] [--group-name <value>] [--user-sub <value>]
763
635
 
764
636
  FLAGS
765
637
  --group-name=<value> Name of the user group
@@ -768,6 +640,7 @@ FLAGS
768
640
  GLOBAL FLAGS
769
641
  --json Format output as json.
770
642
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
643
+ --no-input Disables all the interactive prompts
771
644
 
772
645
  EXAMPLES
773
646
  $ affinidi login add-user-to-group --group-name my_group --user-sub did:key:12345
@@ -779,7 +652,7 @@ Creates a login configuration in your active project
779
652
 
780
653
  ```
781
654
  USAGE
782
- $ affinidi login create-config [--json] [--no-color] [-f <value> | -n <value> | -u <value> |
655
+ $ affinidi login create-config [--json] [--no-color] [--no-input] [-f <value> | -n <value> | -u <value> |
783
656
  --token-endpoint-auth-method client_secret_basic|client_secret_post|none | --claim-format array|map | --client-name
784
657
  <value> | --client-origin <value> | --client-logo <value>]
785
658
 
@@ -799,6 +672,7 @@ FLAGS
799
672
  GLOBAL FLAGS
800
673
  --json Format output as json.
801
674
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
675
+ --no-input Disables all the interactive prompts
802
676
 
803
677
  EXAMPLES
804
678
  $ affinidi login create-config
@@ -827,7 +701,7 @@ Create a user group in your active project
827
701
 
828
702
  ```
829
703
  USAGE
830
- $ affinidi login create-group [--json] [--no-color] [-n <value>]
704
+ $ affinidi login create-group [--json] [--no-color] [--no-input] [-n <value>]
831
705
 
832
706
  FLAGS
833
707
  -n, --name=<value> Name of the user group, that follows url-friendly pattern ^[a-z_]+$
@@ -835,6 +709,7 @@ FLAGS
835
709
  GLOBAL FLAGS
836
710
  --json Format output as json.
837
711
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
712
+ --no-input Disables all the interactive prompts
838
713
 
839
714
  EXAMPLES
840
715
  $ affinidi login create-group -n my_new_group
@@ -848,7 +723,7 @@ Deletes a login configuration from your active project
848
723
 
849
724
  ```
850
725
  USAGE
851
- $ affinidi login delete-config [--json] [--no-color] [-i <value>]
726
+ $ affinidi login delete-config [--json] [--no-color] [--no-input] [-i <value>]
852
727
 
853
728
  FLAGS
854
729
  -i, --id=<value> ID of the login configuration
@@ -856,6 +731,7 @@ FLAGS
856
731
  GLOBAL FLAGS
857
732
  --json Format output as json.
858
733
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
734
+ --no-input Disables all the interactive prompts
859
735
 
860
736
  EXAMPLES
861
737
  $ affinidi login delete-config -i <value>
@@ -869,7 +745,7 @@ Deletes a user group from your active project
869
745
 
870
746
  ```
871
747
  USAGE
872
- $ affinidi login delete-group [--json] [--no-color] [-n <value>]
748
+ $ affinidi login delete-group [--json] [--no-color] [--no-input] [-n <value>]
873
749
 
874
750
  FLAGS
875
751
  -n, --name=<value> Name of the user group
@@ -877,6 +753,7 @@ FLAGS
877
753
  GLOBAL FLAGS
878
754
  --json Format output as json.
879
755
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
756
+ --no-input Disables all the interactive prompts
880
757
 
881
758
  EXAMPLES
882
759
  $ affinidi login delete-group -n my_group
@@ -890,7 +767,7 @@ Gets the details of a login configuration in your active project
890
767
 
891
768
  ```
892
769
  USAGE
893
- $ affinidi login get-config [--json] [--no-color] [-i <value>]
770
+ $ affinidi login get-config [--json] [--no-color] [--no-input] [-i <value>]
894
771
 
895
772
  FLAGS
896
773
  -i, --id=<value> ID of the login configuration
@@ -898,6 +775,7 @@ FLAGS
898
775
  GLOBAL FLAGS
899
776
  --json Format output as json.
900
777
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
778
+ --no-input Disables all the interactive prompts
901
779
 
902
780
  EXAMPLES
903
781
  $ affinidi login get-config -i <value>
@@ -911,7 +789,7 @@ Gets the details of a user group
911
789
 
912
790
  ```
913
791
  USAGE
914
- $ affinidi login get-group [--json] [--no-color] [-n <value>]
792
+ $ affinidi login get-group [--json] [--no-color] [--no-input] [-n <value>]
915
793
 
916
794
  FLAGS
917
795
  -n, --name=<value> Name of the user group
@@ -919,6 +797,7 @@ FLAGS
919
797
  GLOBAL FLAGS
920
798
  --json Format output as json.
921
799
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
800
+ --no-input Disables all the interactive prompts
922
801
 
923
802
  EXAMPLES
924
803
  $ affinidi login get-group -n my_group
@@ -932,11 +811,12 @@ Lists login configurations in your active project
932
811
 
933
812
  ```
934
813
  USAGE
935
- $ affinidi login list-configs [--json] [--no-color]
814
+ $ affinidi login list-configs [--json] [--no-color] [--no-input]
936
815
 
937
816
  GLOBAL FLAGS
938
817
  --json Format output as json.
939
818
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
819
+ --no-input Disables all the interactive prompts
940
820
 
941
821
  EXAMPLES
942
822
  $ affinidi login list-configs
@@ -948,11 +828,12 @@ Lists user groups in your active project
948
828
 
949
829
  ```
950
830
  USAGE
951
- $ affinidi login list-groups [--json] [--no-color]
831
+ $ affinidi login list-groups [--json] [--no-color] [--no-input]
952
832
 
953
833
  GLOBAL FLAGS
954
834
  --json Format output as json.
955
835
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
836
+ --no-input Disables all the interactive prompts
956
837
 
957
838
  EXAMPLES
958
839
  $ affinidi login list-groups
@@ -964,7 +845,7 @@ Use this command to list users in the user group
964
845
 
965
846
  ```
966
847
  USAGE
967
- $ affinidi login list-users-in-group [--json] [--no-color] [--group-name <value>]
848
+ $ affinidi login list-users-in-group [--json] [--no-color] [--no-input] [--group-name <value>]
968
849
 
969
850
  FLAGS
970
851
  --group-name=<value> Name of the user group
@@ -972,6 +853,7 @@ FLAGS
972
853
  GLOBAL FLAGS
973
854
  --json Format output as json.
974
855
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
856
+ --no-input Disables all the interactive prompts
975
857
 
976
858
  EXAMPLES
977
859
  $ affinidi login list-users-in-group --group-name my_group
@@ -983,7 +865,8 @@ Removes a user from a user group
983
865
 
984
866
  ```
985
867
  USAGE
986
- $ affinidi login remove-user-from-group [--json] [--no-color] [--group-name <value>] [--user-mapping-id <value>]
868
+ $ affinidi login remove-user-from-group [--json] [--no-color] [--no-input] [--group-name <value>] [--user-mapping-id
869
+ <value>]
987
870
 
988
871
  FLAGS
989
872
  --group-name=<value> Name of the user group
@@ -992,6 +875,7 @@ FLAGS
992
875
  GLOBAL FLAGS
993
876
  --json Format output as json.
994
877
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
878
+ --no-input Disables all the interactive prompts
995
879
 
996
880
  EXAMPLES
997
881
  $ affinidi login remove-user-from-group --group-name my_group --user-mapping-id <value>
@@ -1003,7 +887,7 @@ Updates a login configuration
1003
887
 
1004
888
  ```
1005
889
  USAGE
1006
- $ affinidi login update-config [--json] [--no-color] [-i <value>] [-f <value> | -n <value> | -u <value> |
890
+ $ affinidi login update-config [--json] [--no-color] [--no-input] [-i <value>] [-f <value> | -n <value> | -u <value> |
1007
891
  --token-endpoint-auth-method client_secret_basic|client_secret_post|none | --client-name <value> | --client-origin
1008
892
  <value> | --client-logo <value>]
1009
893
 
@@ -1022,6 +906,7 @@ FLAGS
1022
906
  GLOBAL FLAGS
1023
907
  --json Format output as json.
1024
908
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
909
+ --no-input Disables all the interactive prompts
1025
910
 
1026
911
  EXAMPLES
1027
912
  $ affinidi login update-config --id <value> -f loginConfig.json
@@ -1048,14 +933,16 @@ Creates a project
1048
933
 
1049
934
  ```
1050
935
  USAGE
1051
- $ affinidi project create-project [--json] [--no-color] [-n <value>]
936
+ $ affinidi project create-project [--json] [--no-color] [--no-input] [-n <value>] [-d <value>]
1052
937
 
1053
938
  FLAGS
1054
- -n, --name=<value> Name of the project
939
+ -d, --description=<value> Description of the project
940
+ -n, --name=<value> Name of the project
1055
941
 
1056
942
  GLOBAL FLAGS
1057
943
  --json Format output as json.
1058
944
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
945
+ --no-input Disables all the interactive prompts
1059
946
 
1060
947
  EXAMPLES
1061
948
  $ affinidi project create-project -n MyProjectName
@@ -1069,11 +956,12 @@ Gets the current active project
1069
956
 
1070
957
  ```
1071
958
  USAGE
1072
- $ affinidi project get-active-project [--json] [--no-color]
959
+ $ affinidi project get-active-project [--json] [--no-color] [--no-input]
1073
960
 
1074
961
  GLOBAL FLAGS
1075
962
  --json Format output as json.
1076
963
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
964
+ --no-input Disables all the interactive prompts
1077
965
 
1078
966
  EXAMPLES
1079
967
  $ affinidi project get-active-project
@@ -1085,11 +973,12 @@ Lists your projects
1085
973
 
1086
974
  ```
1087
975
  USAGE
1088
- $ affinidi project list-projects [--json] [--no-color]
976
+ $ affinidi project list-projects [--json] [--no-color] [--no-input]
1089
977
 
1090
978
  GLOBAL FLAGS
1091
979
  --json Format output as json.
1092
980
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
981
+ --no-input Disables all the interactive prompts
1093
982
 
1094
983
  EXAMPLES
1095
984
  $ affinidi project list-projects
@@ -1101,7 +990,7 @@ Sets a project as the active project
1101
990
 
1102
991
  ```
1103
992
  USAGE
1104
- $ affinidi project select-project [--json] [--no-color] [-i <value>]
993
+ $ affinidi project select-project [--json] [--no-color] [--no-input] [-i <value>]
1105
994
 
1106
995
  FLAGS
1107
996
  -i, --project-id=<value> ID of the project
@@ -1109,6 +998,7 @@ FLAGS
1109
998
  GLOBAL FLAGS
1110
999
  --json Format output as json.
1111
1000
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1001
+ --no-input Disables all the interactive prompts
1112
1002
 
1113
1003
  EXAMPLES
1114
1004
  $ affinidi project select-project
@@ -1140,7 +1030,7 @@ Log in to Affinidi
1140
1030
 
1141
1031
  ```
1142
1032
  USAGE
1143
- $ affinidi start [--json] [--no-color] [-i <value>]
1033
+ $ affinidi start [--json] [--no-color] [--no-input] [-i <value>]
1144
1034
 
1145
1035
  FLAGS
1146
1036
  -i, --project-id=<value> ID of the project to set as active
@@ -1148,6 +1038,7 @@ FLAGS
1148
1038
  GLOBAL FLAGS
1149
1039
  --json Format output as json.
1150
1040
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1041
+ --no-input Disables all the interactive prompts
1151
1042
 
1152
1043
  EXAMPLES
1153
1044
  $ affinidi start
@@ -1157,7 +1048,7 @@ EXAMPLES
1157
1048
  $ affinidi start --project-id <project-id>
1158
1049
  ```
1159
1050
 
1160
- _See code: [dist/commands/start.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.5/dist/commands/start.ts)_
1051
+ _See code: [dist/commands/start.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.6/dist/commands/start.ts)_
1161
1052
 
1162
1053
  ## `affinidi stop`
1163
1054
 
@@ -1165,17 +1056,18 @@ Log out from Affinidi
1165
1056
 
1166
1057
  ```
1167
1058
  USAGE
1168
- $ affinidi stop [--json] [--no-color]
1059
+ $ affinidi stop [--json] [--no-color] [--no-input]
1169
1060
 
1170
1061
  GLOBAL FLAGS
1171
1062
  --json Format output as json.
1172
1063
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1064
+ --no-input Disables all the interactive prompts
1173
1065
 
1174
1066
  EXAMPLES
1175
1067
  $ affinidi stop
1176
1068
  ```
1177
1069
 
1178
- _See code: [dist/commands/stop.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.5/dist/commands/stop.ts)_
1070
+ _See code: [dist/commands/stop.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.6/dist/commands/stop.ts)_
1179
1071
 
1180
1072
  ## `affinidi token create-token`
1181
1073
 
@@ -1183,7 +1075,7 @@ Creates a Personal Access Token (PAT)
1183
1075
 
1184
1076
  ```
1185
1077
  USAGE
1186
- $ affinidi token create-token [--json] [--no-color] [-n <value>] [-k <value>] [-f <value>] [--algorithm
1078
+ $ affinidi token create-token [--json] [--no-color] [--no-input] [-n <value>] [-k <value>] [-f <value>] [--algorithm
1187
1079
  RS256|RS512|ES256|ES512]
1188
1080
 
1189
1081
  FLAGS
@@ -1196,6 +1088,7 @@ FLAGS
1196
1088
  GLOBAL FLAGS
1197
1089
  --json Format output as json.
1198
1090
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1091
+ --no-input Disables all the interactive prompts
1199
1092
 
1200
1093
  EXAMPLES
1201
1094
  $ affinidi token create-token -n MyNewToken -k MyKeyID -f publicKey.pem
@@ -1209,7 +1102,7 @@ Deletes a Personal Access Token (PAT)
1209
1102
 
1210
1103
  ```
1211
1104
  USAGE
1212
- $ affinidi token delete-token [--json] [--no-color] [-i <value>]
1105
+ $ affinidi token delete-token [--json] [--no-color] [--no-input] [-i <value>]
1213
1106
 
1214
1107
  FLAGS
1215
1108
  -i, --token-id=<value> ID of the Personal Access Token
@@ -1217,6 +1110,7 @@ FLAGS
1217
1110
  GLOBAL FLAGS
1218
1111
  --json Format output as json.
1219
1112
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1113
+ --no-input Disables all the interactive prompts
1220
1114
 
1221
1115
  EXAMPLES
1222
1116
  $ affinidi token delete-token -i <uuid>
@@ -1230,7 +1124,7 @@ Gets the details of a Personal Access Token (PAT)
1230
1124
 
1231
1125
  ```
1232
1126
  USAGE
1233
- $ affinidi token get-token [--json] [--no-color] [-i <value>]
1127
+ $ affinidi token get-token [--json] [--no-color] [--no-input] [-i <value>]
1234
1128
 
1235
1129
  FLAGS
1236
1130
  -i, --token-id=<value> ID of the Personal Access Token
@@ -1238,6 +1132,7 @@ FLAGS
1238
1132
  GLOBAL FLAGS
1239
1133
  --json Format output as json.
1240
1134
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1135
+ --no-input Disables all the interactive prompts
1241
1136
 
1242
1137
  EXAMPLES
1243
1138
  $ affinidi token get-token -i <uuid>
@@ -1251,11 +1146,12 @@ Lists your Personal Access Tokens (PATs)
1251
1146
 
1252
1147
  ```
1253
1148
  USAGE
1254
- $ affinidi token list-tokens [--json] [--no-color]
1149
+ $ affinidi token list-tokens [--json] [--no-color] [--no-input]
1255
1150
 
1256
1151
  GLOBAL FLAGS
1257
1152
  --json Format output as json.
1258
1153
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1154
+ --no-input Disables all the interactive prompts
1259
1155
 
1260
1156
  EXAMPLES
1261
1157
  $ affinidi token list-tokens
@@ -1267,8 +1163,8 @@ Updates a Personal Access Token (PAT)
1267
1163
 
1268
1164
  ```
1269
1165
  USAGE
1270
- $ affinidi token update-token [--json] [--no-color] [-i <value>] [-n <value>] [-k <value>] [-f <value>] [--algorithm
1271
- RS256|RS512|ES256|ES512]
1166
+ $ affinidi token update-token [--json] [--no-color] [--no-input] [-i <value>] [-n <value>] [-k <value>] [-f <value>]
1167
+ [--algorithm RS256|RS512|ES256|ES512]
1272
1168
 
1273
1169
  FLAGS
1274
1170
  -f, --public-key-file=<value> Location of the public key PEM file
@@ -1281,10 +1177,30 @@ FLAGS
1281
1177
  GLOBAL FLAGS
1282
1178
  --json Format output as json.
1283
1179
  --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1180
+ --no-input Disables all the interactive prompts
1284
1181
 
1285
1182
  EXAMPLES
1286
1183
  $ affinidi token update-token -i <uuid> -n MyNewToken -k MyKeyID -f publicKey.pem
1287
1184
 
1288
1185
  $ affinidi token update-token --token-id <uuid> --name "My new token" --key-id "My key ID" --public-key-file publicKey.pem --algorithm RS256
1289
1186
  ```
1187
+
1188
+ ## `affinidi whoami`
1189
+
1190
+ Returns user's subject and principalId from his active session
1191
+
1192
+ ```
1193
+ USAGE
1194
+ $ affinidi whoami [--json] [--no-color] [--no-input]
1195
+
1196
+ GLOBAL FLAGS
1197
+ --json Format output as json.
1198
+ --no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
1199
+ --no-input Disables all the interactive prompts
1200
+
1201
+ EXAMPLES
1202
+ $ affinidi whoami
1203
+ ```
1204
+
1205
+ _See code: [dist/commands/whoami.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.6/dist/commands/whoami.ts)_
1290
1206
  <!-- commandsstop -->