forked from auth0/auth0-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommander.yaml
641 lines (554 loc) Β· 20.5 KB
/
commander.yaml
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
config:
inherit-env: true
tests:
auth0 apis list:
exit-code: 0
auth0 apps list:
exit-code: 0
auth0 logs list:
exit-code: 0
auth0 logs streams list:
exit-code: 0
auth0 tenants list:
exit-code: 0
auth0 roles list:
exit-code: 0
auth0 rules list:
exit-code: 0
auth0 actions list:
exit-code: 0
auth0 orgs list:
exit-code: 0
auth0 branding domains list:
exit-code: 0
auth0 quickstarts list:
exit-code: 0
auth0 completion bash:
exit-code: 0
# Test 'apps create' --type flag
apps create type native and check data:
command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1 --format json
exit-code: 0
stdout:
json:
name: integration-test-app-nativeapp1
description: NativeApp1
app_type: native
apps create type native and check output:
command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1
exit-code: 0
stdout:
contains:
- NAME integration-test-app-nativeapp1
- DESCRIPTION NativeApp1
- TYPE Native
apps create type spa:
command: auth0 apps create --name integration-test-app-spaapp1 --type spa --description SpaApp1 --format json
exit-code: 0
stdout:
json:
name: integration-test-app-spaapp1
description: SpaApp1
app_type: spa
apps create type regular:
command: auth0 apps create --name integration-test-app-regapp1 --type regular --description RegApp1 --format json
exit-code: 0
stdout:
json:
name: integration-test-app-regapp1
description: RegApp1
app_type: regular_web
apps create type m2m:
command: auth0 apps create --name integration-test-app-m2mapp1 --type m2m --description M2mApp1 --format json
exit-code: 0
stdout:
json:
name: integration-test-app-m2mapp1
description: M2mApp1
app_type: non_interactive
# Test 'apps create' --auth-method flag
apps create type spa auth method none:
command: auth0 apps create --name integration-test-app-spaapp2 --type spa --description SpaApp2 --auth-method None --format json
stdout:
json:
token_endpoint_auth_method: none
exit-code: 0
apps create type m2m auth method none fails:
command: auth0 apps create --name integration-test-app-m2mapp2 --type m2m --description M2mApp2 --auth-method None
exit-code: 1
apps create type regular auth method post:
command: auth0 apps create --name integration-test-app-regapp2 --type regular --description RegApp2 --auth-method Post --format json
stdout:
json:
token_endpoint_auth_method: client_secret_post
exit-code: 0
apps create type regular auth method basic:
command: auth0 apps create --name integration-test-app-regapp3 --type regular --description RegApp3 --auth-method Basic --format json
stdout:
json:
token_endpoint_auth_method: client_secret_basic
exit-code: 0
# Test 'apps create' --callbacks flag
apps create type m2m callbacks:
command: auth0 apps create --name integration-test-app-m2mapp3 --type m2m --description M2mApp3 --callbacks https://example.com
stdout:
contains:
- CALLBACKS https://example.com
exit-code: 0
apps create type regular callbacks list:
command: auth0 apps create --name integration-test-app-regapp4 --type regular --description RegApp4 --callbacks https://example.com,https://google.com --format json
stdout:
json:
callbacks: "[https://example.com https://google.com]"
exit-code: 0
# Test 'apps create' --grants flag
apps create type regular grants:
command: auth0 apps create --name integration-test-app-regapp5 --type regular --description RegApp4 --grants credentials,password
stdout:
contains:
- GRANTS client_credentials, password
exit-code: 0
apps create type spa grants:
command: auth0 apps create --name integration-test-app-spaapp3 --type spa --description SpaApp3 --grants refresh-token --format json
stdout:
json:
grant_types: "[refresh_token]"
exit-code: 0
apps create type native grants:
command: auth0 apps create --name integration-test-app-nativeapp2 --type native --description NativeApp2 --grants refresh-token,code --format json
stdout:
json:
grant_types: "[refresh_token authorization_code]"
exit-code: 0
apps create type m2m grants fails:
command: auth0 apps create --name integration-test-app-m2mapp4 --type m2m --description M2mApp4 --grants credentials,device-code
exit-code: 1
# Test 'apps create' --logout-urls flag
apps create type regular logout urls:
command: auth0 apps create --name integration-test-app-regapp6 --type native --description RegularApp --logout-urls https://*.example.com/logout,https://example.com/logout --format json
stdout:
json:
allowed_logout_urls: "[https://*.example.com/logout https://example.com/logout]"
exit-code: 0
# Test 'apps create' --origins flag
apps create type regular origins:
command: auth0 apps create --name integration-test-app-regapp7 --type native --description RegularApp --origins https://*.example.com,https://example.com --format json
stdout:
json:
allowed_origins: "[https://*.example.com https://example.com]"
exit-code: 0
# Test 'apps create' --web-origins flag
apps create type native web origins:
command: auth0 apps create --name integration-test-app-spaapp4 --type native --description SpaApp4 --web-origins https://example.com --format json
stdout:
json:
web_origins: "[https://example.com]"
exit-code: 0
# Test 'apps show'
apps create test app: # create an app and capture its client id
command: ./integration/get-app-id.sh
exit-code: 0
apps show json:
command: auth0 apps show $(cat ./integration/identifiers/app-id) --format json # depends on "apps create test app" test
stdout:
json:
name: integration-test-app-newapp
description: NewApp
app_type: native
exit-code: 0
apps show:
command: auth0 apps show $(cat ./integration/identifiers/app-id) # depends on "apps create test app" test
stdout:
contains:
- NAME integration-test-app-newapp
- DESCRIPTION NewApp
- TYPE Native
exit-code: 0
# Test 'apps update'; all tests depend on "apps create test app" test
apps update auth method:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --auth-method Basic --format json
stdout:
json:
token_endpoint_auth_method: client_secret_basic
exit-code: 0
apps update callbacks:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --callbacks https://example.com --format json
stdout:
json:
callbacks: "[https://example.com]"
exit-code: 0
apps update description:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --description "A better description" --format json
stdout:
json:
description: A better description
exit-code: 0
apps update grants:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --grants code --format json
stdout:
json:
grant_types: "[authorization_code]"
exit-code: 0
apps update logout urls:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --logout-urls https://example.com --format json
stdout:
json:
allowed_logout_urls: "[https://example.com]"
exit-code: 0
apps update name:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --name integration-test-app-betterAppName --format json
stdout:
json:
name: integration-test-app-betterAppName
exit-code: 0
apps update origins:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --origins https://example.com --format json
stdout:
json:
allowed_origins: "[https://example.com]"
exit-code: 0
apps update type:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --type spa --format json
stdout:
json:
app_type: spa
exit-code: 0
apps update web origins:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --web-origins https://example.com --format json
stdout:
json:
web_origins: "[https://example.com]"
exit-code: 0
apps update multiple updates:
command: auth0 apps update $(cat ./integration/identifiers/app-id) --web-origins https://examples.com --type native --format json
stdout:
json:
app_type: native
web_origins: "[https://examples.com]"
exit-code: 0
# Test 'apis create'
apis create and check data:
command: auth0 apis create --name integration-test-api-def1 --identifier http://integration-test-api-def1 --scopes read:todos,write:todos --format json
exit-code: 0
stdout:
json:
name: integration-test-api-def1
identifier: http://integration-test-api-def1
scopes: "[map[value:read:todos] map[value:write:todos]]"
token_lifetime: "86400"
allow_offline_access: "false"
apis create and check output:
command: auth0 apis create --name integration-test-api-def2 --identifier http://integration-test-api-def2 --scopes read:todos,write:todos
exit-code: 0
stdout:
contains:
- NAME integration-test-api-def2
- IDENTIFIER http://integration-test-api-def2
- SCOPES read:todos write:todos
- TOKEN LIFETIME 86400
- ALLOW OFFLINE ACCESS β
# Test 'apis create' --token-lifetime flag
apis create token lifetime 1000 and check data:
command: auth0 apis create --name integration-test-api-toklif1 --identifier http://integration-test-api-toklif1 --scopes read:todos --token-lifetime 1000 --format json
exit-code: 0
stdout:
json:
token_lifetime: "1000"
apis create token lifetime 1000 and check output:
command: auth0 apis create --name integration-test-api-toklif2 --identifier http://integration-test-api-toklif2 --scopes read:todos --token-lifetime 1000
exit-code: 0
stdout:
contains:
- TOKEN LIFETIME 1000
# Test 'apis create' --offline-access flag
apis create offline access true and check data:
command: auth0 apis create --name integration-test-api-offacc1 --identifier http://integration-test-api-offacc1 --scopes read:todos --offline-access --format json
exit-code: 0
stdout:
json:
allow_offline_access: "true"
apis create offline access true and check output:
command: auth0 apis create --name integration-test-api-offacc2 --identifier http://integration-test-api-offacc2 --scopes read:todos --offline-access
exit-code: 0
stdout:
contains:
- ALLOW OFFLINE ACCESS β
apis create offline access false and check data:
command: auth0 apis create --name integration-test-api-offacc3 --identifier http://integration-test-api-offacc3 --scopes read:todos --offline-access=false --format json
exit-code: 0
stdout:
json:
allow_offline_access: "false"
# Test 'apps show'
apis create test api: # create an api and capture its id
command: ./integration/get-api-id.sh
exit-code: 0
apis show json:
command: auth0 apis show $(cat ./integration/identifiers/api-id) --format json # depends on "apis create test app" test
stdout:
json:
name: integration-test-api-newapi
identifier: http://integration-test-api-newapi
scopes: "[map[value:read:todos]]"
token_lifetime: "86400"
allow_offline_access: "false"
exit-code: 0
apis show:
command: auth0 apis show $(cat ./integration/identifiers/api-id) # depends on "apis create test app" test
stdout:
contains:
- NAME integration-test-api-newapi
- IDENTIFIER http://integration-test-api-newapi
- SCOPES read:todos
- TOKEN LIFETIME 86400
- ALLOW OFFLINE ACCESS β
exit-code: 0
apis scopes list:
command: auth0 apis scopes list $(cat ./integration/identifiers/api-id) # depends on "apis create test app" test
exit-code: 0
# Test 'apis update'; all tests depend on "apis create test api" test
apis update name:
command: auth0 apis update $(cat ./integration/identifiers/api-id) --name integration-test-api-betterApiName --format json
stdout:
json:
name: integration-test-api-betterApiName
exit-code: 0
apis update scopes:
command: auth0 apis update $(cat ./integration/identifiers/api-id) --scopes read:todos,write:todos --format json
stdout:
json:
scopes: "[map[value:read:todos] map[value:write:todos]]"
exit-code: 0
apis update token lifetime:
command: auth0 apis update $(cat ./integration/identifiers/api-id) --token-lifetime 1000 --format json
stdout:
json:
token_lifetime: "1000"
exit-code: 0
apis update offline access true:
command: auth0 apis update $(cat ./integration/identifiers/api-id) --offline-access --format json
stdout:
json:
allow_offline_access: "true"
exit-code: 0
apis update offline access false:
command: auth0 apis update $(cat ./integration/identifiers/api-id) --offline-access=false --format json
stdout:
json:
allow_offline_access: "false"
exit-code: 0
# Test 'users create'
users create and check data:
command: auth0 users create --name integration-test-user-new --connection Username-Password-Authentication --email [email protected] --password testUser12 --format json --no-input
exit-code: 0
stdout:
json:
email: "[email protected]"
connection: "Username-Password-Authentication"
users create and check output:
command: auth0 users create --name integration-test-user-new2 --connection Username-Password-Authentication --email [email protected] --password testUser12 --no-input
exit-code: 0
stdout:
contains:
- EMAIL [email protected]
- CONNECTION Username-Password-Authentication
# Test 'users show'
users create test user:
command: ./integration/get-user-id.sh
exit-code: 0
users show json:
command: auth0 users show $(cat ./integration/identifiers/user-id) --format json
stdout:
json:
email: "[email protected]"
connection: "Username-Password-Authentication"
exit-code: 0
users show:
command: auth0 users show $(cat ./integration/identifiers/user-id)
stdout:
contains:
- EMAIL [email protected]
- CONNECTION Username-Password-Authentication
exit-code: 0
# Test 'users update'
users update email:
command: auth0 users update $(cat ./integration/identifiers/user-id) --email [email protected] --format json --no-input
stdout:
json:
email: [email protected]
exit-code: 0
users update name:
command: auth0 users update $(cat ./integration/identifiers/user-id) --name integration-test-user-bettername --format json --no-input
stdout:
json:
email: [email protected] # Name is not being displayed, hence using email
exit-code: 0
# Test 'roles create'
roles create and check data:
command: auth0 roles create --name integration-test-role-new1 --description testRole --format json --no-input
exit-code: 0
stdout:
json:
name: integration-test-role-new1
description: testRole
roles create and check output:
command: auth0 roles create --name integration-test-role-new2 --description testRole2 --no-input
stdout:
contains:
- NAME integration-test-role-new2
- DESCRIPTION testRole2
exit-code: 0
# Test 'roles show'
roles create test role:
command: ./integration/get-role-id.sh
exit-code: 0
roles show json:
command: auth0 roles show $(cat ./integration/identifiers/role-id) --format json
stdout:
json:
name: integration-test-role-newRole
description: integration-test-role
exit-code: 0
roles show:
command: auth0 roles show $(cat ./integration/identifiers/role-id)
stdout:
contains:
- NAME integration-test-role-newRole
- DESCRIPTION integration-test-role
exit-code: 0
# Test 'roles update'
roles update name:
command: auth0 roles update $(cat ./integration/identifiers/role-id) --name integration-test-role-betterName --format json
stdout:
json:
name: integration-test-role-betterName
exit-code: 0
roles update description:
command: auth0 roles update $(cat ./integration/identifiers/role-id) --description betterDescription --format json
stdout:
json:
description: betterDescription
exit-code: 0
# Test 'rules create'
rules create and check data:
command: cat ./integration/fixtures/create-rule.json | jq '.[0]' | auth0 rules create --format json
stdout:
json:
name: integration-test-rule-new1
enabled: "true"
order: "1"
script: "function(user, context, cb) {\n cb(null, user, context);\n}\n"
exit-code: 0
rules create and check output:
command: cat ./integration/fixtures/create-rule.json | jq '.[1]' | auth0 rules create
stdout:
contains:
- NAME integration-test-rule-new2
- ENABLED β
- ORDER 2
- SCRIPT function(user, context, cb) {
exit-code: 0
# Test 'rules show'
rules create test rule:
command: ./integration/get-rule-id.sh
exit-code: 0
rules show json:
command: auth0 rules show $(cat ./integration/identifiers/rule-id) --format json
stdout:
json:
name: integration-test-rule-newRule
enabled: "true"
order: "3"
exit-code: 0
rules show:
command: auth0 rules show $(cat ./integration/identifiers/rule-id)
stdout:
contains:
- NAME integration-test-rule-newRule
- ENABLED β
- ORDER 3
exit-code: 0
# Test 'rules update'
rules update:
command: cat ./integration/fixtures/update-rule.json | auth0 rules update --format json
stdout:
json:
name: integration-test-rule-betterName
enabled: "false"
exit-code: 0
# Test 'rules enable'
rules enable:
command: auth0 rules enable $(cat ./integration/identifiers/rule-id) --format json
stdout:
json:
enabled: "true"
exit-code: 0
# Test 'rules disable'
rules disable:
command: auth0 rules disable $(cat ./integration/identifiers/rule-id) --format json
stdout:
json:
enabled: "false"
exit-code: 0
attack protection show breached password detection:
command: auth0 attack-protection breached-password-detection show
stdout:
contains:
- ENABLED
- SHIELDS
- ADMIN_NOTIFICATION_FREQUENCY
- METHOD
exit-code: 0
attack protection show brute force protection:
command: auth0 attack-protection brute-force-protection show
stdout:
contains:
- ENABLED
- SHIELDS
- ALLOW_LIST
- MODE
- MAX_ATTEMPTS
exit-code: 0
attack protection show suspicious ip throttling:
command: auth0 attack-protection suspicious-ip-throttling show
stdout:
contains:
- ENABLED
- SHIELDS
- ALLOW_LIST
- STAGE_PRE_LOGIN_MAX_ATTEMPTS
- STAGE_PRE_LOGIN_RATE
- STAGE_PRE_USER_REGISTRATION_MAX_ATTEMPTS
- STAGE_PRE_USER_REGISTRATION_RATE
exit-code: 0
attack protection update breached password detection:
command: auth0 attack-protection breached-password-detection update --enabled
stdout:
contains:
- ENABLED
- SHIELDS
- ADMIN_NOTIFICATION_FREQUENCY
- METHOD
exit-code: 0
attack protection update brute force protection:
command: auth0 attack-protection brute-force-protection update --enabled
stdout:
contains:
- ENABLED
- SHIELDS
- ALLOW_LIST
- MODE
- MAX_ATTEMPTS
exit-code: 0
attack protection update suspicious ip throttling:
command: auth0 attack-protection suspicious-ip-throttling update --enabled
stdout:
contains:
- ENABLED
- SHIELDS
- ALLOW_LIST
- STAGE_PRE_LOGIN_MAX_ATTEMPTS
- STAGE_PRE_LOGIN_RATE
- STAGE_PRE_USER_REGISTRATION_MAX_ATTEMPTS
- STAGE_PRE_USER_REGISTRATION_RATE
exit-code: 0