@w3-commons/js-build-resources 0.0.1-security → 1.0.4

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.

Potentially problematic release.


This version of @w3-commons/js-build-resources might be problematic. Click here for more details.

Files changed (98) hide show
  1. package/package.json +9 -3
  2. package/settings-service/.eslintrc.js +4 -0
  3. package/settings-service/.node-version +1 -0
  4. package/settings-service/.prettierrc +6 -0
  5. package/settings-service/.whitesource +15 -0
  6. package/settings-service/LICENSE +4 -0
  7. package/settings-service/README.md +50 -0
  8. package/settings-service/build.yml +56 -0
  9. package/settings-service/collectCodeCoverage.js +9 -0
  10. package/settings-service/db/cassandra/Dockerfile +3 -0
  11. package/settings-service/db/cassandra/createkeyspace.dev.cql +4 -0
  12. package/settings-service/db/cassandra/createkeyspace.dev.sh +3 -0
  13. package/settings-service/db/cassandra/schema_001.cql +15 -0
  14. package/settings-service/db/cassandra/schema_002.cql +8 -0
  15. package/settings-service/db/cassandra/schema_003.cql +10 -0
  16. package/settings-service/db/cassandra/schema_004.cql +1 -0
  17. package/settings-service/db/cassandra/schema_005.cql +39 -0
  18. package/settings-service/db/cassandra/schema_006.cql +255 -0
  19. package/settings-service/db/cassandra/schema_007.cql +40 -0
  20. package/settings-service/db/cassandra/schema_008.cql +2 -0
  21. package/settings-service/db/cassandra/schema_009.cql +143 -0
  22. package/settings-service/db/cassandra/schema_010.cql +143 -0
  23. package/settings-service/db/cassandra/schema_011.cql +2 -0
  24. package/settings-service/db/cassandra/schema_012.cql +8 -0
  25. package/settings-service/jest.config.fn.js +3 -0
  26. package/settings-service/jest.config.it.js +3 -0
  27. package/settings-service/jest.config.js +14 -0
  28. package/settings-service/jest.config.unit.js +19 -0
  29. package/settings-service/jest.setup.js +11 -0
  30. package/settings-service/package-lock.json +11772 -0
  31. package/settings-service/package.json +101 -0
  32. package/settings-service/scripts/run-fn-tests.sh +3 -0
  33. package/settings-service/sonar-project.properties +3 -0
  34. package/settings-service/src/__tests__/functional/controller/ApiKeyController.fn.ts +132 -0
  35. package/settings-service/src/__tests__/functional/middleware/AuthMiddlewareNextGenSSO.fn.ts +82 -0
  36. package/settings-service/src/__tests__/functional/repo/settingsRepo.fn.ts +302 -0
  37. package/settings-service/src/__tests__/functional/unified-profile/unified-profile.fn.ts +66 -0
  38. package/settings-service/src/__tests__/integration/repo/ApiKeyRepo.it.ts +43 -0
  39. package/settings-service/src/__tests__/integration/repo/settingsRepo.it.ts +142 -0
  40. package/settings-service/src/__tests__/integration/unified-profile/unified-profile.it.ts +31 -0
  41. package/settings-service/src/__tests__/unit/ErrResponse.ts +4 -0
  42. package/settings-service/src/__tests__/unit/JWTResponse.ts +18 -0
  43. package/settings-service/src/__tests__/unit/bluepagesResponse.ts +25 -0
  44. package/settings-service/src/__tests__/unit/controller/ApiKeyController.spec.ts +217 -0
  45. package/settings-service/src/__tests__/unit/controller/AppSettingsController.spec.ts +133 -0
  46. package/settings-service/src/__tests__/unit/controller/UserSettingsController.spec.ts +328 -0
  47. package/settings-service/src/__tests__/unit/controller/getAllSettings.spec.ts +83 -0
  48. package/settings-service/src/__tests__/unit/middleware/AuthMiddlewareNextGenSSO.spec.ts +282 -0
  49. package/settings-service/src/__tests__/unit/middleware/AuthenticationMiddleware.spec.ts +494 -0
  50. package/settings-service/src/__tests__/unit/repo/ApiKeyRepo.spec.ts +194 -0
  51. package/settings-service/src/__tests__/unit/repo/getAllSettings.spec.ts +100 -0
  52. package/settings-service/src/__tests__/unit/repo/getUserSettingsRepo.spec.ts +249 -0
  53. package/settings-service/src/__tests__/unit/repo/settingsRepo.spec.ts +614 -0
  54. package/settings-service/src/__tests__/unit/unified-profile/UnifiedProfileClient.spec.ts +31 -0
  55. package/settings-service/src/__tests__/unit/unified-profile/unifiedProfileUtils.spec.ts +36 -0
  56. package/settings-service/src/__tests__/utils/test-utils.ts +41 -0
  57. package/settings-service/src/config/config.ts +190 -0
  58. package/settings-service/src/controller/ApiKeyController.ts +114 -0
  59. package/settings-service/src/controller/AppSettingsController.ts +137 -0
  60. package/settings-service/src/controller/UserSettingsController.ts +202 -0
  61. package/settings-service/src/helpers/commons.ts +69 -0
  62. package/settings-service/src/logger/logger.ts +17 -0
  63. package/settings-service/src/middleware/AuthenticationMiddleware.ts +486 -0
  64. package/settings-service/src/middleware/AuthenticationMiddlewareFactory.ts +10 -0
  65. package/settings-service/src/repo/ApiKeyRepo.ts +135 -0
  66. package/settings-service/src/repo/ApiKeyRepoFactory.ts +10 -0
  67. package/settings-service/src/repo/CassandraClient.ts +33 -0
  68. package/settings-service/src/repo/CassandraClientFactory.ts +11 -0
  69. package/settings-service/src/repo/apiKeyQueries.ts +64 -0
  70. package/settings-service/src/repo/cassandraDBHelpers.ts +119 -0
  71. package/settings-service/src/repo/settingsRepo.ts +388 -0
  72. package/settings-service/src/repo/settingsRepoFactory.ts +10 -0
  73. package/settings-service/src/repo/settingsRepoQueries.ts +62 -0
  74. package/settings-service/src/routes/apiKeyRoutes.ts +27 -0
  75. package/settings-service/src/routes/appSettingsRoutes.ts +30 -0
  76. package/settings-service/src/routes/healthCheck.ts +10 -0
  77. package/settings-service/src/routes/swagger.ts +8 -0
  78. package/settings-service/src/routes/userSettingsRoutes.ts +30 -0
  79. package/settings-service/src/server.ts +77 -0
  80. package/settings-service/src/swagger.json +732 -0
  81. package/settings-service/src/types/ApiKey.ts +19 -0
  82. package/settings-service/src/types/IRequest.ts +9 -0
  83. package/settings-service/src/types/IRequestAuthorization.ts +5 -0
  84. package/settings-service/src/types/IRouteOptions.ts +5 -0
  85. package/settings-service/src/types/QueryResultsTypes.ts +6 -0
  86. package/settings-service/src/types/UserSettingsControllerTypes.ts +5 -0
  87. package/settings-service/src/types/W3IdUser.ts +36 -0
  88. package/settings-service/src/types/settingsRepoTypes.ts +61 -0
  89. package/settings-service/src/types/unifiedProfileTypes.ts +10 -0
  90. package/settings-service/src/unified-profile/UnifiedProfileClient.ts +29 -0
  91. package/settings-service/src/unified-profile/UnifiedProfileClientFactory.ts +10 -0
  92. package/settings-service/src/unified-profile/unifiedProfileUtils.ts +22 -0
  93. package/settings-service/src/util/downloadCassandra.ts +34 -0
  94. package/settings-service/src/util/isocodeMapper.ts +22 -0
  95. package/settings-service/src/util/languages.ts +1457 -0
  96. package/settings-service/test_resources/mockApiKeyDBResult.json +8 -0
  97. package/settings-service/tsconfig.json +40 -0
  98. package/README.md +0 -5
@@ -0,0 +1,732 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "settings-service",
5
+ "description": "Settings Service is responsible for capturing IBM employee's personal preference settings within w3 portfolio",
6
+ "version": "1.0.0"
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "/v1",
11
+ "description": "Default"
12
+ }
13
+ ],
14
+ "tags": [
15
+ {
16
+ "name": "User",
17
+ "description": "A user's preference settings"
18
+ },
19
+ {
20
+ "name": "App",
21
+ "description": "An app's preference settings"
22
+ },
23
+ {
24
+ "name": "Api Key",
25
+ "description": "Api key management"
26
+ }
27
+ ],
28
+ "paths": {
29
+ "/settings/apiKey/app/{appID}": {
30
+ "get": {
31
+ "description": "Endpoint to get existing api key for specified app. Must encode returned value with appID.",
32
+ "tags": [
33
+ "Api Key"
34
+ ],
35
+ "security": [
36
+ {
37
+ "bearerAuth": []
38
+ }
39
+ ],
40
+ "parameters": [
41
+ {
42
+ "in": "path",
43
+ "name": "appID",
44
+ "schema": {
45
+ "type": "string"
46
+ },
47
+ "required": true,
48
+ "description": "w3 project application id"
49
+ }
50
+ ],
51
+ "responses": {
52
+ "200": {
53
+ "content": {
54
+ "application/json": {
55
+ "schema": {
56
+ "$ref": "#/components/schemas/apiKey-getResponse"
57
+ }
58
+ }
59
+ },
60
+ "description": "Successfully fetched the api key for the application"
61
+ },
62
+ "401": {
63
+ "description": "Missing required authentication header"
64
+ },
65
+ "403": {
66
+ "description": "You are not authorized for apiKey operations."
67
+ },
68
+ "400": {
69
+ "description": "Invalid appID"
70
+ }
71
+ }
72
+ },
73
+ "post": {
74
+ "description": "Endpoint to create api key for appId. Current key returned if already exists. Must encode returned value with appID.",
75
+ "tags": [
76
+ "Api Key"
77
+ ],
78
+ "security": [
79
+ {
80
+ "bearerAuth": []
81
+ }
82
+ ],
83
+ "parameters": [
84
+ {
85
+ "in": "path",
86
+ "name": "appID",
87
+ "schema": {
88
+ "type": "string"
89
+ },
90
+ "required": true,
91
+ "description": "w3 project application id"
92
+ }
93
+ ],
94
+ "responses": {
95
+ "200": {
96
+ "description": "create api key successfully",
97
+ "content": {
98
+ "text/plain": {
99
+ "schema": {
100
+ "$ref": "#/components/schemas/apiKey-postAndPutResponse"
101
+ }
102
+ }
103
+ }
104
+ },
105
+ "401": {
106
+ "description": "Missing required authentication header"
107
+ },
108
+ "403": {
109
+ "description" : "You are not authorized for apiKey operations."
110
+ },
111
+ "400": {
112
+ "description": "Invalid appID"
113
+ }
114
+ }
115
+ },
116
+ "put": {
117
+ "description": "Endpoint to recreate existing api key for appId. Must encode returned value with appID.",
118
+ "tags": [
119
+ "Api Key"
120
+ ],
121
+ "security": [
122
+ {
123
+ "bearerAuth": []
124
+ }
125
+ ],
126
+ "parameters": [
127
+ {
128
+ "in": "path",
129
+ "name": "appID",
130
+ "schema": {
131
+ "type": "string"
132
+ },
133
+ "required": true,
134
+ "description": "w3 project application id"
135
+ }
136
+ ],
137
+ "responses": {
138
+ "200": {
139
+ "description": "update api key successfully",
140
+ "content": {
141
+ "text/plain": {
142
+ "schema": {
143
+ "$ref": "#/components/schemas/apiKey-postAndPutResponse"
144
+ }
145
+ }
146
+ }
147
+ },
148
+ "401": {
149
+ "description": "Missing required authentication header"
150
+ },
151
+ "403": {
152
+ "description" : "You are not authorized for apiKey operations."
153
+ },
154
+ "400": {
155
+ "description": "Invalid appID"
156
+ }
157
+ }
158
+ }
159
+ },
160
+ "/settings/users/{userId}/apps/{appId}": {
161
+ "get": {
162
+ "description": "Endpoint to get a user's settings preferences",
163
+ "tags": [
164
+ "User"
165
+ ],
166
+ "security": [
167
+ {
168
+ "bearerAuth": []
169
+ },
170
+ {
171
+ "ApiKeyAuth": []
172
+ }
173
+ ],
174
+ "parameters": [
175
+ {
176
+ "in": "path",
177
+ "name": "userId",
178
+ "schema": {
179
+ "type": "string"
180
+ },
181
+ "required": true,
182
+ "description": "IBM employee's serial number (CNUM)"
183
+ },
184
+ {
185
+ "in": "path",
186
+ "name": "appId",
187
+ "schema": {
188
+ "type": "string"
189
+ },
190
+ "required": true,
191
+ "description": "w3 project application id"
192
+ }
193
+ ],
194
+ "responses": {
195
+ "200": {
196
+ "content": {
197
+ "application/json": {
198
+ "schema": {
199
+ "type": "object",
200
+ "example": {
201
+ "general": {
202
+ "theme": "dark",
203
+ "primaryLanguage": "en"
204
+ }
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "description": "Successfully fetched this this user's settings preference on this given appId"
210
+ }
211
+ }
212
+ },
213
+ "post": {
214
+ "description": "Endpoint to initialize/update user's preferences",
215
+ "tags": [
216
+ "User"
217
+ ],
218
+ "security": [
219
+ {
220
+ "bearerAuth": []
221
+ }
222
+ ],
223
+ "parameters": [
224
+ {
225
+ "in": "path",
226
+ "name": "userId",
227
+ "schema": {
228
+ "type": "string"
229
+ },
230
+ "required": true,
231
+ "description": "IBM employee's serial number (CNUM)"
232
+ },
233
+ {
234
+ "in": "path",
235
+ "name": "appId",
236
+ "schema": {
237
+ "type": "string"
238
+ },
239
+ "required": true,
240
+ "description": "w3 project application id"
241
+ }
242
+ ],
243
+ "requestBody": {
244
+ "required": true,
245
+ "content": {
246
+ "application/json": {
247
+ "schema": {
248
+ "type": "object",
249
+ "example": {
250
+ "theme": "dark",
251
+ "primaryLanguage": "en"
252
+ }
253
+ }
254
+ }
255
+ }
256
+ },
257
+ "responses": {
258
+ "200": {
259
+ "description": "update successfully",
260
+ "content": {
261
+ "text/plain": {
262
+ "schema": {
263
+ "type": "object",
264
+ "example": {
265
+ "theme": "dark",
266
+ "primaryLanguage": "en"
267
+ }
268
+ }
269
+ }
270
+ }
271
+ },
272
+ "401": {
273
+ "description": "You do not have valid bearer token to submit request"
274
+ }
275
+ }
276
+ }
277
+ },
278
+ "/settings/users/{userId}": {
279
+ "delete": {
280
+ "description": "Endpoint to delete all settings for a specific user. This endpoint is locked down to apps on the RESTRICTED_APP_ID_WHITELIST only",
281
+ "tags": [
282
+ "User"
283
+ ],
284
+ "security": [
285
+ {
286
+ "ApiKeyAuth": []
287
+ }
288
+ ],
289
+ "parameters": [
290
+ {
291
+ "in": "path",
292
+ "name": "userId",
293
+ "schema": {
294
+ "type": "string"
295
+ },
296
+ "required": true,
297
+ "description": "user CNUM"
298
+ }
299
+ ],
300
+ "responses": {
301
+ "200": {
302
+ "content": {
303
+ "application/json": {
304
+ "schema": {
305
+ "type": "string",
306
+ "example": "success"
307
+ }
308
+ }
309
+ },
310
+ "description": "Successfully deleted settings for this user"
311
+ },
312
+ "401": {
313
+ "description": "API key based authentication strategy must be used for delete settings operation. (apps on the RESTRICTED_APP_ID_WHITELIST only)"
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "/settings/users/all": {
319
+ "get": {
320
+ "description": "Endpoint to fetch all user information in the database. This endpoint is locked down to apps on the RESTRICTED_APP_ID_WHITELIST only. ",
321
+ "tags": [
322
+ "User"
323
+ ],
324
+ "security": [
325
+ {
326
+ "ApiKeyAuth": []
327
+ }
328
+ ],
329
+ "parameters": [
330
+ {
331
+ "in": "query",
332
+ "name": "fetchSize",
333
+ "schema": {
334
+ "type": "string"
335
+ },
336
+ "required": false,
337
+ "description": "number of records to fetch per request limited to <1000"
338
+ },
339
+ {
340
+ "in": "query",
341
+ "name": "pageState",
342
+ "schema": {
343
+ "type": "string"
344
+ },
345
+ "required": false,
346
+ "description": "pageState value from the last request to fetch the next page"
347
+ },
348
+ {
349
+ "in": "query",
350
+ "name": "appId",
351
+ "schema": {
352
+ "type": "string"
353
+ },
354
+ "required": false,
355
+ "description": "limit returned records to specific appId"
356
+ },
357
+ {
358
+ "in": "query",
359
+ "name": "settingName",
360
+ "schema": {
361
+ "type": "string"
362
+ },
363
+ "required": false,
364
+ "description": "limit returned records to specific settingName, appId must also be provided to use this option"
365
+ }
366
+ ],
367
+ "responses": {
368
+ "200": {
369
+ "content": {
370
+ "application/json": {
371
+ "schema": {
372
+ "type": "object",
373
+ "example": {
374
+ "settings": {
375
+ "user_id": "TESTCNUM",
376
+ "app_id": "TESTAPP",
377
+ "setting_name": "TEST SETTING NAME",
378
+ "setting_value": "TEST SETTING VALUE"
379
+ },
380
+ "pageState": "pageState string"
381
+ }
382
+ }
383
+ }
384
+ },
385
+ "description": "Retrieve all user settings"
386
+ },
387
+ "401": {
388
+ "description": "API key based authentication strategy must be used for delete settings operation. (apps on RESTRICTED_APP_ID_WHITELIST only)"
389
+ }
390
+ }
391
+ }
392
+ },
393
+ "/settings/app/{appId}": {
394
+ "get": {
395
+ "description": "Endpoint to get all app's settings preferences",
396
+ "tags": [
397
+ "App"
398
+ ],
399
+ "security": [
400
+ {
401
+ "ApiKeyAuth": []
402
+ }
403
+ ],
404
+ "parameters": [
405
+ {
406
+ "in": "path",
407
+ "name": "appId",
408
+ "schema": {
409
+ "type": "string"
410
+ },
411
+ "required": true,
412
+ "description": "w3 project application id"
413
+ }
414
+ ],
415
+ "responses": {
416
+ "200": {
417
+ "content": {
418
+ "application/json": {
419
+ "schema": {
420
+ "type": "object",
421
+ "properties": {
422
+ "default": {
423
+ "type": "string"
424
+ },
425
+ "options": {
426
+ "type": "array",
427
+ "items": {
428
+ "type": "string"
429
+ }
430
+ },
431
+ "setting_type": {
432
+ "type": "string"
433
+ },
434
+ "deprecated_values": {
435
+ "type": "object",
436
+ "properties": {
437
+ "[key: string]": {
438
+ "type": "string"
439
+ }
440
+ }
441
+ }
442
+ },
443
+ "example": {
444
+ "theme": {
445
+ "default": "dark",
446
+ "options": [
447
+ "dark",
448
+ "light"
449
+ ],
450
+ "setting_type": "string",
451
+ "deprecated_values": {
452
+ "oldValue": "newValue"
453
+ }
454
+ }
455
+ }
456
+ }
457
+ }
458
+ },
459
+ "description": "Successfully fetched this this app's settings preference on this given appId"
460
+ },
461
+ "401": {
462
+ "description": "You do not have valid api token to submit request"
463
+ }
464
+ }
465
+ }
466
+ },
467
+ "/settings/app/{appId}/setting/{settingName}": {
468
+ "get": {
469
+ "description": "Endpoint to get an app's settings preference for this setting",
470
+ "tags": [
471
+ "App"
472
+ ],
473
+ "security": [
474
+ {
475
+ "ApiKeyAuth": []
476
+ }
477
+ ],
478
+ "parameters": [
479
+ {
480
+ "in": "path",
481
+ "name": "appId",
482
+ "schema": {
483
+ "type": "string"
484
+ },
485
+ "required": true,
486
+ "description": "w3 project application id"
487
+ },
488
+ {
489
+ "in": "path",
490
+ "name": "settingName",
491
+ "schema": {
492
+ "type": "string"
493
+ },
494
+ "required": true,
495
+ "description": "setting name"
496
+ }
497
+ ],
498
+ "responses": {
499
+ "200": {
500
+ "content": {
501
+ "application/json": {
502
+ "schema": {
503
+ "type": "object",
504
+ "properties": {
505
+ "default": {
506
+ "type": "string"
507
+ },
508
+ "options": {
509
+ "type": "array",
510
+ "items": {
511
+ "type": "string"
512
+ }
513
+ },
514
+ "setting_type" : {
515
+ "type": "string"
516
+ },
517
+ "deprecated_values": {
518
+ "type": "object",
519
+ "properties": {
520
+ "[key: string]": {
521
+ "type": "string"
522
+ }
523
+ }
524
+ }
525
+ },
526
+ "example": {
527
+ "default": "dark",
528
+ "options": [
529
+ "dark",
530
+ "light"
531
+ ],
532
+ "setting_type": null,
533
+ "deprecated_values": {
534
+ "oldValue": "newValue"
535
+ }
536
+ }
537
+ }
538
+ }
539
+ },
540
+ "description": "Successfully fetched this this app's settings preference on this given appId"
541
+ },
542
+ "401": {
543
+ "description": "You do not have valid api token to submit request"
544
+ }
545
+ }
546
+ },
547
+ "post": {
548
+ "description": "Endpoint to initialize/update app's preferences. We recommend you use the get request to get the current values and then modify the settings object from that response to build your request. Any changed values will overwrite the old values, any values not passed will overwrite the old values as null.",
549
+ "tags": [
550
+ "App"
551
+ ],
552
+ "security": [
553
+ {
554
+ "ApiKeyAuth": []
555
+ }
556
+ ],
557
+ "parameters": [
558
+ {
559
+ "in": "path",
560
+ "name": "appId",
561
+ "schema": {
562
+ "type": "string"
563
+ },
564
+ "required": true,
565
+ "description": "w3 project application id"
566
+ },
567
+ {
568
+ "in": "path",
569
+ "name": "settingName",
570
+ "schema": {
571
+ "type": "string"
572
+ },
573
+ "required": true,
574
+ "description": "setting name"
575
+ }
576
+ ],
577
+ "requestBody": {
578
+ "required": true,
579
+ "content": {
580
+ "application/json": {
581
+ "schema": {
582
+ "type": "object",
583
+ "properties": {
584
+ "default": {
585
+ "type": "string"
586
+ },
587
+ "options": {
588
+ "type": "array",
589
+ "items": {
590
+ "type": "string"
591
+ }
592
+ },
593
+ "setting_type": {
594
+ "type": "string",
595
+ },
596
+ "deprecated_values": {
597
+ "type": "object",
598
+ "properties": {
599
+ "[key: string]": {
600
+ "type": "string"
601
+ }
602
+ }
603
+ }
604
+ },
605
+ "example": {
606
+ "default": "dark",
607
+ "options": [
608
+ "dark",
609
+ "light"
610
+ ],
611
+ "setting_type" : null,
612
+ "deprecated_values": {
613
+ "oldValue": "newValue"
614
+ }
615
+ }
616
+
617
+ }
618
+ }
619
+ }
620
+ },
621
+ "responses": {
622
+ "200": {
623
+ "description": "update successfully",
624
+ "content": {
625
+ "text/plain": {
626
+ "schema": {
627
+ "type": "string",
628
+ "example": "Success"
629
+ }
630
+ }
631
+ }
632
+ },
633
+ "401": {
634
+ "description": "You do not have valid api token to submit request"
635
+ }
636
+ }
637
+ },
638
+ "delete": {
639
+ "description": "Endpoint to delete an app's settings preference for this setting",
640
+ "tags": [
641
+ "App"
642
+ ],
643
+ "security": [
644
+ {
645
+ "ApiKeyAuth": []
646
+ }
647
+ ],
648
+ "parameters": [
649
+ {
650
+ "in": "path",
651
+ "name": "appId",
652
+ "schema": {
653
+ "type": "string"
654
+ },
655
+ "required": true,
656
+ "description": "w3 project application id"
657
+ },
658
+ {
659
+ "in": "path",
660
+ "name": "settingName",
661
+ "schema": {
662
+ "type": "string"
663
+ },
664
+ "required": true,
665
+ "description": "setting name"
666
+ }
667
+ ],
668
+ "responses": {
669
+ "200": {
670
+ "description": "update successfully",
671
+ "content": {
672
+ "text/plain": {
673
+ "schema": {
674
+ "type": "string",
675
+ "example": "Success"
676
+ }
677
+ }
678
+ }
679
+ },
680
+ "401": {
681
+ "description": "You do not have valid api token to submit request"
682
+ }
683
+ }
684
+ }
685
+ }
686
+ },
687
+ "components": {
688
+ "schemas": {
689
+ "apiKey-getResponse": {
690
+ "type": "object",
691
+ "properties": {
692
+ "appId": {
693
+ "type": "string"
694
+ },
695
+ "key": {
696
+ "type": "string"
697
+ }
698
+ },
699
+ "example": {
700
+ "appId": "test",
701
+ "key": "O7ZevqTkDZKFRA6z1Cry8UUKJ1Uzsca9oyRYvQl2WmYZrGOL"
702
+ }
703
+ },
704
+ "apiKey-postAndPutResponse": {
705
+ "type": "object",
706
+ "properties": {
707
+ "appId": {
708
+ "type": "string"
709
+ },
710
+ "key": {
711
+ "type": "string"
712
+ }
713
+ },
714
+ "example": {
715
+ "key": "O7ZevqTkDZKFRA6z1Cry8UUKJ1Uzsca9oyRYvQl2WmYZrGOL"
716
+ }
717
+ }
718
+ },
719
+ "securitySchemes": {
720
+ "bearerAuth": {
721
+ "type": "http",
722
+ "scheme": "bearer",
723
+ "bearerFormat": "JWT"
724
+ },
725
+ "ApiKeyAuth": {
726
+ "type": "apiKey",
727
+ "in": "header",
728
+ "name": "authorization"
729
+ }
730
+ }
731
+ }
732
+ }