k2hr3-api 1.0.27 → 1.0.29
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.
- package/ChangeLog +12 -0
- package/package.json +5 -5
- package/tests/auto_init_config_json.sh +65 -65
- package/tests/k2hr3template_test.js +3 -0
- package/tests/k2hr3template_test_async.js +3 -0
- package/tests/test.sh +3 -3
- /package/config/{default.json → default.json5} +0 -0
- /package/config/{development.json → development.json5} +0 -0
- /package/config/{dummyuser.json → dummyuser.json5} +0 -0
- /package/config/{keystone_v2.json → keystone_v2.json5} +0 -0
- /package/config/{keystone_v3.json → keystone_v3.json5} +0 -0
package/ChangeLog
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
k2hr3-api (1.0.29) unstable; urgency=low
|
|
2
|
+
|
|
3
|
+
* Fixed bugs about publishing packages and images - #108
|
|
4
|
+
|
|
5
|
+
-- Takeshi Nakatani <ggtakec@gmail.com> Wed, 06 Sep 2023 16:58:40 +0900
|
|
6
|
+
|
|
7
|
+
k2hr3-api (1.0.28) unstable; urgency=low
|
|
8
|
+
|
|
9
|
+
* Updated support NodeJS version - #106
|
|
10
|
+
|
|
11
|
+
-- Takeshi Nakatani <ggtakec@gmail.com> Wed, 06 Sep 2023 15:25:25 +0900
|
|
12
|
+
|
|
1
13
|
k2hr3-api (1.0.27) unstable; urgency=low
|
|
2
14
|
|
|
3
15
|
* Updated TENANT API and fixed bugs in TENANT API - #104
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "k2hr3-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@kubernetes/client-node": "^0.18.1",
|
|
6
6
|
"body-parser": "^1.20.2",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dateformat": "^4.6.3",
|
|
10
10
|
"debug": "~4.3.4",
|
|
11
11
|
"express": "^4.18.2",
|
|
12
|
-
"jose": "^4.14.
|
|
13
|
-
"k2hdkc": "^1.0.
|
|
12
|
+
"jose": "^4.14.6",
|
|
13
|
+
"k2hdkc": "^1.0.6",
|
|
14
14
|
"morgan": "~1.10.0",
|
|
15
15
|
"rotating-file-stream": "^3.1.1"
|
|
16
16
|
},
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"test": "test"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"chai": "^4.3.
|
|
31
|
+
"chai": "^4.3.8",
|
|
32
32
|
"chai-http": "^4.4.0",
|
|
33
|
-
"eslint": "^8.
|
|
33
|
+
"eslint": "^8.48.0",
|
|
34
34
|
"mocha": "^10.2.0",
|
|
35
35
|
"nyc": "^15.1.0"
|
|
36
36
|
},
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
#
|
|
20
20
|
|
|
21
21
|
#----------------------------------------------------------
|
|
22
|
-
# This script is checking/creating/Restoring config/local.
|
|
23
|
-
# (and local-development.
|
|
22
|
+
# This script is checking/creating/Restoring config/local.json5
|
|
23
|
+
# (and local-development.json5) for test environment
|
|
24
24
|
#----------------------------------------------------------
|
|
25
25
|
|
|
26
26
|
#==========================================================
|
|
@@ -35,11 +35,11 @@ SRCTOP=$(cd "${SCRIPTDIR}/.." || exit 1; pwd)
|
|
|
35
35
|
# Variables
|
|
36
36
|
#
|
|
37
37
|
CONFIGDIR="${SRCTOP}/config"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
LOCAL_JSON5="${CONFIGDIR}/local.json5"
|
|
39
|
+
LOCAL_JSON5_BUP="${LOCAL_JSON5}_AUTOTEST_BUP"
|
|
40
|
+
LOCALDEVELOP_JSON5="${CONFIGDIR}/local-development.json5"
|
|
41
|
+
LOCALDEVELOP_JSON5_BUP="${LOCALDEVELOP_JSON5}_AUTOTEST_BUP"
|
|
42
|
+
DUMMY_JSON5="${CONFIGDIR}/dummyuser.json5"
|
|
43
43
|
|
|
44
44
|
#==============================================================
|
|
45
45
|
# Utility functions
|
|
@@ -102,74 +102,74 @@ if [ "${PROC_MODE}" = "set" ]; then
|
|
|
102
102
|
#
|
|
103
103
|
|
|
104
104
|
#
|
|
105
|
-
# Check local.
|
|
105
|
+
# Check local.json5
|
|
106
106
|
#
|
|
107
|
-
if [ -f "${
|
|
108
|
-
if [ ! -L "${
|
|
109
|
-
echo "[ERROR] ${
|
|
107
|
+
if [ -f "${LOCAL_JSON5}" ]; then
|
|
108
|
+
if [ ! -L "${LOCAL_JSON5}" ]; then
|
|
109
|
+
echo "[ERROR] ${LOCAL_JSON5} is existed as real file."
|
|
110
110
|
exit 1
|
|
111
111
|
fi
|
|
112
112
|
|
|
113
|
-
if ! SLINK_FILE=$(readlink "${
|
|
114
|
-
echo "[ERROR] Could not read link as ${
|
|
113
|
+
if ! SLINK_FILE=$(readlink "${LOCAL_JSON5}"); then
|
|
114
|
+
echo "[ERROR] Could not read link as ${LOCAL_JSON5}"
|
|
115
115
|
exit 1
|
|
116
116
|
fi
|
|
117
117
|
|
|
118
|
-
if [ "${SLINK_FILE}" = "${
|
|
118
|
+
if [ "${SLINK_FILE}" = "${DUMMY_JSON5}" ]; then
|
|
119
119
|
#
|
|
120
|
-
# local.
|
|
120
|
+
# local.json5 is already linked to dummyuser.json5
|
|
121
121
|
#
|
|
122
|
-
echo "[INFO] Already ${
|
|
122
|
+
echo "[INFO] Already ${LOCAL_JSON5} file is linked ${DUMMY_JSON5}"
|
|
123
123
|
|
|
124
124
|
else
|
|
125
125
|
#
|
|
126
126
|
# Make backup and create new symbolic link file
|
|
127
127
|
#
|
|
128
|
-
if [ -f "${
|
|
129
|
-
echo "[ERROR] Could not rename file ${
|
|
128
|
+
if [ -f "${LOCAL_JSON5_BUP}" ]; then
|
|
129
|
+
echo "[ERROR] Could not rename file ${LOCAL_JSON5} to ${LOCAL_JSON5_BUP}, because ${LOCAL_JSON5_BUP} already exists."
|
|
130
130
|
exit 1
|
|
131
131
|
fi
|
|
132
132
|
|
|
133
133
|
#
|
|
134
134
|
# Rename
|
|
135
135
|
#
|
|
136
|
-
if ! mv "${
|
|
137
|
-
echo "[ERROR] Could not rename file ${
|
|
136
|
+
if ! mv "${LOCAL_JSON5}" "${LOCAL_JSON5_BUP}" >/dev/null 2>&1; then
|
|
137
|
+
echo "[ERROR] Could not rename file ${LOCAL_JSON5} to ${LOCAL_JSON5_BUP}"
|
|
138
138
|
exit 1
|
|
139
139
|
fi
|
|
140
140
|
|
|
141
141
|
#
|
|
142
|
-
# Make symbolic link local.
|
|
142
|
+
# Make symbolic link local.json5
|
|
143
143
|
#
|
|
144
|
-
if ! ln -s "${
|
|
145
|
-
echo "[ERROR] Could not create symbolic file ${
|
|
144
|
+
if ! ln -s "${DUMMY_JSON5}" "${LOCAL_JSON5}" >/dev/null 2>&1; then
|
|
145
|
+
echo "[ERROR] Could not create symbolic file ${DUMMY_JSON5} to ${LOCAL_JSON5}"
|
|
146
146
|
exit 1
|
|
147
147
|
fi
|
|
148
148
|
fi
|
|
149
149
|
else
|
|
150
150
|
#
|
|
151
|
-
# There is no local.
|
|
151
|
+
# There is no local.json5, thus only make symbolic link local.json5
|
|
152
152
|
#
|
|
153
|
-
if ! ln -s "${
|
|
154
|
-
echo "[ERROR] Could not create symbolic file ${
|
|
153
|
+
if ! ln -s "${DUMMY_JSON5}" "${LOCAL_JSON5}" >/dev/null 2>&1; then
|
|
154
|
+
echo "[ERROR] Could not create symbolic file ${DUMMY_JSON5} to ${LOCAL_JSON5}"
|
|
155
155
|
exit 1
|
|
156
156
|
fi
|
|
157
157
|
fi
|
|
158
158
|
|
|
159
159
|
#
|
|
160
|
-
# Check local-development.
|
|
160
|
+
# Check local-development.json5
|
|
161
161
|
#
|
|
162
|
-
if [ -f "${
|
|
163
|
-
if [ -f "${
|
|
164
|
-
echo "[ERROR] Could not rename file ${
|
|
162
|
+
if [ -f "${LOCALDEVELOP_JSON5}" ]; then
|
|
163
|
+
if [ -f "${LOCALDEVELOP_JSON5_BUP}" ]; then
|
|
164
|
+
echo "[ERROR] Could not rename file ${LOCALDEVELOP_JSON5} to ${LOCALDEVELOP_JSON5_BUP}, because ${LOCALDEVELOP_JSON5_BUP} already exists."
|
|
165
165
|
exit 1
|
|
166
166
|
fi
|
|
167
167
|
|
|
168
168
|
#
|
|
169
169
|
# Rename
|
|
170
170
|
#
|
|
171
|
-
if ! mv "${
|
|
172
|
-
echo "[ERROR] Could not rename file ${
|
|
171
|
+
if ! mv "${LOCALDEVELOP_JSON5}" "${LOCALDEVELOP_JSON5_BUP}" >/dev/null 2>&1; then
|
|
172
|
+
echo "[ERROR] Could not rename file ${LOCALDEVELOP_JSON5} to ${LOCALDEVELOP_JSON5_BUP}"
|
|
173
173
|
exit 1
|
|
174
174
|
fi
|
|
175
175
|
fi
|
|
@@ -179,55 +179,55 @@ else
|
|
|
179
179
|
#
|
|
180
180
|
|
|
181
181
|
#
|
|
182
|
-
# Restore local.
|
|
182
|
+
# Restore local.json5
|
|
183
183
|
#
|
|
184
|
-
if [ ! -f "${
|
|
185
|
-
if [ -f "${
|
|
186
|
-
if [ ! -L "${
|
|
187
|
-
echo "[WARNING] Not found ${
|
|
184
|
+
if [ ! -f "${LOCAL_JSON5_BUP}" ]; then
|
|
185
|
+
if [ -f "${LOCAL_JSON5}" ]; then
|
|
186
|
+
if [ ! -L "${LOCAL_JSON5}" ]; then
|
|
187
|
+
echo "[WARNING] Not found ${LOCAL_JSON5_BUP} and exists ${LOCAL_JSON5} as real file, so nothing to do"
|
|
188
188
|
else
|
|
189
189
|
#
|
|
190
|
-
# local.
|
|
190
|
+
# local.json5 is symbolic link
|
|
191
191
|
#
|
|
192
|
-
if ! SLINK_FILE=$(readlink "${
|
|
193
|
-
echo "[ERROR] Could not read link as ${
|
|
192
|
+
if ! SLINK_FILE=$(readlink "${LOCAL_JSON5}"); then
|
|
193
|
+
echo "[ERROR] Could not read link as ${LOCAL_JSON5}"
|
|
194
194
|
exit 1
|
|
195
195
|
fi
|
|
196
196
|
|
|
197
|
-
if [ "${SLINK_FILE}" = "${
|
|
197
|
+
if [ "${SLINK_FILE}" = "${DUMMY_JSON5}" ]; then
|
|
198
198
|
#
|
|
199
|
-
# local.
|
|
199
|
+
# local.json5 is linked to dummyuser.json5
|
|
200
200
|
#
|
|
201
|
-
if ! rm -f "${
|
|
202
|
-
echo "[ERROR] Could not remove file ${
|
|
201
|
+
if ! rm -f "${LOCAL_JSON5}"; then
|
|
202
|
+
echo "[ERROR] Could not remove file ${LOCAL_JSON5}"
|
|
203
203
|
exit 1
|
|
204
204
|
fi
|
|
205
205
|
else
|
|
206
206
|
#
|
|
207
|
-
# local.
|
|
207
|
+
# local.json5 is not linked to dummyuser.json5
|
|
208
208
|
#
|
|
209
|
-
echo "[WARNING] Not found ${
|
|
209
|
+
echo "[WARNING] Not found ${LOCAL_JSON5_BUP} and exists ${LOCAL_JSON5} as symbolic link, but it is not linking to dummyuser.json5"
|
|
210
210
|
fi
|
|
211
211
|
fi
|
|
212
212
|
else
|
|
213
|
-
echo "[WARNING] Not found ${
|
|
213
|
+
echo "[WARNING] Not found ${LOCAL_JSON5_BUP} and ${LOCAL_JSON5}."
|
|
214
214
|
fi
|
|
215
215
|
else
|
|
216
|
-
if [ -f "${
|
|
217
|
-
if [ ! -L "${
|
|
218
|
-
echo "[WARNING] ${
|
|
216
|
+
if [ -f "${LOCAL_JSON5}" ]; then
|
|
217
|
+
if [ ! -L "${LOCAL_JSON5}" ]; then
|
|
218
|
+
echo "[WARNING] ${LOCAL_JSON5} is not created by ${PRGNAME} program, because it is not symbolic link."
|
|
219
219
|
else
|
|
220
|
-
if ! SLINK_FILE=$(readlink "${
|
|
221
|
-
echo "[ERROR] Could not read link as ${
|
|
220
|
+
if ! SLINK_FILE=$(readlink "${LOCAL_JSON5}"); then
|
|
221
|
+
echo "[ERROR] Could not read link as ${LOCAL_JSON5}"
|
|
222
222
|
exit 1
|
|
223
223
|
fi
|
|
224
224
|
|
|
225
|
-
if [ "${SLINK_FILE}" != "${
|
|
226
|
-
echo "[WARNING] ${
|
|
225
|
+
if [ "${SLINK_FILE}" != "${DUMMY_JSON5}" ]; then
|
|
226
|
+
echo "[WARNING] ${LOCAL_JSON5} is not created by ${PRGNAME} program, because it is not symbolic link to ${DUMMY_JSON5}."
|
|
227
227
|
else
|
|
228
228
|
# remove
|
|
229
|
-
if ! rm -f "${
|
|
230
|
-
echo "[ERROR] Could not remove file ${
|
|
229
|
+
if ! rm -f "${LOCAL_JSON5}"; then
|
|
230
|
+
echo "[ERROR] Could not remove file ${LOCAL_JSON5}"
|
|
231
231
|
exit 1
|
|
232
232
|
fi
|
|
233
233
|
fi
|
|
@@ -237,26 +237,26 @@ else
|
|
|
237
237
|
#
|
|
238
238
|
# Rename
|
|
239
239
|
#
|
|
240
|
-
if ! mv "${
|
|
241
|
-
echo "[ERROR] Could not rename file ${
|
|
240
|
+
if ! mv "${LOCAL_JSON5_BUP}" "${LOCAL_JSON5}" >/dev/null 2>&1; then
|
|
241
|
+
echo "[ERROR] Could not rename file ${LOCAL_JSON5_BUP} to ${LOCAL_JSON5}"
|
|
242
242
|
exit 1
|
|
243
243
|
fi
|
|
244
244
|
fi
|
|
245
245
|
|
|
246
246
|
#
|
|
247
|
-
# Restore local-development.
|
|
247
|
+
# Restore local-development.json5
|
|
248
248
|
#
|
|
249
|
-
if [ ! -f "${
|
|
250
|
-
echo "[INFO] Not found ${
|
|
249
|
+
if [ ! -f "${LOCALDEVELOP_JSON5_BUP}" ]; then
|
|
250
|
+
echo "[INFO] Not found ${LOCALDEVELOP_JSON5_BUP}, skip restoring ${LOCALDEVELOP_JSON5}."
|
|
251
251
|
else
|
|
252
|
-
if [ -f "${
|
|
253
|
-
echo "[WARNING] ${
|
|
252
|
+
if [ -f "${LOCALDEVELOP_JSON5}" ]; then
|
|
253
|
+
echo "[WARNING] ${LOCALDEVELOP_JSON5} already exists, could not restoring from ${LOCALDEVELOP_JSON5_BUP}."
|
|
254
254
|
else
|
|
255
255
|
#
|
|
256
256
|
# Rename
|
|
257
257
|
#
|
|
258
|
-
if ! mv "${
|
|
259
|
-
echo "[ERROR] Could not rename file ${
|
|
258
|
+
if ! mv "${LOCALDEVELOP_JSON5_BUP}" "${LOCALDEVELOP_JSON5}" >/dev/null 2>&1; then
|
|
259
|
+
echo "[ERROR] Could not rename file ${LOCALDEVELOP_JSON5_BUP} to ${LOCALDEVELOP_JSON5}"
|
|
260
260
|
exit 1
|
|
261
261
|
fi
|
|
262
262
|
fi
|
|
@@ -100,6 +100,9 @@ fs.readFile(templfile, 'utf8', function(err, templString)
|
|
|
100
100
|
if('' === varfile){
|
|
101
101
|
r3logger.dlog('variable file(' + varfile + ') is not specified.');
|
|
102
102
|
is_varfile_json = false;
|
|
103
|
+
}else if(apiutil.compareCaseString('.json5', varfile.substr(-6))){
|
|
104
|
+
r3logger.dlog('variable file(' + varfile + ') is JSON5 type.');
|
|
105
|
+
is_varfile_json = true;
|
|
103
106
|
}else if(apiutil.compareCaseString('.json', varfile.substr(-5))){
|
|
104
107
|
r3logger.dlog('variable file(' + varfile + ') is JSON type.');
|
|
105
108
|
is_varfile_json = true;
|
|
@@ -125,6 +125,9 @@ fs.readFile(templfile, 'utf8', function(err, templString)
|
|
|
125
125
|
if('' === varfile){
|
|
126
126
|
r3logger.dlog('variable file(' + varfile + ') is not specified.');
|
|
127
127
|
is_varfile_json = false;
|
|
128
|
+
}else if(apiutil.compareCaseString('.json5', varfile.substr(-6))){
|
|
129
|
+
r3logger.dlog('variable file(' + varfile + ') is JSON5 type.');
|
|
130
|
+
is_varfile_json = true;
|
|
128
131
|
}else if(apiutil.compareCaseString('.json', varfile.substr(-5))){
|
|
129
132
|
r3logger.dlog('variable file(' + varfile + ') is JSON type.');
|
|
130
133
|
is_varfile_json = true;
|
package/tests/test.sh
CHANGED
|
@@ -304,20 +304,20 @@ if [ "${DEBUG_ENV_LEVEL}" -ge 4 ]; then
|
|
|
304
304
|
fi
|
|
305
305
|
|
|
306
306
|
if ! "${AUTO_INIT_SH}" --set; then
|
|
307
|
-
echo "[ERROR] Could not initialize local.
|
|
307
|
+
echo "[ERROR] Could not initialize local.json5(symbolic link to dummy)"
|
|
308
308
|
exit 1
|
|
309
309
|
fi
|
|
310
310
|
|
|
311
311
|
if ! NODE_PATH="${NODE_PATH}" NODE_ENV="${NODE_ENV_VALUE}" NODE_DEBUG="${DEBUG_ENV_PARAM}" NODE_LOGGER="${NODE_LOGGER}" NODE_CONFIG_DIR='' node_modules/.bin/mocha --timeout "${TIMEOUT}" "tests/${CMD_PREFIX}${COMMAND}${CMD_SUFFIX}"; then
|
|
312
312
|
echo "[ERROR] Failed test."
|
|
313
313
|
if ! "${AUTO_INIT_SH}" --restore; then
|
|
314
|
-
echo "[ERROR] Could not restore local.
|
|
314
|
+
echo "[ERROR] Could not restore local.json5"
|
|
315
315
|
fi
|
|
316
316
|
exit 1
|
|
317
317
|
fi
|
|
318
318
|
|
|
319
319
|
if ! "${AUTO_INIT_SH}" --restore; then
|
|
320
|
-
echo "[ERROR] Could not restore local.
|
|
320
|
+
echo "[ERROR] Could not restore local.json5"
|
|
321
321
|
exit 1
|
|
322
322
|
fi
|
|
323
323
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|