chef-licensing 0.4.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -0
  3. data/chef-licensing.gemspec +35 -0
  4. data/lib/chef-licensing/api/client.rb +39 -0
  5. data/lib/chef-licensing/api/describe.rb +62 -0
  6. data/lib/chef-licensing/api/license_feature_entitlement.rb +55 -0
  7. data/lib/chef-licensing/api/license_software_entitlement.rb +53 -0
  8. data/lib/chef-licensing/api/list_licenses.rb +30 -0
  9. data/lib/chef-licensing/api/parser/client.rb +100 -0
  10. data/lib/chef-licensing/api/parser/describe.rb +118 -0
  11. data/lib/chef-licensing/cli_flags/mixlib_cli.rb +28 -0
  12. data/lib/chef-licensing/cli_flags/thor.rb +21 -0
  13. data/lib/chef-licensing/config.rb +44 -0
  14. data/lib/chef-licensing/config_fetcher/arg_fetcher.rb +38 -0
  15. data/lib/chef-licensing/config_fetcher/env_fetcher.rb +21 -0
  16. data/lib/chef-licensing/context.rb +98 -0
  17. data/lib/chef-licensing/exceptions/client_error.rb +9 -0
  18. data/lib/chef-licensing/exceptions/describe_error.rb +9 -0
  19. data/lib/chef-licensing/exceptions/error.rb +4 -0
  20. data/lib/chef-licensing/exceptions/feature_not_entitled.rb +9 -0
  21. data/lib/chef-licensing/exceptions/invalid_license.rb +10 -0
  22. data/lib/chef-licensing/exceptions/license_generation_failed.rb +9 -0
  23. data/lib/chef-licensing/exceptions/license_generation_rejected.rb +7 -0
  24. data/lib/chef-licensing/exceptions/list_licenses_error.rb +12 -0
  25. data/lib/chef-licensing/exceptions/missing_api_credentials_error.rb +7 -0
  26. data/lib/chef-licensing/exceptions/restful_client_connection_error.rb +9 -0
  27. data/lib/chef-licensing/exceptions/restful_client_error.rb +9 -0
  28. data/lib/chef-licensing/exceptions/software_not_entitled.rb +9 -0
  29. data/lib/chef-licensing/license.rb +151 -0
  30. data/lib/chef-licensing/license_key_fetcher/base.rb +28 -0
  31. data/lib/chef-licensing/license_key_fetcher/chef_licensing_interactions.yaml +534 -0
  32. data/lib/chef-licensing/license_key_fetcher/file.rb +275 -0
  33. data/lib/chef-licensing/license_key_fetcher/prompt.rb +43 -0
  34. data/lib/chef-licensing/license_key_fetcher.rb +314 -0
  35. data/lib/chef-licensing/license_key_generator.rb +47 -0
  36. data/lib/chef-licensing/license_key_validator.rb +24 -0
  37. data/lib/chef-licensing/licensing_service/local.rb +29 -0
  38. data/lib/chef-licensing/list_license_keys.rb +142 -0
  39. data/lib/chef-licensing/restful_client/base.rb +139 -0
  40. data/lib/chef-licensing/restful_client/middleware/exceptions_handler.rb +16 -0
  41. data/lib/chef-licensing/restful_client/v1.rb +17 -0
  42. data/lib/chef-licensing/tui_engine/tui_actions.rb +238 -0
  43. data/lib/chef-licensing/tui_engine/tui_engine.rb +174 -0
  44. data/lib/chef-licensing/tui_engine/tui_engine_state.rb +62 -0
  45. data/lib/chef-licensing/tui_engine/tui_exceptions.rb +17 -0
  46. data/lib/chef-licensing/tui_engine/tui_interaction.rb +17 -0
  47. data/lib/chef-licensing/tui_engine/tui_prompt.rb +117 -0
  48. data/lib/chef-licensing/tui_engine.rb +2 -0
  49. data/lib/chef-licensing/version.rb +3 -0
  50. data/lib/chef-licensing.rb +70 -0
  51. metadata +191 -0
@@ -0,0 +1,534 @@
1
+ :file_format_version: 1.0.0
2
+
3
+ interactions:
4
+ start:
5
+ messages: |
6
+ ------------------------------------------------------------
7
+ License ID Validation
8
+
9
+ To continue using Chef <%= input[:chef_product_name] %>, a license ID is required.
10
+ (Free, Trial, or Commercial)
11
+
12
+ If you generated a license previously, you might
13
+ have received it in an email.
14
+
15
+ If you are a commercial user, you can also find it in the
16
+ <%= input[:pastel].underline.green("supportlink.chef.io")%> portal.
17
+ ------------------------------------------------------------
18
+ prompt_type: "say"
19
+ paths: [ask_if_user_has_license_id]
20
+
21
+ add_license_all:
22
+ messages: ""
23
+ prompt_type: "silent"
24
+ paths: [ask_if_user_has_license_id_for_license_addition]
25
+
26
+ prompt_license_addition_restriction:
27
+ action: set_license_info
28
+ paths: [prompt_error_license_addition_restricted]
29
+
30
+ prompt_error_license_addition_restricted:
31
+ messages: "✖ [Error] License validation failed.\n"
32
+ prompt_type: "error"
33
+ paths: [license_restriction_header_text]
34
+
35
+ license_restriction_header_text:
36
+ action: determine_restriction_type
37
+ paths: [trial_already_exist_message, free_license_already_exist_message, active_trial_exist_message]
38
+ response_path_map:
39
+ "trial_restriction": trial_already_exist_message
40
+ "free_restriction": free_license_already_exist_message
41
+ "active_trial_restriction": active_trial_exist_message
42
+
43
+ trial_already_exist_message:
44
+ messages: "A Trial License already exists with following details: \n"
45
+ prompt_type: "say"
46
+ paths: [add_license_info_in_restriction_flow]
47
+
48
+ free_license_already_exist_message:
49
+ messages: "A Free License already exists with following details: \n"
50
+ prompt_type: "say"
51
+ paths: [add_license_info_in_restriction_flow]
52
+
53
+ active_trial_exist_message:
54
+ messages: "An active Trial License already exists with following details \n"
55
+ prompt_type: "say"
56
+ paths: [add_license_info_in_restriction_flow]
57
+
58
+ add_license_info_in_restriction_flow:
59
+ action: display_license_info
60
+ paths: [license_restriction_foot_text]
61
+
62
+ license_restriction_foot_text:
63
+ action: fetch_license_type_restricted
64
+ paths: [trial_restriction_message, free_restriction_message, only_commercial_allowed_message]
65
+ response_path_map:
66
+ "trial": trial_restriction_message
67
+ "free": free_restriction_message
68
+ "trial_and_free": only_commercial_allowed_message
69
+
70
+ trial_restriction_message:
71
+ prompt_type: "say"
72
+ messages:
73
+ Please generate a Free or Commercial License by running <%= input[:pastel].bold("#{ChefLicensing::Config.chef_executable_name} license add")%>.
74
+ paths: [exit_with_message]
75
+
76
+ free_restriction_message:
77
+ prompt_type: "say"
78
+ messages:
79
+ Please generate a Trial or Commercial License by running <%= input[:pastel].bold("#{ChefLicensing::Config.chef_executable_name} license add")%>.
80
+ paths: [exit_with_message]
81
+
82
+ only_commercial_allowed_message:
83
+ prompt_type: "say"
84
+ messages:
85
+ Please generate a Commercial License by running <%= input[:pastel].bold("#{ChefLicensing::Config.chef_executable_name} license add")%>.
86
+ paths: [exit_with_message]
87
+
88
+ prompt_license_expired:
89
+ messages: |
90
+ ------------------------------------------------------------
91
+ <%= input[:pastel].yellow("! [WARNING]")%> <%= input[:license_type] %> License Expired
92
+
93
+ Get a Commercial License to receive bug fixes, updates
94
+ and new features.
95
+ Get a Free License to scan limited targets.
96
+
97
+ To get a new license, run <%= input[:pastel].bold("#{ChefLicensing::Config.chef_executable_name} license add")%>
98
+ and select a license type.
99
+ ------------------------------------------------------------
100
+ prompt_type: "say"
101
+ paths: [fetch_license_id]
102
+
103
+ prompt_license_expired_local_mode:
104
+ messages: |
105
+ ------------------------------------------------------------
106
+ <%= input[:pastel].yellow("! [WARNING]")%> <%= input[:license_type] %> License Expired
107
+
108
+ Get a Commercial License to receive bug fixes, updates
109
+ and new features.
110
+ Get a Free License to scan limited targets.
111
+ ------------------------------------------------------------
112
+ prompt_type: "say"
113
+ paths: [fetch_license_id]
114
+
115
+ prompt_license_about_to_expire:
116
+ messages: |
117
+ ------------------------------------------------------------
118
+ <%= input[:pastel].yellow("! [WARNING]")%> Your license is about to expire in <%= input[:pastel].bold(input[:number_of_days_in_expiration]) %> <%= input[:pastel].bold("days.") %>
119
+
120
+ To avoid service disruptions, get a Commercial License
121
+ before <%= input[:pastel].bold(input[:license_expiration_date]) %>.
122
+ ------------------------------------------------------------
123
+ prompt_type: "say"
124
+ paths: [fetch_license_id]
125
+
126
+ ask_if_user_has_license_id:
127
+ messages: ["\nPlease choose one of the options below",["I already have a license ID", "I don't have a license ID and would like to generate a new license ID", "Skip"]]
128
+ prompt_type: "timeout_select"
129
+ prompt_attributes:
130
+ timeout_duration: 60
131
+ timeout_message: "\nPrompt timed out. Use non-interactive flags or enter an answer within 60 seconds."
132
+ paths: [ask_for_license_id, info_of_license_types, skip_message]
133
+ response_path_map:
134
+ "I already have a license ID": ask_for_license_id
135
+ "I don't have a license ID and would like to generate a new license ID": info_of_license_types
136
+ "Skip": skip_message
137
+
138
+ skip_message:
139
+ messages: ["\n! [WARNING] A license is required to continue using this product."]
140
+ prompt_type: warn
141
+ paths: [skip_licensing]
142
+
143
+ skip_licensing:
144
+ messages: ["\nAre you sure to skip this step?",["Skip", "Generate a new license ID", "I already have a license ID"]]
145
+ prompt_type: "select"
146
+ paths: [ask_for_license_id, info_of_license_types, skipped]
147
+ response_path_map:
148
+ "I already have a license ID": ask_for_license_id
149
+ "Generate a new license ID": info_of_license_types
150
+ "Skip": skipped
151
+
152
+ ask_if_user_has_license_id_for_license_addition:
153
+ messages: ["\nPlease choose one of the options below",["Validate a generated license ID", "Generate a new license ID", "Quit license addition"]]
154
+ prompt_type: "timeout_select"
155
+ prompt_attributes:
156
+ timeout_duration: 60
157
+ timeout_message: "\nPrompt timed out. Use non-interactive flags or enter an answer within 60 seconds."
158
+ paths: [ask_for_license_id, info_of_license_types, exit]
159
+ response_path_map:
160
+ "Validate a generated license ID": ask_for_license_id
161
+ "Generate a new license ID": info_of_license_types
162
+ "Quit license addition": exit
163
+
164
+ skipped:
165
+ messages: "License ID validation skipped!"
166
+ paths: [exit_with_message]
167
+
168
+ ask_for_license_id:
169
+ messages: "Please enter your license ID: "
170
+ prompt_type: "ask"
171
+ paths: [validate_license_id_pattern]
172
+
173
+ validate_license_id_pattern:
174
+ action: is_license_with_valid_pattern?
175
+ paths: [validate_license_id_with_api, ask_for_license_id]
176
+ response_path_map:
177
+ "true": validate_license_id_with_api
178
+ "false": ask_for_license_id
179
+ description: "is_license_with_valid_pattern? is a method defined in TUIActions class"
180
+
181
+ validate_license_id_with_api:
182
+ action: is_license_valid_on_server?
183
+ paths: [validate_license_restriction, fetch_invalid_license_msg]
184
+ response_path_map:
185
+ "true": validate_license_restriction
186
+ "false": fetch_invalid_license_msg
187
+ description: "is_license_valid_on_server? is a method defined in TUIActions class"
188
+
189
+ validate_license_restriction:
190
+ action: is_license_allowed?
191
+ paths: [validate_license_expiration, prompt_error_license_addition_restricted]
192
+ response_path_map:
193
+ "true": validate_license_expiration
194
+ "false": prompt_error_license_addition_restricted
195
+
196
+ validate_license_expiration:
197
+ action: license_expiration_status?
198
+ paths: [validation_success, prompt_license_about_to_expire, prompt_license_expired, prompt_license_expired_local_mode]
199
+ response_path_map:
200
+ "active": validation_success
201
+ "about_to_expire": prompt_license_about_to_expire
202
+ "expired": prompt_license_expired
203
+ "expired_in_local_mode": prompt_license_expired_local_mode
204
+
205
+ validation_success:
206
+ messages: "✔ [Success] License validated successfully."
207
+ prompt_type: "ok"
208
+ paths: [display_license_info]
209
+
210
+ display_license_info:
211
+ action: display_license_info
212
+ paths: [fetch_license_id]
213
+
214
+ fetch_invalid_license_msg:
215
+ action: fetch_invalid_license_msg
216
+ paths: [validation_failure]
217
+
218
+ validation_failure:
219
+ messages: "✖ [Error] License validation failed: <%= input[:fetch_invalid_license_msg] %>."
220
+ prompt_type: "error"
221
+ paths: [retry_message]
222
+
223
+ retry_message:
224
+ messages: "Please try again."
225
+ paths: [ask_for_license_id]
226
+
227
+ info_of_license_types:
228
+ messages: |
229
+ Thank you for taking interest in <%= input[:chef_product_name] %>.
230
+
231
+ We have the following types of licenses.
232
+ prompt_type: "say"
233
+ paths: [filter_license_type_options]
234
+
235
+ filter_license_type_options:
236
+ action: filter_license_type_options
237
+ paths: [ask_for_all_license_type, ask_for_license_except_trial, ask_for_commercial_only, ask_for_license_except_free]
238
+ response_path_map:
239
+ "ask_for_all_license_type": ask_for_all_license_type
240
+ "ask_for_license_except_trial": ask_for_license_except_trial
241
+ "ask_for_commercial_only": ask_for_commercial_only
242
+ "ask_for_license_except_free": ask_for_license_except_free
243
+
244
+ ask_for_commercial_only:
245
+ prompt_type: "select"
246
+ messages: ["Select the type of license below and then enter user details\n" ,
247
+ [
248
+ "1. Commercial License\n",
249
+ "2. Quit license generation."
250
+ ]]
251
+ paths: [commercial_license_selection, exit]
252
+ response_path_map:
253
+ "1. Commercial License\n": commercial_license_selection
254
+ "2. Quit license generation": exit
255
+
256
+ ask_for_license_except_trial:
257
+ prompt_type: "select"
258
+ messages: ["Select the type of license below and then enter user details\n" ,
259
+ [
260
+ "1. Free License\n Validity: Unlimited\n No. of targets: 10\n",
261
+ "2. Commercial License\n",
262
+ "3. Quit license generation"
263
+ ]]
264
+ paths: [free_license_disclaimer, commercial_license_selection, exit]
265
+ response_path_map:
266
+ "1. Free License\n Validity: Unlimited\n No. of targets: 10\n": free_license_disclaimer
267
+ "2. Commercial License\n": commercial_license_selection
268
+ "3. Quit license generation": exit
269
+
270
+ ask_for_license_except_free:
271
+ prompt_type: "select"
272
+ messages: ["Select the type of license below and then enter user details\n" ,
273
+ [
274
+ "1. Trial License\n Validity: 30 Days\n No. of targets: Unlimited\n",
275
+ "2. Commercial License\n",
276
+ "3. Quit license generation"
277
+ ]]
278
+ paths: [trial_license_selection, commercial_license_selection, exit]
279
+ response_path_map:
280
+ "1. Trial License\n Validity: 30 Days\n No. of targets: Unlimited\n": trial_license_selection
281
+ "2. Commercial License\n": commercial_license_selection
282
+ "3. Quit license generation": exit
283
+
284
+ ask_for_all_license_type:
285
+ prompt_type: "select"
286
+ messages: ["Select the type of license below and then enter user details\n" ,
287
+ [
288
+ "1. Free License\n Validity: Unlimited\n No. of targets: 10\n",
289
+ "2. Trial License\n Validity: 30 Days\n No. of targets: Unlimited\n",
290
+ "3. Commercial License\n",
291
+ "4. Quit license generation"
292
+ ]]
293
+ paths: [free_license_disclaimer, commercial_license_selection, trial_license_selection, exit]
294
+ response_path_map:
295
+ "1. Free License\n Validity: Unlimited\n No. of targets: 10\n": free_license_disclaimer
296
+ "2. Trial License\n Validity: 30 Days\n No. of targets: Unlimited\n": trial_license_selection
297
+ "3. Commercial License\n": commercial_license_selection
298
+ "4. Quit license generation": exit
299
+
300
+ free_license_disclaimer:
301
+ messages: '<%= input[:pastel].bold("A Free License can be used for personal, non-commercial use only.\n")%>'
302
+ prompt_type: "warn"
303
+ paths: [free_license_selection]
304
+
305
+ free_license_selection:
306
+ messages: "Type: Free License\n Validity: Unlimited\n No. of targets: 10\n"
307
+ prompt_type: "silent"
308
+ paths: [check_if_user_details_are_present]
309
+
310
+ trial_license_selection:
311
+ messages: "Type: Trial License\n Validity: 30 days\n No. of targets: Unlimited\n"
312
+ prompt_type: "silent"
313
+ paths: [check_if_user_details_are_present]
314
+
315
+ commercial_license_selection:
316
+ messages: ["Get in touch with the Sales Team by filling out the form available at <%= input[:pastel].blue.underline.blue(\"https://www.chef.io/contact-us\") %>\n",
317
+ [Quit]
318
+ ]
319
+ prompt_type: "select"
320
+ paths: [exit_with_message]
321
+
322
+ check_if_user_details_are_present:
323
+ action: are_user_details_present?
324
+ paths: [ask_for_user_details, print_to_review_details]
325
+ response_path_map:
326
+ "true": "print_to_review_details"
327
+ "false": "ask_for_user_details"
328
+
329
+ ask_for_user_details:
330
+ messages: |
331
+ Please enter the following details:
332
+ First Name, Last Name, Email, Company, Phone
333
+
334
+ paths: [gather_user_first_name_for_license_generation]
335
+
336
+ gather_user_first_name_for_license_generation:
337
+ messages: "Enter First Name: "
338
+ prompt_type: "ask"
339
+ paths: [validate_user_first_name_for_license_generation]
340
+
341
+ validate_user_first_name_for_license_generation:
342
+ action: is_user_name_valid?
343
+ paths: [gather_user_last_name_for_license_generation, user_first_name_validation_failure]
344
+ response_path_map:
345
+ "true": gather_user_last_name_for_license_generation
346
+ "false": user_first_name_validation_failure
347
+
348
+ user_first_name_validation_failure:
349
+ messages: "Invalid name. It should contain only A-Z/a-z alphabets."
350
+ prompt_type: "error"
351
+ paths: [gather_user_first_name_for_license_generation]
352
+
353
+ gather_user_last_name_for_license_generation:
354
+ messages: "Enter Last Name: "
355
+ prompt_type: "ask"
356
+ paths: [validate_user_last_name_for_license_generation]
357
+
358
+ validate_user_last_name_for_license_generation:
359
+ action: is_user_name_valid?
360
+ paths: [gather_user_email_for_license_generation, user_last_name_validation_failure]
361
+ response_path_map:
362
+ "true": gather_user_email_for_license_generation
363
+ "false": user_last_name_validation_failure
364
+
365
+ user_last_name_validation_failure:
366
+ messages: "Invalid name. It should contain only A-Z/a-z alphabets."
367
+ prompt_type: "error"
368
+ paths: [gather_user_last_name_for_license_generation]
369
+
370
+ gather_user_email_for_license_generation:
371
+ messages: "Enter Email Address: "
372
+ prompt_type: "ask"
373
+ paths: [validate_user_email_for_license_generation]
374
+
375
+ validate_user_email_for_license_generation:
376
+ action: is_email_valid?
377
+ paths: [gather_user_company_for_license_generation, user_email_validation_failure]
378
+ response_path_map:
379
+ "true": gather_user_company_for_license_generation
380
+ "false": user_email_validation_failure
381
+
382
+ user_email_validation_failure:
383
+ messages: "Invalid email address."
384
+ prompt_type: "error"
385
+ paths: [gather_user_email_for_license_generation]
386
+
387
+ gather_user_company_for_license_generation:
388
+ messages: "Enter Company Name: "
389
+ prompt_type: "ask"
390
+ paths: [validate_user_company_name_for_license_generation]
391
+
392
+ validate_user_company_name_for_license_generation:
393
+ action: is_company_name_valid?
394
+ paths: [gather_user_phone_no_for_license_generation, user_company_name_validation_failure]
395
+ response_path_map:
396
+ "true": gather_user_phone_no_for_license_generation
397
+ "false": user_company_name_validation_failure
398
+
399
+ user_company_name_validation_failure:
400
+ messages: "Invalid company name. It should contain only A-Z/a-z alphabets, numbers or special characters."
401
+ prompt_type: "error"
402
+ paths: [gather_user_company_for_license_generation]
403
+
404
+ gather_user_phone_no_for_license_generation:
405
+ messages: "Enter phone number: "
406
+ prompt_type: "ask"
407
+ paths: [validate_user_phone_no]
408
+
409
+ validate_user_phone_no:
410
+ action: is_phone_no_valid?
411
+ paths: [print_to_review_details, user_phone_no_validation_failure]
412
+ response_path_map:
413
+ "true": print_to_review_details
414
+ "false": user_phone_no_validation_failure
415
+
416
+ user_phone_no_validation_failure:
417
+ messages: "Please enter a valid phone number."
418
+ prompt_type: "error"
419
+ paths: [gather_user_phone_no_for_license_generation]
420
+
421
+ print_to_review_details:
422
+ messages: |
423
+ ------------------------------------------------------------
424
+ Review the details below and confirm to proceed.
425
+ ------------------------------------------------------------
426
+ License Details
427
+
428
+ <%= input[:free_license_selection] || input[:trial_license_selection] %>
429
+ User Details
430
+
431
+ First Name: <%= input[:gather_user_first_name_for_license_generation] %>
432
+ Last Name: <%= input[:gather_user_last_name_for_license_generation] %>
433
+ Email: <%= input[:gather_user_email_for_license_generation] %>
434
+ Company: <%= input[:gather_user_company_for_license_generation] %>
435
+ Phone number: <%= input[:gather_user_phone_no_for_license_generation] %>
436
+ ------------------------------------------------------------
437
+ prompt_type: "say"
438
+ paths: [ask_for_review_confirmation]
439
+
440
+ ask_for_review_confirmation:
441
+ prompt_type: "select"
442
+ messages: ["Please select", ["Confirm the details and proceed", "Reselect the license type", "Edit user details", "Quit the license generation process"]]
443
+ paths: [pre_license_generation, clear_current_license_type_selection, ask_for_user_details, exit]
444
+ response_path_map:
445
+ "Confirm the details and proceed": pre_license_generation
446
+ "Reselect the license type": clear_current_license_type_selection
447
+ "Edit user details": ask_for_user_details
448
+ "Quit the license generation process": exit
449
+
450
+ clear_current_license_type_selection:
451
+ action: clear_license_type_selection
452
+ paths: [info_of_license_types]
453
+
454
+ pre_license_generation:
455
+ action: select_license_generation_based_on_type
456
+ paths: [generate_free_license, generate_trial_license]
457
+ response_path_map:
458
+ "free": generate_free_license
459
+ "trial": generate_trial_license
460
+
461
+ generate_free_license:
462
+ action: generate_free_license
463
+ paths: [free_license_generation_success, license_generation_failure]
464
+ response_path_map:
465
+ "true": free_license_generation_success
466
+ "false": license_generation_failure
467
+
468
+ generate_trial_license:
469
+ action: generate_trial_license
470
+ paths: [trial_license_generation_success, license_generation_failure]
471
+ response_path_map:
472
+ "true": trial_license_generation_success
473
+ "false": license_generation_failure
474
+
475
+ free_license_generation_success:
476
+ messages: |
477
+ <%= input[:pastel].green("✔ [Success] License generated successfully") %>
478
+
479
+ The license ID has been sent to <%= input[:gather_user_email_for_license_generation] %>.
480
+ paths: [ask_for_license_id]
481
+
482
+ trial_license_generation_success:
483
+ messages: |
484
+ <%= input[:pastel].green("✔ [Success] License generated successfully") %>
485
+
486
+ The license ID has been sent to <%= input[:gather_user_email_for_license_generation] %>.
487
+ paths: [ask_for_license_id]
488
+
489
+ fetch_license_id:
490
+ action: fetch_license_id
491
+ paths: [exit]
492
+
493
+ license_generation_failure:
494
+ messages: "✖ [Error] License generation failed."
495
+ prompt_type: "error"
496
+ paths: [check_failure_reason]
497
+
498
+ check_failure_reason:
499
+ action: license_generation_rejected?
500
+ paths: [fetch_license_failure_error_msg, fetch_license_failure_rejection_msg]
501
+ response_path_map:
502
+ "true": fetch_license_failure_rejection_msg
503
+ "false": fetch_license_failure_error_msg
504
+
505
+ fetch_license_failure_error_msg:
506
+ action: fetch_license_failure_error_msg
507
+ paths: [license_generation_with_errors]
508
+
509
+ fetch_license_failure_rejection_msg:
510
+ action: fetch_license_failure_rejection_msg
511
+ paths: [license_generation_rejected]
512
+
513
+ license_generation_rejected:
514
+ messages: ["Your request for a license was denied for the following reason: <%= input[:fetch_license_failure_rejection_msg] %>. Please select one of the following options:", ["Try again", "Skip"]]
515
+ prompt_type: "select"
516
+ paths: [pre_license_generation, skip_message]
517
+ response_path_map:
518
+ "Try again": pre_license_generation
519
+ "Skip": skip_message
520
+
521
+ license_generation_with_errors:
522
+ messages: ["\nAn error occurred while generating your license.\nError message: <%= input[:fetch_license_failure_error_msg] %>\n", ["Try again", "Skip"]]
523
+ prompt_type: "select"
524
+ paths: [pre_license_generation, skip_message]
525
+ response_path_map:
526
+ "Try again": pre_license_generation
527
+ "Skip": skip_message
528
+
529
+ exit:
530
+ messages: ""
531
+
532
+ exit_with_message:
533
+ messages: "Thank you."
534
+ paths: [exit]