k2hr3-api 1.0.10 → 1.0.12

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 (121) hide show
  1. package/ChangeLog +24 -0
  2. package/app.js +7 -4
  3. package/bin/run.sh +218 -172
  4. package/bin/watcher +7 -4
  5. package/bin/www +7 -4
  6. package/config/default.json +7 -4
  7. package/config/development.json +7 -4
  8. package/config/dummyuser.json +8 -5
  9. package/config/extdata-dummy.sh.templ +12 -9
  10. package/config/k2hr3-cloud-config.txt.templ +7 -4
  11. package/config/k2hr3-init-error.sh.templ +8 -5
  12. package/config/k2hr3-init.sh.templ +127 -207
  13. package/config/keystone_v2.json +7 -4
  14. package/config/keystone_v3.json +7 -4
  15. package/lib/basicipcheck.js +7 -4
  16. package/lib/cacerts.js +7 -4
  17. package/lib/dbglogging.js +7 -4
  18. package/lib/dummyuserapi.js +7 -4
  19. package/lib/ipwatch.js +7 -4
  20. package/lib/k2hr3acrutil.js +7 -5
  21. package/lib/k2hr3apiutil.js +7 -4
  22. package/lib/k2hr3cliutil.js +7 -4
  23. package/lib/k2hr3config.js +7 -4
  24. package/lib/k2hr3cryptutil.js +7 -4
  25. package/lib/k2hr3dkc.js +7 -4
  26. package/lib/k2hr3extdata.js +7 -4
  27. package/lib/k2hr3keys.js +7 -4
  28. package/lib/k2hr3resutil.js +7 -4
  29. package/lib/k2hr3template.js +7 -4
  30. package/lib/k2hr3tokens.js +7 -4
  31. package/lib/k2hr3userdata.js +8 -5
  32. package/lib/k8soidc.js +41 -16
  33. package/lib/openstackapiv2.js +7 -4
  34. package/lib/openstackapiv3.js +7 -4
  35. package/lib/openstackep.js +7 -4
  36. package/package.json +73 -72
  37. package/routes/acr.js +7 -4
  38. package/routes/debugVerify.js +7 -4
  39. package/routes/extdata.js +7 -4
  40. package/routes/list.js +7 -4
  41. package/routes/policy.js +7 -4
  42. package/routes/resource.js +7 -4
  43. package/routes/role.js +7 -4
  44. package/routes/service.js +7 -4
  45. package/routes/userTokens.js +7 -4
  46. package/routes/userdata.js +7 -4
  47. package/routes/version.js +7 -4
  48. package/templ/Dockerfile.templ +35 -52
  49. package/{test → tests}/auto_acr.js +7 -4
  50. package/{test → tests}/auto_acr_spec.js +7 -4
  51. package/{test → tests}/auto_all_spec.js +7 -4
  52. package/{test → tests}/auto_common.js +7 -4
  53. package/tests/auto_control_subprocess.sh +239 -0
  54. package/{test → tests}/auto_extdata.js +7 -4
  55. package/{test → tests}/auto_extdata_spec.js +7 -4
  56. package/tests/auto_init_config_json.sh +275 -0
  57. package/{test → tests}/auto_k2hdkc_server.ini +7 -4
  58. package/{test → tests}/auto_k2hdkc_slave.ini +7 -4
  59. package/{test → tests}/auto_list.js +7 -4
  60. package/{test → tests}/auto_list_spec.js +7 -4
  61. package/{test → tests}/auto_policy.js +7 -4
  62. package/{test → tests}/auto_policy_spec.js +7 -4
  63. package/{test → tests}/auto_resource.js +7 -4
  64. package/{test → tests}/auto_resource_spec.js +7 -4
  65. package/{test → tests}/auto_role.js +7 -4
  66. package/{test → tests}/auto_role_spec.js +7 -4
  67. package/{test → tests}/auto_service.js +7 -4
  68. package/{test → tests}/auto_service_spec.js +7 -4
  69. package/{test → tests}/auto_subprocesses.js +14 -11
  70. package/tests/auto_template.sh +126 -0
  71. package/{test → tests}/auto_token_util.js +7 -4
  72. package/{test → tests}/auto_userdata.js +7 -4
  73. package/{test → tests}/auto_userdata_spec.js +7 -4
  74. package/{test → tests}/auto_usertokens.js +7 -4
  75. package/{test → tests}/auto_usertokens_spec.js +7 -4
  76. package/{test → tests}/auto_version.js +7 -4
  77. package/{test → tests}/auto_version_spec.js +7 -4
  78. package/{test → tests}/auto_watcher.js +7 -4
  79. package/{test → tests}/auto_watcher_spec.js +7 -4
  80. package/{test → tests}/k2hdkc_test.data +7 -4
  81. package/tests/k2hdkc_test_load.sh +255 -0
  82. package/{test → tests}/k2hr3template_test.js +7 -4
  83. package/tests/k2hr3template_test.sh +339 -0
  84. package/{test → tests}/k2hr3template_test_async.js +7 -4
  85. package/{test → tests}/k2hr3template_test_template.result +14 -8
  86. package/{test → tests}/k2hr3template_test_template.txt +7 -4
  87. package/{test → tests}/k2hr3template_test_vars.js +7 -4
  88. package/{test → tests}/manual_acr_delete.js +7 -4
  89. package/{test → tests}/manual_acr_get.js +7 -4
  90. package/{test → tests}/manual_acr_postput.js +7 -4
  91. package/{test → tests}/manual_allusertenant_get.js +7 -4
  92. package/{test → tests}/manual_extdata_get.js +7 -4
  93. package/{test → tests}/manual_k2hr3keys_get.js +7 -4
  94. package/{test → tests}/manual_list_gethead.js +7 -4
  95. package/{test → tests}/manual_policy_delete.js +7 -4
  96. package/{test → tests}/manual_policy_gethead.js +7 -4
  97. package/{test → tests}/manual_policy_postput.js +7 -4
  98. package/{test → tests}/manual_resource_delete.js +7 -4
  99. package/{test → tests}/manual_resource_gethead.js +7 -4
  100. package/{test → tests}/manual_resource_postput.js +7 -4
  101. package/{test → tests}/manual_role_delete.js +7 -4
  102. package/{test → tests}/manual_role_gethead.js +7 -4
  103. package/{test → tests}/manual_role_postput.js +7 -4
  104. package/{test → tests}/manual_service_delete.js +7 -4
  105. package/{test → tests}/manual_service_gethead.js +7 -4
  106. package/{test → tests}/manual_service_postput.js +7 -4
  107. package/tests/manual_test.sh +338 -0
  108. package/{test → tests}/manual_userdata_get.js +7 -4
  109. package/{test → tests}/manual_usertoken_gethead.js +7 -4
  110. package/{test → tests}/manual_usertoken_postput.js +7 -4
  111. package/{test → tests}/manual_version_get.js +7 -4
  112. package/tests/run_local_test_k2hdkc.sh +174 -0
  113. package/tests/test.sh +331 -0
  114. package/test/auto_control_subprocess.sh +0 -170
  115. package/test/auto_init_config_json.sh +0 -246
  116. package/test/auto_template.sh +0 -127
  117. package/test/auto_test.sh +0 -321
  118. package/test/k2hdkc_test_load.sh +0 -198
  119. package/test/k2hr3template_test.sh +0 -296
  120. package/test/manual_test.sh +0 -321
  121. package/test/run_local_test_k2hdkc.sh +0 -154
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "k2hr3-api",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "dependencies": {
5
- "@kubernetes/client-node": "^0.16.3",
6
- "body-parser": "^1.20.0",
7
- "config": "^3.3.7",
5
+ "@kubernetes/client-node": "^0.17.1",
6
+ "body-parser": "^1.20.1",
7
+ "config": "^3.3.8",
8
8
  "cookie-parser": "~1.4.6",
9
9
  "dateformat": "^4.6.3",
10
10
  "debug": "~4.3.4",
11
- "express": "^4.18.1",
12
- "jose": "^4.8.1",
13
- "k2hdkc": "^1.0.2",
11
+ "express": "^4.18.2",
12
+ "jose": "^4.11.0",
13
+ "k2hdkc": "^1.0.4",
14
14
  "morgan": "~1.10.0",
15
- "rotating-file-stream": "^2.1.6"
15
+ "rotating-file-stream": "^3.0.4"
16
16
  },
17
17
  "bin": {
18
18
  "k2hr3-api": "./bin/www",
@@ -28,12 +28,11 @@
28
28
  "test": "test"
29
29
  },
30
30
  "devDependencies": {
31
- "chai": "^4.3.6",
31
+ "chai": "^4.3.7",
32
32
  "chai-http": "^4.3.0",
33
- "eslint": "^8.17.0",
34
- "mocha": "^10.0.0",
35
- "nyc": "^15.1.0",
36
- "publish-please": "^5.5.2"
33
+ "eslint": "^8.27.0",
34
+ "mocha": "^10.1.0",
35
+ "nyc": "^15.1.0"
37
36
  },
38
37
  "scripts": {
39
38
  "help": "echo 'command list:\n npm run start\n npm run start:prod\n npm run start:production\n npm run start:dev\n npm run start:develop\n npm run start:dbg\n npm run start:debug\n npm run start:debug:break\n npm run start:debug:nobreak\n npm run start:watcher:prod\n npm run start:watcher:production\n npm run start:watcher:dev\n npm run start:watcher:develop\n npm run start:watcher:dbg\n npm run start:watcher:debug\n npm run start:watcher:debug:break\n npm run start:watcher:debug:nobreak\n npm run start:watcher:oneshot:prod\n npm run start:watcher:oneshot:production\n npm run start:watcher:oneshot:dev\n npm run start:watcher:oneshot:develop\n npm run start:watcher:oneshot:dbg\n npm run start:watcher:oneshot:debug\n npm run start:watcher:oneshot:debug:break\n npm run start:watcher:oneshot:debug:nobreak\n npm run stop\n npm run stop:watcher\n npm run test\n npm run test:lint\n npm run test:cover\n npm run test:auto:all{:dbg}\n npm run test:auto:version{:dbg}\n npm run test:auto:usertokens{:dbg}\n npm run test:auto:list{:dbg}\n npm run test:auto:resource{:dbg}\n npm run test:auto:policy{:dbg}\n npm run test:auto:role{:dbg}\n npm run test:auto:service{:dbg}\n npm run test:auto:acr{:dbg}\n npm run test:auto:userdata{:dbg}\n npm run test:auto:extdata{:dbg}\n npm run test:auto:watcher{:dbg}\n npm run test:auto:templengine\n npm run test:auto:templengine:async\n npm run test:manual:apis:version_get\n npm run test:manual:apis:usertoken_postput\n npm run test:manual:apis:usertoken_gethead\n npm run test:manual:apis:policy_postput\n npm run test:manual:apis:policy_gethead\n npm run test:manual:apis:policy_delete\n npm run test:manual:apis:resource_postput\n npm run test:manual:apis:resource_gethead\n npm run test:manual:apis:resource_delete\n npm run test:manual:apis:role_postput\n npm run test:manual:apis:role_gethead\n npm run test:manual:apis:role_delete\n npm run test:manual:apis:service_postput\n npm run test:manual:apis:service_gethead\n npm run test:manual:apis:service_delete\n npm run test:manual:apis:acr_postput\n npm run test:manual:apis:acr_get\n npm run test:manual:apis:acr_delete\n npm run test:manual:apis:list_gethead\n npm run test:manual:apis:userdata_get\n npm run test:manual:apis:extdata_get\n npm run test:manual:apis:allusertenant_get\n npm run test:manual:apis:k2hr3keys_get\n npm run test:manual:load:k2hdkcdata:auto\n npm run test:manual:load:k2hdkcdata:local\n npm run test:manual:templengine\n npm run test:manual:templengine:async\n'",
@@ -65,72 +64,74 @@
65
64
  "stop": "bin/run.sh -stop && echo '' && echo 'Stop - Success' && echo ''",
66
65
  "stop:watcher": "bin/run.sh -stop --watcher && echo '' && echo 'Stop watcher - Success' && echo ''",
67
66
  "test": "npm run test:cover",
68
- "test:lint": "eslint lib/*.js app.js bin/www bin/watcher routes/*.js test/*.js",
67
+ "test:lint": "eslint lib/*.js app.js bin/www bin/watcher routes/*.js tests/*.js",
69
68
  "test:cover": "echo 'Test with coverage' && nyc --reporter=lcov --reporter=text npm run test:auto:all",
70
69
  "test:auto": "echo 'Auto test : npm run test:auto:*\n test:auto:all{:dbg}\n test:auto:version{:dbg}\n test:auto:usertokens{:dbg}\n test:auto:list{:dbg}\n test:auto:resource{:dbg}\n test:auto:policy{:dbg}\n test:auto:role{:dbg}\n test:auto:service{:dbg}\n test:auto:acr{:dbg}\n test:auto:userdata{:dbg}\n test:auto:extdata{:dbg}\n test:auto:watcher{:dbg}\n test:auto:templengine\n test:auto:templengine:async\n'",
71
- "test:auto:all": "echo 'All test' && npm run test:lint && test/auto_test.sh -t 8000 all && npm run test:auto:templengine && npm run test:auto:templengine:async && echo 'Succeed test' && echo ''",
72
- "test:auto:all:dbg": "echo 'All test with debugging' && npm run test:lint && test/auto_test.sh -t 8000 -d dbg all && echo 'Succeed test' && echo ''",
73
- "test:auto:version": "echo 'Test Version' && test/auto_test.sh -t 8000 version && echo 'Succeed test' && echo ''",
74
- "test:auto:version:dbg": "echo 'Test Version with debugging' && test/auto_test.sh -t 8000 -d dbg version && echo 'Succeed test' && echo ''",
75
- "test:auto:usertokens": "echo 'Test UserTokens' && test/auto_test.sh -t 8000 usertokens && echo 'Succeed test' && echo ''",
76
- "test:auto:usertokens:dbg": "echo 'Test UserTokens with debugging' && test/auto_test.sh -t 8000 -d dbg usertokens && echo 'Succeed test' && echo ''",
77
- "test:auto:list": "echo 'Test List' && test/auto_test.sh -t 8000 list && echo 'Succeed test' && echo ''",
78
- "test:auto:list:dbg": "echo 'Test List with debugging' && test/auto_test.sh -t 8000 -d dbg list && echo 'Succeed test' && echo ''",
79
- "test:auto:resource": "echo 'Test Resource' && test/auto_test.sh -t 8000 resource && echo 'Succeed test' && echo ''",
80
- "test:auto:resource:dbg": "echo 'Test Resource with debugging' && test/auto_test.sh -t 8000 -d dbg resource && echo 'Succeed test' && echo ''",
81
- "test:auto:policy": "echo 'Test Policy' && test/auto_test.sh -t 8000 policy && echo 'Succeed test' && echo ''",
82
- "test:auto:policy:dbg": "echo 'Test Policy with debugging' && test/auto_test.sh -t 8000 -d dbg policy && echo 'Succeed test' && echo ''",
83
- "test:auto:role": "echo 'Test Role' && test/auto_test.sh -t 8000 role && echo 'Succeed test' && echo ''",
84
- "test:auto:role:dbg": "echo 'Test Role with debugging' && test/auto_test.sh -t 8000 -d dbg role && echo 'Succeed test' && echo ''",
85
- "test:auto:service": "echo 'Test Service' && test/auto_test.sh -t 8000 service && echo 'Succeed test' && echo ''",
86
- "test:auto:service:dbg": "echo 'Test Service with debugging' && test/auto_test.sh -t 8000 -d dbg service && echo 'Succeed test' && echo ''",
87
- "test:auto:acr": "echo 'Test ACR' && test/auto_test.sh -t 8000 acr && echo 'Succeed test' && echo ''",
88
- "test:auto:acr:dbg": "echo 'Test ACR with debugging' && test/auto_test.sh -t 8000 -d dbg acr && echo 'Succeed test' && echo ''",
89
- "test:auto:userdata": "echo 'Test Userdata' && test/auto_test.sh -t 8000 userdata && echo 'Succeed test' && echo ''",
90
- "test:auto:userdata:dbg": "echo 'Test Userdata with debugging' && test/auto_test.sh -t 8000 -d dbg userdata && echo 'Succeed test' && echo ''",
91
- "test:auto:extdata": "echo 'Test Extdata' && test/auto_test.sh -t 8000 extdata && echo 'Succeed test' && echo ''",
92
- "test:auto:extdata:dbg": "echo 'Test Extdata with debugging' && test/auto_test.sh -t 8000 -d dbg extdata && echo 'Succeed test' && echo ''",
93
- "test:auto:watcher": "echo 'Test Watcher Process' && test/auto_test.sh -t 8000 watcher && echo 'Succeed test' && echo ''",
94
- "test:auto:watcher:dbg": "echo 'Test Watcher Process with debugging' && test/auto_test.sh -t 8000 -d dbg watcher && echo 'Succeed test' && echo ''",
95
- "test:auto:templengine": "echo 'Test template engine' && test/auto_template.sh && echo 'Succeed test' && echo ''",
96
- "test:auto:templengine:async": "echo 'Test asynchronous template engine' && test/auto_template.sh -a && echo 'Succeed test' && echo ''",
70
+ "test:auto:all": "echo 'All test' && npm run test:lint && tests/test.sh -t 8000 all && npm run test:auto:templengine && npm run test:auto:templengine:async && echo 'Succeed test' && echo ''",
71
+ "test:auto:all:dbg": "echo 'All test with debugging' && npm run test:lint && tests/test.sh -t 8000 -d dbg all && echo 'Succeed test' && echo ''",
72
+ "test:auto:version": "echo 'Test Version' && tests/test.sh -t 8000 version && echo 'Succeed test' && echo ''",
73
+ "test:auto:version:dbg": "echo 'Test Version with debugging' && tests/test.sh -t 8000 -d dbg version && echo 'Succeed test' && echo ''",
74
+ "test:auto:usertokens": "echo 'Test UserTokens' && tests/test.sh -t 8000 usertokens && echo 'Succeed test' && echo ''",
75
+ "test:auto:usertokens:dbg": "echo 'Test UserTokens with debugging' && tests/test.sh -t 8000 -d dbg usertokens && echo 'Succeed test' && echo ''",
76
+ "test:auto:list": "echo 'Test List' && tests/test.sh -t 8000 list && echo 'Succeed test' && echo ''",
77
+ "test:auto:list:dbg": "echo 'Test List with debugging' && tests/test.sh -t 8000 -d dbg list && echo 'Succeed test' && echo ''",
78
+ "test:auto:resource": "echo 'Test Resource' && tests/test.sh -t 8000 resource && echo 'Succeed test' && echo ''",
79
+ "test:auto:resource:dbg": "echo 'Test Resource with debugging' && tests/test.sh -t 8000 -d dbg resource && echo 'Succeed test' && echo ''",
80
+ "test:auto:policy": "echo 'Test Policy' && tests/test.sh -t 8000 policy && echo 'Succeed test' && echo ''",
81
+ "test:auto:policy:dbg": "echo 'Test Policy with debugging' && tests/test.sh -t 8000 -d dbg policy && echo 'Succeed test' && echo ''",
82
+ "test:auto:role": "echo 'Test Role' && tests/test.sh -t 8000 role && echo 'Succeed test' && echo ''",
83
+ "test:auto:role:dbg": "echo 'Test Role with debugging' && tests/test.sh -t 8000 -d dbg role && echo 'Succeed test' && echo ''",
84
+ "test:auto:service": "echo 'Test Service' && tests/test.sh -t 8000 service && echo 'Succeed test' && echo ''",
85
+ "test:auto:service:dbg": "echo 'Test Service with debugging' && tests/test.sh -t 8000 -d dbg service && echo 'Succeed test' && echo ''",
86
+ "test:auto:acr": "echo 'Test ACR' && tests/test.sh -t 8000 acr && echo 'Succeed test' && echo ''",
87
+ "test:auto:acr:dbg": "echo 'Test ACR with debugging' && tests/test.sh -t 8000 -d dbg acr && echo 'Succeed test' && echo ''",
88
+ "test:auto:userdata": "echo 'Test Userdata' && tests/test.sh -t 8000 userdata && echo 'Succeed test' && echo ''",
89
+ "test:auto:userdata:dbg": "echo 'Test Userdata with debugging' && tests/test.sh -t 8000 -d dbg userdata && echo 'Succeed test' && echo ''",
90
+ "test:auto:extdata": "echo 'Test Extdata' && tests/test.sh -t 8000 extdata && echo 'Succeed test' && echo ''",
91
+ "test:auto:extdata:dbg": "echo 'Test Extdata with debugging' && tests/test.sh -t 8000 -d dbg extdata && echo 'Succeed test' && echo ''",
92
+ "test:auto:watcher": "echo 'Test Watcher Process' && tests/test.sh -t 8000 watcher && echo 'Succeed test' && echo ''",
93
+ "test:auto:watcher:dbg": "echo 'Test Watcher Process with debugging' && tests/test.sh -t 8000 -d dbg watcher && echo 'Succeed test' && echo ''",
94
+ "test:auto:templengine": "echo 'Test template engine' && tests/auto_template.sh && echo 'Succeed test' && echo ''",
95
+ "test:auto:templengine:async": "echo 'Test asynchronous template engine' && tests/auto_template.sh -a && echo 'Succeed test' && echo ''",
97
96
  "test:manual": "echo 'Manual test : npm run test:manual:*\n test:manual:apis:version_get\n test:manual:apis:usertoken_postput\n test:manual:apis:usertoken_gethead\n test:manual:apis:policy_postput\n test:manual:apis:policy_gethead\n test:manual:apis:policy_delete\n test:manual:apis:resource_postput\n test:manual:apis:resource_gethead\n test:manual:apis:resource_delete\n test:manual:apis:role_postput\n test:manual:apis:role_gethead\n test:manual:apis:role_delete\n test:manual:apis:service_postput\n test:manual:apis:service_gethead\n test:manual:apis:service_delete\n test:manual:apis:acr_postput\n test:manual:apis:acr_get\n test:manual:apis:acr_delete\n test:manual:apis:list_gethead\n test:manual:apis:userdata_get\n test:manual:apis:extdata_get\n test:manual:apis:allusertenant_get\n test:manual:apis:k2hr3keys_get\n test:manual:load:k2hdkcdata:auto\n test:manual:load:k2hdkcdata:local\n test:manual:templengine\n test:manual:templengine:async\n'",
98
- "test:manual:apis:version_get": "test/manual_test.sh version_get",
99
- "test:manual:apis:usertoken_postput": "test/manual_test.sh usertoken_postput",
100
- "test:manual:apis:usertoken_gethead": "test/manual_test.sh usertoken_gethead",
101
- "test:manual:apis:policy_postput": "test/manual_test.sh policy_postput",
102
- "test:manual:apis:policy_gethead": "test/manual_test.sh policy_gethead",
103
- "test:manual:apis:policy_delete": "test/manual_test.sh policy_delete",
104
- "test:manual:apis:resource_postput": "test/manual_test.sh resource_postput",
105
- "test:manual:apis:resource_gethead": "test/manual_test.sh resource_gethead",
106
- "test:manual:apis:resource_delete": "test/manual_test.sh resource_delete",
107
- "test:manual:apis:role_postput": "test/manual_test.sh role_postput",
108
- "test:manual:apis:role_gethead": "test/manual_test.sh role_gethead",
109
- "test:manual:apis:role_delete": "test/manual_test.sh role_delete",
110
- "test:manual:apis:service_postput": "test/manual_test.sh service_postput",
111
- "test:manual:apis:service_gethead": "test/manual_test.sh service_gethead",
112
- "test:manual:apis:service_delete": "test/manual_test.sh service_delete",
113
- "test:manual:apis:acr_postput": "test/manual_test.sh acr_postput",
114
- "test:manual:apis:acr_get": "test/manual_test.sh acr_get",
115
- "test:manual:apis:acr_delete": "test/manual_test.sh acr_delete",
116
- "test:manual:apis:list_gethead": "test/manual_test.sh list_gethead",
117
- "test:manual:apis:userdata_get": "test/manual_test.sh userdata_get",
118
- "test:manual:apis:extdata_get": "test/manual_test.sh extdata_get",
119
- "test:manual:apis:allusertenant_get": "test/manual_test.sh allusertenant_get",
120
- "test:manual:apis:k2hr3keys_get": "test/manual_test.sh k2hr3keys_get",
121
- "test:manual:load:k2hdkcdata:auto": "test/k2hdkc_test_load.sh --for_auto_test && echo '' && echo 'Load test data for automatically testing - Success' && echo ''",
122
- "test:manual:load:k2hdkcdata:local": "test/k2hdkc_test_load.sh --main 33348 --sub 37146 && echo '' && echo 'Load test data for local testing - Success' && echo ''",
123
- "test:manual:templengine": "test/auto_template.sh && echo '' && echo 'Test template engine - Success' && echo ''",
124
- "test:manual:templengine:async": "test/auto_template.sh -a && echo '' && echo 'Test asynchronous template engine - Success' && echo ''",
125
- "publish-please": "publish-please",
126
- "prepublishOnly": "publish-please guard"
97
+ "test:manual:apis:version_get": "tests/manual_test.sh version_get",
98
+ "test:manual:apis:usertoken_postput": "tests/manual_test.sh usertoken_postput",
99
+ "test:manual:apis:usertoken_gethead": "tests/manual_test.sh usertoken_gethead",
100
+ "test:manual:apis:policy_postput": "tests/manual_test.sh policy_postput",
101
+ "test:manual:apis:policy_gethead": "tests/manual_test.sh policy_gethead",
102
+ "test:manual:apis:policy_delete": "tests/manual_test.sh policy_delete",
103
+ "test:manual:apis:resource_postput": "tests/manual_test.sh resource_postput",
104
+ "test:manual:apis:resource_gethead": "tests/manual_test.sh resource_gethead",
105
+ "test:manual:apis:resource_delete": "tests/manual_test.sh resource_delete",
106
+ "test:manual:apis:role_postput": "tests/manual_test.sh role_postput",
107
+ "test:manual:apis:role_gethead": "tests/manual_test.sh role_gethead",
108
+ "test:manual:apis:role_delete": "tests/manual_test.sh role_delete",
109
+ "test:manual:apis:service_postput": "tests/manual_test.sh service_postput",
110
+ "test:manual:apis:service_gethead": "tests/manual_test.sh service_gethead",
111
+ "test:manual:apis:service_delete": "tests/manual_test.sh service_delete",
112
+ "test:manual:apis:acr_postput": "tests/manual_test.sh acr_postput",
113
+ "test:manual:apis:acr_get": "tests/manual_test.sh acr_get",
114
+ "test:manual:apis:acr_delete": "tests/manual_test.sh acr_delete",
115
+ "test:manual:apis:list_gethead": "tests/manual_test.sh list_gethead",
116
+ "test:manual:apis:userdata_get": "tests/manual_test.sh userdata_get",
117
+ "test:manual:apis:extdata_get": "tests/manual_test.sh extdata_get",
118
+ "test:manual:apis:allusertenant_get": "tests/manual_test.sh allusertenant_get",
119
+ "test:manual:apis:k2hr3keys_get": "tests/manual_test.sh k2hr3keys_get",
120
+ "test:manual:load:k2hdkcdata:auto": "tests/k2hdkc_test_load.sh --for_auto_test && echo '' && echo 'Load test data for automatically testing - Success' && echo ''",
121
+ "test:manual:load:k2hdkcdata:local": "tests/k2hdkc_test_load.sh --main 33348 --sub 37146 && echo '' && echo 'Load test data for local testing - Success' && echo ''",
122
+ "test:manual:templengine": "tests/auto_template.sh && echo '' && echo 'Test template engine - Success' && echo ''",
123
+ "test:manual:templengine:async": "tests/auto_template.sh -a && echo '' && echo 'Test asynchronous template engine - Success' && echo ''"
127
124
  },
128
125
  "repository": {
129
126
  "type": "git",
130
127
  "url": "git@github.com:yahoojapan/k2hr3_api.git"
131
128
  },
129
+ "publishConfig": {
130
+ "access": "public"
131
+ },
132
132
  "bugs": {
133
- "url": "https://github.com/yahoojapan/k2hr3_api/issues"
133
+ "url": "https://github.com/yahoojapan/k2hr3_api/issues",
134
+ "email": "antpickax-support@mail.yahoo.co.jp"
134
135
  },
135
136
  "homepage": "https://k2hr3.antpick.ax/",
136
137
  "keywords": [
@@ -149,10 +150,10 @@
149
150
  "babel"
150
151
  ],
151
152
  "author": [
152
- "Takeshi Nakatani <ggtakec@gmail.com>"
153
+ "Takeshi Nakatani <ggtakec@gmail.com> (https://github.com/ggtakec)"
153
154
  ],
154
155
  "contributors": [
155
- "Hirotaka Wakabayashi <hiwakaba@yahoo-corp.jp>"
156
+ "Hirotaka Wakabayashi <hiwakaba@yahoo-corp.jp> (https://github.com/hiwakaba)"
156
157
  ],
157
158
  "license": "MIT"
158
159
  }
package/routes/acr.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -773,7 +773,10 @@ router.delete('/', function(req, res, next) // eslint-disable-line no-unu
773
773
  module.exports = router;
774
774
 
775
775
  /*
776
- * VIM modelines
777
- *
778
- * vim:set ts=4 fenc=utf-8:
776
+ * Local variables:
777
+ * tab-width: 4
778
+ * c-basic-offset: 4
779
+ * End:
780
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
781
+ * vim<600: noexpandtab sw=4 ts=4
779
782
  */
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -256,7 +256,10 @@ router.get('/', function(req, res, next)
256
256
  module.exports = router;
257
257
 
258
258
  /*
259
- * VIM modelines
260
- *
261
- * vim:set ts=4 fenc=utf-8:
259
+ * Local variables:
260
+ * tab-width: 4
261
+ * c-basic-offset: 4
262
+ * End:
263
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
264
+ * vim<600: noexpandtab sw=4 ts=4
262
265
  */
package/routes/extdata.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2018 Yahoo! Japan Corporation.
4
+ * Copyright 2018 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -239,7 +239,10 @@ router.get('/', function(req, res, next)
239
239
  module.exports = router;
240
240
 
241
241
  /*
242
- * VIM modelines
243
- *
244
- * vim:set ts=4 fenc=utf-8:
242
+ * Local variables:
243
+ * tab-width: 4
244
+ * c-basic-offset: 4
245
+ * End:
246
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
247
+ * vim<600: noexpandtab sw=4 ts=4
245
248
  */
package/routes/list.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -273,7 +273,10 @@ router.head('/', function(req, res, next)
273
273
  module.exports = router;
274
274
 
275
275
  /*
276
- * VIM modelines
277
- *
278
- * vim:set ts=4 fenc=utf-8:
276
+ * Local variables:
277
+ * tab-width: 4
278
+ * c-basic-offset: 4
279
+ * End:
280
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
281
+ * vim<600: noexpandtab sw=4 ts=4
279
282
  */
package/routes/policy.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -908,7 +908,10 @@ router.delete('/', function(req, res, next) // eslint-disable-line no-unused
908
908
  module.exports = router;
909
909
 
910
910
  /*
911
- * VIM modelines
912
- *
913
- * vim:set ts=4 fenc=utf-8:
911
+ * Local variables:
912
+ * tab-width: 4
913
+ * c-basic-offset: 4
914
+ * End:
915
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
916
+ * vim<600: noexpandtab sw=4 ts=4
914
917
  */
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -1487,7 +1487,10 @@ router.delete('/', function(req, res, next) // eslint-disable-line no-unused
1487
1487
  module.exports = router;
1488
1488
 
1489
1489
  /*
1490
- * VIM modelines
1491
- *
1492
- * vim:set ts=4 fenc=utf-8:
1490
+ * Local variables:
1491
+ * tab-width: 4
1492
+ * c-basic-offset: 4
1493
+ * End:
1494
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
1495
+ * vim<600: noexpandtab sw=4 ts=4
1493
1496
  */
package/routes/role.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -2773,7 +2773,10 @@ function rawDeleteRoleToken(req, res)
2773
2773
  module.exports = router;
2774
2774
 
2775
2775
  /*
2776
- * VIM modelines
2777
- *
2778
- * vim:set ts=4 fenc=utf-8:
2776
+ * Local variables:
2777
+ * tab-width: 4
2778
+ * c-basic-offset: 4
2779
+ * End:
2780
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
2781
+ * vim<600: noexpandtab sw=4 ts=4
2779
2782
  */
package/routes/service.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -921,7 +921,10 @@ router.delete('/', function(req, res, next) // eslint-disable-line no-unu
921
921
  module.exports = router;
922
922
 
923
923
  /*
924
- * VIM modelines
925
- *
926
- * vim:set ts=4 fenc=utf-8:
924
+ * Local variables:
925
+ * tab-width: 4
926
+ * c-basic-offset: 4
927
+ * End:
928
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
929
+ * vim<600: noexpandtab sw=4 ts=4
927
930
  */
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -551,7 +551,10 @@ router.head('/', function(req, res, next) // eslint-disable-line no-unused-
551
551
  module.exports = router;
552
552
 
553
553
  /*
554
- * VIM modelines
555
- *
556
- * vim:set ts=4 fenc=utf-8:
554
+ * Local variables:
555
+ * tab-width: 4
556
+ * c-basic-offset: 4
557
+ * End:
558
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
559
+ * vim<600: noexpandtab sw=4 ts=4
557
560
  */
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2018 Yahoo! Japan Corporation.
4
+ * Copyright 2018 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -217,7 +217,10 @@ router.get('/', function(req, res, next)
217
217
  module.exports = router;
218
218
 
219
219
  /*
220
- * VIM modelines
221
- *
222
- * vim:set ts=4 fenc=utf-8:
220
+ * Local variables:
221
+ * tab-width: 4
222
+ * c-basic-offset: 4
223
+ * End:
224
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
225
+ * vim<600: noexpandtab sw=4 ts=4
223
226
  */
package/routes/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -83,7 +83,10 @@ router.get('/v1', function(req, res, next) // eslint-disable-line no-unused
83
83
  module.exports = router;
84
84
 
85
85
  /*
86
- * VIM modelines
87
- *
88
- * vim:set ts=4 fenc=utf-8:
86
+ * Local variables:
87
+ * tab-width: 4
88
+ * c-basic-offset: 4
89
+ * End:
90
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
91
+ * vim<600: noexpandtab sw=4 ts=4
89
92
  */
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # K2HR3 REST API
4
4
  #
5
- # Copyright 2017 Yahoo! Japan Corporation.
5
+ # Copyright 2017 Yahoo Japan Corporation.
6
6
  #
7
7
  # K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
8
8
  # common management information for the cloud.
@@ -19,70 +19,53 @@
19
19
  #
20
20
 
21
21
  # [NOTE]
22
- # This file expects the following variables to replace.
23
- # GIT_DOMAIN_URL (ex. "https://github.com" from GITHUB_SERVER_URL environment)
24
- # DOCKER_IMAGE_NAME (ex. "k2hr3-api")
25
- # DOCKER_IMAGE_BASE (ex. "antpickax/k2hdkc:latest")
26
- # DOCKER_IMAGE_DEV_BASE (ex. "antpickax/k2hdkc-dev:latest")
27
- # DOCKER_GIT_ORGANIZATION (ex. "antpickax")
28
- # DOCKER_GIT_REPOSITORY (ex. "xxxxx")
29
- # DOCKER_GIT_BRANCH (ex. "yyyyy")
22
+ # This file expects the following variables to be expanded by autoconf.
23
+ # PACKAGE_NAME
24
+ #
25
+ # Also, replace the following variables.
26
+ # DOCKER_IMAGE_BASE (ex. "alpine:latest")
27
+ # PRE_PROCESS (ex. ":")
28
+ # POST_PROCESS (ex. ":")
29
+ # IMAGE_CMD_BASE (ex. "['/bin/sh', '-c', 'tail -f /dev/null']" as default)
30
30
  # PKG_UPDATE (ex. "apk update -q --no-progress")
31
- # PKG_INSTALL_BUILDER (ex. "apk add -q --no-progress --no-cache git build-base openssl libtool automake autoconf procps")
32
- # PKG_INSTALL_BIN (ex. "apk add -q --no-progress --no-cache libstdc++")
33
- # PKG_REPO_SETUP_NODEJS (ex. "curl -sL https://deb.nodesource.com/setup_14.x | bash")
34
- # PKG_INSTALL_NODEJS (ex. "apk add -q --no-progress --no-cache nodejs npm")
35
- # BUILD_ENV (ex, "ENV DEBIAN_FRONTEND=noninteractive")
31
+ # PKG_INSTALL_CURL (ex. "apk add -q --no-progress --no-cache git build-base openssl libtool automake autoconf procps")
32
+ # PKG_INSTALL_BASE (ex. "apk add -q --no-progress --no-cache antpickax-package...")
33
+ # SETUP_PC_REPO (ex. "curl -s https://packagecloud.io/install/repositories/yahoojapan/stable/script.alpine.sh | sh")
34
+ # SETUP_ENV (ex. "ENV DEBIAN_FRONTEND=noninteractive")
36
35
  # UPDATE_LIBPATH (ex. "ldconfig", if want no-operation, specify ":")
37
- #
38
-
39
- #
40
- # Builder
41
- #
42
- FROM %%DOCKER_IMAGE_DEV_BASE%% AS %%DOCKER_IMAGE_NAME%%-builder
43
-
44
- MAINTAINER antpickax
45
- WORKDIR /
46
-
47
- %%BUILD_ENV%%
48
-
49
- RUN set -x && \
50
- %%PKG_UPDATE%% && \
51
- %%PKG_INSTALL_BUILDER%% && \
52
- %%PKG_REPO_SETUP_NODEJS%% && \
53
- %%PKG_INSTALL_NODEJS%% && \
54
- npm install -g npm && \
55
- git clone %%GIT_DOMAIN_URL%%/%%DOCKER_GIT_ORGANIZATION%%/%%DOCKER_GIT_REPOSITORY%%.git && \
56
- cd %%DOCKER_GIT_REPOSITORY%% && \
57
- git checkout %%DOCKER_GIT_BRANCH%% && \
58
- npm install --save-dev && \
59
- rm -rf .eslintrc.js .git .github .gitignore .npmignore .publishrc .auditignore templ/Dockerfile.templ test config/development.json config/dummyuser.json config/extdata-dummy.sh.templ && \
60
- cd / && \
61
- tar cvzf %%DOCKER_IMAGE_NAME%%.tgz %%DOCKER_GIT_REPOSITORY%%
36
+ # PKG_UNINSTALL_BASE (ex. "apk del package...")
37
+ # PKG_REPO_SETUP_NODEJS (ex. "curl -sL https://deb.nodesource.com/setup_18.x | bash" for ubuntu)
38
+ # NPM_INSTALL_BASE (ex. "npm install -g k2hr3-api")
62
39
 
63
40
  #
64
41
  # Image for main
65
42
  #
66
- FROM %%DOCKER_IMAGE_BASE%% AS %%DOCKER_IMAGE_NAME%%
43
+ FROM %%DOCKER_IMAGE_BASE%% AS %%PACKAGE_NAME%%
67
44
 
68
45
  MAINTAINER antpickax
69
46
  WORKDIR /
70
47
 
48
+ %%SETUP_ENV%%
49
+
71
50
  RUN set -x && \
51
+ %%PRE_PROCESS%% && \
72
52
  %%PKG_UPDATE%% && \
73
- %%PKG_INSTALL_BIN%% && \
53
+ %%PKG_INSTALL_CURL%% && \
54
+ %%SETUP_PC_REPO%% && \
74
55
  %%PKG_REPO_SETUP_NODEJS%% && \
75
- %%PKG_INSTALL_NODEJS%% && \
76
- npm install -g npm
77
-
78
- COPY --from=%%DOCKER_IMAGE_NAME%%-builder /%%DOCKER_IMAGE_NAME%%.tgz /%%DOCKER_IMAGE_NAME%%.tgz
56
+ %%PKG_INSTALL_BASE%% && \
57
+ %%NPM_INSTALL_BASE%% && \
58
+ %%UPDATE_LIBPATH%% && \
59
+ %%PKG_UNINSTALL_BASE%% && \
60
+ %%POST_PROCESS%%
79
61
 
80
- RUN cd /usr/lib/node_modules && \
81
- tar xvzf /%%DOCKER_IMAGE_NAME%%.tgz && \
82
- rm /%%DOCKER_IMAGE_NAME%%.tgz && \
83
- %%UPDATE_LIBPATH%%
62
+ CMD %%IMAGE_CMD_BASE%%
84
63
 
85
- # [NOTE]
86
- # Rplace command : /usr/lib/node_modules/k2hr3_api/bin/run.sh -fg --production
87
64
  #
88
- CMD ["/bin/sh"]
65
+ # Local variables:
66
+ # tab-width: 4
67
+ # c-basic-offset: 4
68
+ # End:
69
+ # vim600: noexpandtab sw=4 ts=4 fdm=marker
70
+ # vim<600: noexpandtab sw=4 ts=4
71
+ #
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -1092,7 +1092,10 @@ describe('API : ACR', function(){ // eslint-disable-line no-undef
1092
1092
  });
1093
1093
 
1094
1094
  /*
1095
- * VIM modelines
1096
- *
1097
- * vim:set ts=4 fenc=utf-8:
1095
+ * Local variables:
1096
+ * tab-width: 4
1097
+ * c-basic-offset: 4
1098
+ * End:
1099
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
1100
+ * vim<600: noexpandtab sw=4 ts=4
1098
1101
  */
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * K2HR3 REST API
3
3
  *
4
- * Copyright 2017 Yahoo! Japan Corporation.
4
+ * Copyright 2017 Yahoo Japan Corporation.
5
5
  *
6
6
  * K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers
7
7
  * common management information for the cloud.
@@ -70,7 +70,10 @@ describe('SUB API TEST: ACR', function(){ // eslint-disable-line no-undef
70
70
  });
71
71
 
72
72
  /*
73
- * VIM modelines
74
- *
75
- * vim:set ts=4 fenc=utf-8:
73
+ * Local variables:
74
+ * tab-width: 4
75
+ * c-basic-offset: 4
76
+ * End:
77
+ * vim600: noexpandtab sw=4 ts=4 fdm=marker
78
+ * vim<600: noexpandtab sw=4 ts=4
76
79
  */