k2hr3-api 1.0.24 → 1.0.26
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/app.js +63 -30
- package/bin/run.sh +14 -0
- package/config/default.json +3 -2
- package/lib/k2hr3config.js +12 -0
- package/lib/k2hr3dkc.js +903 -13
- package/lib/k2hr3keys.js +1 -0
- package/lib/k2hr3tokens.js +147 -60
- package/package.json +10 -5
- package/routes/tenant.js +1014 -0
- package/routes/userTokens.js +77 -126
- package/tests/auto_all_spec.js +4 -0
- package/tests/auto_tenant.js +989 -0
- package/tests/auto_tenant_spec.js +79 -0
- package/tests/auto_usertokens.js +6 -6
- package/tests/manual_acr_delete.js +1 -0
- package/tests/manual_acr_get.js +1 -0
- package/tests/manual_acr_postput.js +1 -0
- package/tests/manual_allusertenant_get.js +58 -3
- package/tests/manual_extdata_get.js +1 -0
- package/tests/manual_list_gethead.js +1 -0
- package/tests/manual_policy_delete.js +1 -0
- package/tests/manual_policy_gethead.js +3 -1
- package/tests/manual_policy_postput.js +1 -0
- package/tests/manual_resource_delete.js +1 -0
- package/tests/manual_resource_gethead.js +1 -0
- package/tests/manual_resource_postput.js +1 -0
- package/tests/manual_role_delete.js +2 -0
- package/tests/manual_role_gethead.js +4 -0
- package/tests/manual_role_postput.js +2 -0
- package/tests/manual_service_delete.js +1 -0
- package/tests/manual_service_gethead.js +1 -0
- package/tests/manual_service_postput.js +1 -0
- package/tests/manual_tenant_delete.js +152 -0
- package/tests/manual_tenant_gethead.js +268 -0
- package/tests/manual_tenant_postput.js +293 -0
- package/tests/manual_test.sh +21 -7
- package/tests/manual_userdata_get.js +1 -0
- package/tests/manual_usertoken_gethead.js +1 -0
- package/tests/manual_usertoken_postput.js +1 -0
- package/tests/manual_version_get.js +1 -0
- package/tests/test.sh +2 -0
package/lib/k2hr3keys.js
CHANGED
|
@@ -76,6 +76,7 @@ exports.getK2hr3Keys = function(user, tenant, service)
|
|
|
76
76
|
'VALUE_KEYSTONE_SUB': 'kstype_substitute',
|
|
77
77
|
'VALUE_OPENSTACK_V1': 'openstack-auto-v1', // used/set from k2hr3-init.sh
|
|
78
78
|
'VALUE_K8S_V1': 'k8s-auto-v1', // used/set from k2hr3-kube-init.sh
|
|
79
|
+
'VALUE_PREFIX_LOCAL_TENANT': 'local@',
|
|
79
80
|
|
|
80
81
|
// common keywords( part of keyname )
|
|
81
82
|
'POLICIES_KW': 'policies',
|
package/lib/k2hr3tokens.js
CHANGED
|
@@ -237,6 +237,34 @@ function rawGetScopedUserToken(unscopedtoken, username, userid, tenant, callback
|
|
|
237
237
|
}
|
|
238
238
|
_tenant_list.push(jsonres[cnt].name);
|
|
239
239
|
}
|
|
240
|
+
|
|
241
|
+
// get and add local tenants
|
|
242
|
+
var tmpresobj = k2hr3.listLocalTenant(_username, true);
|
|
243
|
+
if(!apiutil.isSafeEntity(tmpresobj) || !apiutil.isSafeEntity(tmpresobj.result) || false === tmpresobj.result){
|
|
244
|
+
if(apiutil.isSafeEntity(tmpresobj) && apiutil.isSafeString(tmpresobj.message)){
|
|
245
|
+
r3logger.wlog('failed to get local tenant list by ' + tmpresobj.message);
|
|
246
|
+
}else{
|
|
247
|
+
r3logger.wlog('failed to get local tenant list.');
|
|
248
|
+
}
|
|
249
|
+
}else{
|
|
250
|
+
if(!apiutil.isEmptyArray(tmpresobj.tenants)){
|
|
251
|
+
for(var cnt2 = 0; cnt2 < tmpresobj.tenants.length; ++cnt2){
|
|
252
|
+
var one_tenant = tmpresobj.tenants[cnt2];
|
|
253
|
+
if(!apiutil.isSafeEntity(tmpresobj.tenants[cnt2])){
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
if(apiutil.compareCaseString(tmpresobj.tenants[cnt2].name, _tenant)){
|
|
257
|
+
// find target tenant
|
|
258
|
+
_tenant_id = tmpresobj.tenants[cnt2].id;
|
|
259
|
+
_tenant_name = tmpresobj.tenants[cnt2].name;
|
|
260
|
+
_tenant_desc = tmpresobj.tenants[cnt2].desc; // eslint-disable-line no-unused-vars
|
|
261
|
+
_tenant_display = tmpresobj.tenants[cnt2].display; // eslint-disable-line no-unused-vars
|
|
262
|
+
}
|
|
263
|
+
_tenant_list.push(one_tenant);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
240
268
|
// check and remove old tenant for user
|
|
241
269
|
if(!k2hr3.removeComprehensionByNewTenants(_username, _tenant_list)){
|
|
242
270
|
r3logger.elog('failed to remove some tenant for user, but continue...');
|
|
@@ -611,16 +639,19 @@ function rawRemoveScopedUserToken(token)
|
|
|
611
639
|
//
|
|
612
640
|
// result : null or token information
|
|
613
641
|
// {
|
|
614
|
-
// role:
|
|
615
|
-
// user:
|
|
616
|
-
// hostname:
|
|
617
|
-
// ip:
|
|
618
|
-
// port:
|
|
619
|
-
// cuk:
|
|
620
|
-
// extra:
|
|
621
|
-
// tenant:
|
|
622
|
-
//
|
|
623
|
-
//
|
|
642
|
+
// role: role name
|
|
643
|
+
// user: user name
|
|
644
|
+
// hostname: always null
|
|
645
|
+
// ip: always null
|
|
646
|
+
// port: always 0
|
|
647
|
+
// cuk: always null
|
|
648
|
+
// extra: always null
|
|
649
|
+
// tenant: tenant name
|
|
650
|
+
// display: display alias name for tenant
|
|
651
|
+
// id: tenant id string
|
|
652
|
+
// description: description for tenant
|
|
653
|
+
// scoped: role token is always scoped(true)
|
|
654
|
+
// region: when user token, the creator region name of the token
|
|
624
655
|
// }
|
|
625
656
|
//
|
|
626
657
|
function rawCheckUserToken(token)
|
|
@@ -1719,16 +1750,19 @@ function rawGetDirectRoleTokenInfo(dkcobj_permanent, tokens)
|
|
|
1719
1750
|
//
|
|
1720
1751
|
// result : null or token information
|
|
1721
1752
|
// {
|
|
1722
|
-
// role:
|
|
1723
|
-
// user:
|
|
1724
|
-
// hostname:
|
|
1725
|
-
// ip:
|
|
1726
|
-
// port:
|
|
1727
|
-
// cuk:
|
|
1728
|
-
// extra:
|
|
1729
|
-
// tenant:
|
|
1730
|
-
//
|
|
1731
|
-
//
|
|
1753
|
+
// role: role name
|
|
1754
|
+
// user: null or user name
|
|
1755
|
+
// hostname: null or host name
|
|
1756
|
+
// ip: null or ip address
|
|
1757
|
+
// port: port number(if host is existed), 0 means any
|
|
1758
|
+
// cuk: cuk(allowed null)
|
|
1759
|
+
// extra: extra(allowed null)
|
|
1760
|
+
// tenant: tenant name
|
|
1761
|
+
// display: display alias name for tenant
|
|
1762
|
+
// id: tenant id string
|
|
1763
|
+
// description: description for tenant
|
|
1764
|
+
// scoped: role token is always scoped(true)
|
|
1765
|
+
// region: role token is always null
|
|
1732
1766
|
// }
|
|
1733
1767
|
//
|
|
1734
1768
|
function rawCheckRoleToken(token, ip, port, cuk, is_strict)
|
|
@@ -1800,6 +1834,12 @@ function rawCheckRoleToken(token, ip, port, cuk, is_strict)
|
|
|
1800
1834
|
return null;
|
|
1801
1835
|
}
|
|
1802
1836
|
|
|
1837
|
+
// Get tenant information
|
|
1838
|
+
var tenant_keys = r3keys(null, value.tenant);
|
|
1839
|
+
value.display = apiutil.getSafeString(dkcobj.getValue(tenant_keys.TENANT_DISP_KEY, null, true, null));
|
|
1840
|
+
value.id = apiutil.getSafeString(dkcobj.getValue(tenant_keys.TENANT_ID_KEY, null, true, null));
|
|
1841
|
+
value.description = apiutil.getSafeString(dkcobj.getValue(tenant_keys.TENANT_DESC_KEY, null, true, null));
|
|
1842
|
+
|
|
1803
1843
|
// compare ip address, if they are specified and token is not created by user
|
|
1804
1844
|
if(!apiutil.isSafeString(value.user)){
|
|
1805
1845
|
if(!apiutil.isSafeString(ip) || ip !== value.ip){
|
|
@@ -1881,17 +1921,20 @@ function rawCheckRoleToken(token, ip, port, cuk, is_strict)
|
|
|
1881
1921
|
}
|
|
1882
1922
|
|
|
1883
1923
|
// make result
|
|
1884
|
-
var token_info
|
|
1885
|
-
token_info.role
|
|
1886
|
-
token_info.user
|
|
1887
|
-
token_info.hostname
|
|
1888
|
-
token_info.ip
|
|
1889
|
-
token_info.port
|
|
1890
|
-
token_info.cuk
|
|
1891
|
-
token_info.extra
|
|
1892
|
-
token_info.tenant
|
|
1893
|
-
token_info.
|
|
1894
|
-
token_info.
|
|
1924
|
+
var token_info = {};
|
|
1925
|
+
token_info.role = value.role;
|
|
1926
|
+
token_info.user = value.user;
|
|
1927
|
+
token_info.hostname = value.hostname; // hostname
|
|
1928
|
+
token_info.ip = value.ip;
|
|
1929
|
+
token_info.port = value.port;
|
|
1930
|
+
token_info.cuk = value.cuk;
|
|
1931
|
+
token_info.extra = value.extra;
|
|
1932
|
+
token_info.tenant = value.tenant;
|
|
1933
|
+
token_info.display = value.display;
|
|
1934
|
+
token_info.id = value.id;
|
|
1935
|
+
token_info.description = value.description;
|
|
1936
|
+
token_info.scoped = true; // role token is always scoped
|
|
1937
|
+
token_info.region = null;
|
|
1895
1938
|
|
|
1896
1939
|
return token_info;
|
|
1897
1940
|
}
|
|
@@ -2124,10 +2167,19 @@ function rawGetUserTenantByToken(token)
|
|
|
2124
2167
|
dkcobj.clean();
|
|
2125
2168
|
return null;
|
|
2126
2169
|
}
|
|
2127
|
-
var
|
|
2128
|
-
var
|
|
2129
|
-
|
|
2130
|
-
|
|
2170
|
+
var user_name = apiutil.getSafeString(matches[1]);
|
|
2171
|
+
var tenant_name = apiutil.getSafeString(matches[2]);
|
|
2172
|
+
var tenant_display = null;
|
|
2173
|
+
var tenant_id = null;
|
|
2174
|
+
var tenant_desc = null;
|
|
2175
|
+
|
|
2176
|
+
if('' === tenant_name){
|
|
2177
|
+
tenant_name = null;
|
|
2178
|
+
}else{
|
|
2179
|
+
var tenant_keys = r3keys(user_name, tenant_name);
|
|
2180
|
+
tenant_display = apiutil.getSafeString(dkcobj.getValue(tenant_keys.TENANT_DISP_KEY, null, true, null));
|
|
2181
|
+
tenant_id = apiutil.getSafeString(dkcobj.getValue(tenant_keys.TENANT_ID_KEY, null, true, null));
|
|
2182
|
+
tenant_desc = apiutil.getSafeString(dkcobj.getValue(tenant_keys.TENANT_DESC_KEY, null, true, null));
|
|
2131
2183
|
}
|
|
2132
2184
|
|
|
2133
2185
|
// if token has seed, need to check seed
|
|
@@ -2140,20 +2192,21 @@ function rawGetUserTenantByToken(token)
|
|
|
2140
2192
|
//
|
|
2141
2193
|
//r3logger.dlog('token key(' + user_token_key + ') has seed.');
|
|
2142
2194
|
|
|
2143
|
-
var vres = osapi.verifyUserToken(
|
|
2195
|
+
var vres = osapi.verifyUserToken(user_name, tenant_name, token, token_seed);
|
|
2144
2196
|
if(!vres.result){
|
|
2145
2197
|
r3logger.elog('failed to verify token(' + token + ') with seed by ' + vres.message);
|
|
2146
2198
|
return null;
|
|
2147
2199
|
}
|
|
2148
2200
|
}
|
|
2149
2201
|
|
|
2150
|
-
/* eslint-disable indent, no-mixed-spaces-and-tabs */
|
|
2151
2202
|
var result = {
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2203
|
+
user: user_name,
|
|
2204
|
+
tenant: tenant_name,
|
|
2205
|
+
display: tenant_display,
|
|
2206
|
+
id: tenant_id,
|
|
2207
|
+
description: tenant_desc,
|
|
2208
|
+
region: region
|
|
2209
|
+
};
|
|
2157
2210
|
|
|
2158
2211
|
return result;
|
|
2159
2212
|
}
|
|
@@ -2163,8 +2216,10 @@ function rawGetUserTenantByToken(token)
|
|
|
2163
2216
|
//---------------------------------------------------------
|
|
2164
2217
|
// result [
|
|
2165
2218
|
// {
|
|
2166
|
-
// name:
|
|
2167
|
-
// display:
|
|
2219
|
+
// name: "tenant name", => tenant name which is "key" in k2hdkc
|
|
2220
|
+
// display: "display tenant name" => display alias name for tenant
|
|
2221
|
+
// id: "tenant id" => tenant id string
|
|
2222
|
+
// description: "tenant description" => description for tenant
|
|
2168
2223
|
// },
|
|
2169
2224
|
// ...
|
|
2170
2225
|
// ]
|
|
@@ -2217,13 +2272,15 @@ function rawGetTenantListByUserWithDkc(dkcobj_permanent, user)
|
|
|
2217
2272
|
var tenant_list = new Array(0);
|
|
2218
2273
|
for(cnt = 0; cnt < name_list.length; ++cnt){
|
|
2219
2274
|
var tenant_keys = r3keys(user, name_list[cnt]);
|
|
2220
|
-
var
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2275
|
+
var tenant_display = apiutil.getSafeString(dkcobj_permanent.getValue(tenant_keys.TENANT_DISP_KEY, null, true, null));
|
|
2276
|
+
var tenant_id = apiutil.getSafeString(dkcobj_permanent.getValue(tenant_keys.TENANT_ID_KEY, null, true, null));
|
|
2277
|
+
var tenant_desc = apiutil.getSafeString(dkcobj_permanent.getValue(tenant_keys.TENANT_DESC_KEY, null, true, null));
|
|
2278
|
+
|
|
2224
2279
|
tenant_list.push({
|
|
2225
2280
|
name: name_list[cnt],
|
|
2226
|
-
display:
|
|
2281
|
+
display: tenant_display,
|
|
2282
|
+
id: tenant_id,
|
|
2283
|
+
description: tenant_desc
|
|
2227
2284
|
});
|
|
2228
2285
|
}
|
|
2229
2286
|
|
|
@@ -2232,8 +2289,10 @@ function rawGetTenantListByUserWithDkc(dkcobj_permanent, user)
|
|
|
2232
2289
|
|
|
2233
2290
|
// result [
|
|
2234
2291
|
// {
|
|
2235
|
-
// name:
|
|
2236
|
-
// display:
|
|
2292
|
+
// name: "tenant name", => tenant name which is "key" in k2hdkc
|
|
2293
|
+
// display: "display tenant name" => display alias name for tenant
|
|
2294
|
+
// id: "tenant id" => tenant id string
|
|
2295
|
+
// description: "tenant description" => description for tenant
|
|
2237
2296
|
// },
|
|
2238
2297
|
// ...
|
|
2239
2298
|
// ]
|
|
@@ -2328,6 +2387,31 @@ function rawInitializeTenantListByToken(unscopedtoken, username, userid, callbac
|
|
|
2328
2387
|
display: jsonres[cnt].display
|
|
2329
2388
|
});
|
|
2330
2389
|
}
|
|
2390
|
+
|
|
2391
|
+
// get and add local tenants
|
|
2392
|
+
var tmpresobj = k2hr3.listLocalTenant(_username, true);
|
|
2393
|
+
if(!apiutil.isSafeEntity(tmpresobj) || !apiutil.isSafeEntity(tmpresobj.result) || false === tmpresobj.result){
|
|
2394
|
+
if(apiutil.isSafeEntity(tmpresobj) && apiutil.isSafeString(tmpresobj.message)){
|
|
2395
|
+
r3logger.wlog('failed to get local tenant list by ' + tmpresobj.message);
|
|
2396
|
+
}else{
|
|
2397
|
+
r3logger.wlog('failed to get local tenant list.');
|
|
2398
|
+
}
|
|
2399
|
+
}else{
|
|
2400
|
+
if(!apiutil.isEmptyArray(tmpresobj.tenants)){
|
|
2401
|
+
for(var cnt2 = 0; cnt2 < tmpresobj.tenants.length; ++cnt2){
|
|
2402
|
+
var one_tenant = tmpresobj.tenants[cnt2];
|
|
2403
|
+
if(!apiutil.isSafeEntity(one_tenant)){
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
_name_list.push(one_tenant.name);
|
|
2407
|
+
_tenant_list.push({
|
|
2408
|
+
name: one_tenant.name,
|
|
2409
|
+
display: one_tenant.display
|
|
2410
|
+
});
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2331
2415
|
// check and remove old tenant for user
|
|
2332
2416
|
if(!k2hr3.removeComprehensionByNewTenants(_username, _name_list)){
|
|
2333
2417
|
r3logger.elog('failed to remove some tenant for user, but continue...');
|
|
@@ -2376,15 +2460,18 @@ function rawCheckTenantInTenantList(tenants, tenant)
|
|
|
2376
2460
|
//
|
|
2377
2461
|
// token is following:
|
|
2378
2462
|
// {
|
|
2379
|
-
// role:
|
|
2380
|
-
// user:
|
|
2381
|
-
// hostname:
|
|
2382
|
-
// ip:
|
|
2383
|
-
// port:
|
|
2384
|
-
// cuk:
|
|
2385
|
-
// extra:
|
|
2386
|
-
// tenant:
|
|
2387
|
-
//
|
|
2463
|
+
// role: role name
|
|
2464
|
+
// user: null or user name
|
|
2465
|
+
// hostname: null or host name
|
|
2466
|
+
// ip: null or host ip address
|
|
2467
|
+
// port: port number(if host is existed), 0 means any
|
|
2468
|
+
// cuk: cuk(allowed null)
|
|
2469
|
+
// extra: extra(allowed null)
|
|
2470
|
+
// tenant: tenant name
|
|
2471
|
+
// display: display alias name for tenant
|
|
2472
|
+
// id: tenant id string
|
|
2473
|
+
// description: description for tenant
|
|
2474
|
+
// scoped: role token is always scoped(true)
|
|
2388
2475
|
// }
|
|
2389
2476
|
|
|
2390
2477
|
function rawCheckToken(req, is_scoped, is_user)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "k2hr3-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@kubernetes/client-node": "^0.18.1",
|
|
6
6
|
"body-parser": "^1.20.2",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"chai": "^4.3.7",
|
|
32
32
|
"chai-http": "^4.4.0",
|
|
33
|
-
"eslint": "^8.
|
|
33
|
+
"eslint": "^8.44.0",
|
|
34
34
|
"mocha": "^10.2.0",
|
|
35
35
|
"nyc": "^15.1.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
|
-
"help": "echo 'command list:\n npm run start\n npm run start:prod\n npm run start:production\n npm run start:prod:dbg\n npm run start:prod:debug\n npm run start:prod:debug:break\n npm run start:prod:debug:nobreak\n npm run start:dev\n npm run start:develop\n npm run start:dev:dbg\n npm run start:dev:debug\n npm run start:dev:debug:break\n npm run start:dev: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'",
|
|
38
|
+
"help": "echo 'command list:\n npm run start\n npm run start:prod\n npm run start:production\n npm run start:prod:dbg\n npm run start:prod:debug\n npm run start:prod:debug:break\n npm run start:prod:debug:nobreak\n npm run start:dev\n npm run start:develop\n npm run start:dev:dbg\n npm run start:dev:debug\n npm run start:dev:debug:break\n npm run start:dev: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:tenant_postput\n npm run test:manual:apis:tenant_gethead\n npm run test:manual:apis:tenant_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'",
|
|
39
39
|
"start": "npm run start:production",
|
|
40
40
|
"start:prod": "npm run start:production",
|
|
41
41
|
"start:production": "bin/run.sh -bg --production && echo '' && echo 'Start on production - Success' && echo ''",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"test": "npm run test:cover",
|
|
71
71
|
"test:lint": "eslint lib/*.js app.js bin/www bin/watcher routes/*.js tests/*.js",
|
|
72
72
|
"test:cover": "echo 'Test with coverage' && nyc --reporter=lcov --reporter=text npm run test:auto:all",
|
|
73
|
-
"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'",
|
|
73
|
+
"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:tenant{: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'",
|
|
74
74
|
"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 ''",
|
|
75
75
|
"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 ''",
|
|
76
76
|
"test:auto:version": "echo 'Test Version' && tests/test.sh -t 8000 version && echo 'Succeed test' && echo ''",
|
|
@@ -85,6 +85,8 @@
|
|
|
85
85
|
"test:auto:policy:dbg": "echo 'Test Policy with debugging' && tests/test.sh -t 8000 -d dbg policy && echo 'Succeed test' && echo ''",
|
|
86
86
|
"test:auto:role": "echo 'Test Role' && tests/test.sh -t 8000 role && echo 'Succeed test' && echo ''",
|
|
87
87
|
"test:auto:role:dbg": "echo 'Test Role with debugging' && tests/test.sh -t 8000 -d dbg role && echo 'Succeed test' && echo ''",
|
|
88
|
+
"test:auto:tenant": "echo 'Test Tenant' && tests/test.sh -t 8000 tenant && echo 'Succeed test' && echo ''",
|
|
89
|
+
"test:auto:tenant:dbg": "echo 'Test Tenant with debugging' && tests/test.sh -t 8000 -d dbg tenant && echo 'Succeed test' && echo ''",
|
|
88
90
|
"test:auto:service": "echo 'Test Service' && tests/test.sh -t 8000 service && echo 'Succeed test' && echo ''",
|
|
89
91
|
"test:auto:service:dbg": "echo 'Test Service with debugging' && tests/test.sh -t 8000 -d dbg service && echo 'Succeed test' && echo ''",
|
|
90
92
|
"test:auto:acr": "echo 'Test ACR' && tests/test.sh -t 8000 acr && echo 'Succeed test' && echo ''",
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
"test:auto:watcher:dbg": "echo 'Test Watcher Process with debugging' && tests/test.sh -t 8000 -d dbg watcher && echo 'Succeed test' && echo ''",
|
|
98
100
|
"test:auto:templengine": "echo 'Test template engine' && tests/auto_template.sh && echo 'Succeed test' && echo ''",
|
|
99
101
|
"test:auto:templengine:async": "echo 'Test asynchronous template engine' && tests/auto_template.sh -a && echo 'Succeed test' && echo ''",
|
|
100
|
-
"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'",
|
|
102
|
+
"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:tenant_postput\n test:manual:apis:tenant_gethead\n test:manual:apis:tenant_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'",
|
|
101
103
|
"test:manual:apis:version_get": "tests/manual_test.sh version_get",
|
|
102
104
|
"test:manual:apis:usertoken_postput": "tests/manual_test.sh usertoken_postput",
|
|
103
105
|
"test:manual:apis:usertoken_gethead": "tests/manual_test.sh usertoken_gethead",
|
|
@@ -110,6 +112,9 @@
|
|
|
110
112
|
"test:manual:apis:role_postput": "tests/manual_test.sh role_postput",
|
|
111
113
|
"test:manual:apis:role_gethead": "tests/manual_test.sh role_gethead",
|
|
112
114
|
"test:manual:apis:role_delete": "tests/manual_test.sh role_delete",
|
|
115
|
+
"test:manual:apis:tenant_postput": "tests/manual_test.sh tenant_postput",
|
|
116
|
+
"test:manual:apis:tenant_gethead": "tests/manual_test.sh tenant_gethead",
|
|
117
|
+
"test:manual:apis:tenant_delete": "tests/manual_test.sh tenant_delete",
|
|
113
118
|
"test:manual:apis:service_postput": "tests/manual_test.sh service_postput",
|
|
114
119
|
"test:manual:apis:service_gethead": "tests/manual_test.sh service_gethead",
|
|
115
120
|
"test:manual:apis:service_delete": "tests/manual_test.sh service_delete",
|