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.
- package/ChangeLog +24 -0
- package/app.js +7 -4
- package/bin/run.sh +218 -172
- package/bin/watcher +7 -4
- package/bin/www +7 -4
- package/config/default.json +7 -4
- package/config/development.json +7 -4
- package/config/dummyuser.json +8 -5
- package/config/extdata-dummy.sh.templ +12 -9
- package/config/k2hr3-cloud-config.txt.templ +7 -4
- package/config/k2hr3-init-error.sh.templ +8 -5
- package/config/k2hr3-init.sh.templ +127 -207
- package/config/keystone_v2.json +7 -4
- package/config/keystone_v3.json +7 -4
- package/lib/basicipcheck.js +7 -4
- package/lib/cacerts.js +7 -4
- package/lib/dbglogging.js +7 -4
- package/lib/dummyuserapi.js +7 -4
- package/lib/ipwatch.js +7 -4
- package/lib/k2hr3acrutil.js +7 -5
- package/lib/k2hr3apiutil.js +7 -4
- package/lib/k2hr3cliutil.js +7 -4
- package/lib/k2hr3config.js +7 -4
- package/lib/k2hr3cryptutil.js +7 -4
- package/lib/k2hr3dkc.js +7 -4
- package/lib/k2hr3extdata.js +7 -4
- package/lib/k2hr3keys.js +7 -4
- package/lib/k2hr3resutil.js +7 -4
- package/lib/k2hr3template.js +7 -4
- package/lib/k2hr3tokens.js +7 -4
- package/lib/k2hr3userdata.js +8 -5
- package/lib/k8soidc.js +41 -16
- package/lib/openstackapiv2.js +7 -4
- package/lib/openstackapiv3.js +7 -4
- package/lib/openstackep.js +7 -4
- package/package.json +73 -72
- package/routes/acr.js +7 -4
- package/routes/debugVerify.js +7 -4
- package/routes/extdata.js +7 -4
- package/routes/list.js +7 -4
- package/routes/policy.js +7 -4
- package/routes/resource.js +7 -4
- package/routes/role.js +7 -4
- package/routes/service.js +7 -4
- package/routes/userTokens.js +7 -4
- package/routes/userdata.js +7 -4
- package/routes/version.js +7 -4
- package/templ/Dockerfile.templ +35 -52
- package/{test → tests}/auto_acr.js +7 -4
- package/{test → tests}/auto_acr_spec.js +7 -4
- package/{test → tests}/auto_all_spec.js +7 -4
- package/{test → tests}/auto_common.js +7 -4
- package/tests/auto_control_subprocess.sh +239 -0
- package/{test → tests}/auto_extdata.js +7 -4
- package/{test → tests}/auto_extdata_spec.js +7 -4
- package/tests/auto_init_config_json.sh +275 -0
- package/{test → tests}/auto_k2hdkc_server.ini +7 -4
- package/{test → tests}/auto_k2hdkc_slave.ini +7 -4
- package/{test → tests}/auto_list.js +7 -4
- package/{test → tests}/auto_list_spec.js +7 -4
- package/{test → tests}/auto_policy.js +7 -4
- package/{test → tests}/auto_policy_spec.js +7 -4
- package/{test → tests}/auto_resource.js +7 -4
- package/{test → tests}/auto_resource_spec.js +7 -4
- package/{test → tests}/auto_role.js +7 -4
- package/{test → tests}/auto_role_spec.js +7 -4
- package/{test → tests}/auto_service.js +7 -4
- package/{test → tests}/auto_service_spec.js +7 -4
- package/{test → tests}/auto_subprocesses.js +14 -11
- package/tests/auto_template.sh +126 -0
- package/{test → tests}/auto_token_util.js +7 -4
- package/{test → tests}/auto_userdata.js +7 -4
- package/{test → tests}/auto_userdata_spec.js +7 -4
- package/{test → tests}/auto_usertokens.js +7 -4
- package/{test → tests}/auto_usertokens_spec.js +7 -4
- package/{test → tests}/auto_version.js +7 -4
- package/{test → tests}/auto_version_spec.js +7 -4
- package/{test → tests}/auto_watcher.js +7 -4
- package/{test → tests}/auto_watcher_spec.js +7 -4
- package/{test → tests}/k2hdkc_test.data +7 -4
- package/tests/k2hdkc_test_load.sh +255 -0
- package/{test → tests}/k2hr3template_test.js +7 -4
- package/tests/k2hr3template_test.sh +339 -0
- package/{test → tests}/k2hr3template_test_async.js +7 -4
- package/{test → tests}/k2hr3template_test_template.result +14 -8
- package/{test → tests}/k2hr3template_test_template.txt +7 -4
- package/{test → tests}/k2hr3template_test_vars.js +7 -4
- package/{test → tests}/manual_acr_delete.js +7 -4
- package/{test → tests}/manual_acr_get.js +7 -4
- package/{test → tests}/manual_acr_postput.js +7 -4
- package/{test → tests}/manual_allusertenant_get.js +7 -4
- package/{test → tests}/manual_extdata_get.js +7 -4
- package/{test → tests}/manual_k2hr3keys_get.js +7 -4
- package/{test → tests}/manual_list_gethead.js +7 -4
- package/{test → tests}/manual_policy_delete.js +7 -4
- package/{test → tests}/manual_policy_gethead.js +7 -4
- package/{test → tests}/manual_policy_postput.js +7 -4
- package/{test → tests}/manual_resource_delete.js +7 -4
- package/{test → tests}/manual_resource_gethead.js +7 -4
- package/{test → tests}/manual_resource_postput.js +7 -4
- package/{test → tests}/manual_role_delete.js +7 -4
- package/{test → tests}/manual_role_gethead.js +7 -4
- package/{test → tests}/manual_role_postput.js +7 -4
- package/{test → tests}/manual_service_delete.js +7 -4
- package/{test → tests}/manual_service_gethead.js +7 -4
- package/{test → tests}/manual_service_postput.js +7 -4
- package/tests/manual_test.sh +338 -0
- package/{test → tests}/manual_userdata_get.js +7 -4
- package/{test → tests}/manual_usertoken_gethead.js +7 -4
- package/{test → tests}/manual_usertoken_postput.js +7 -4
- package/{test → tests}/manual_version_get.js +7 -4
- package/tests/run_local_test_k2hdkc.sh +174 -0
- package/tests/test.sh +331 -0
- package/test/auto_control_subprocess.sh +0 -170
- package/test/auto_init_config_json.sh +0 -246
- package/test/auto_template.sh +0 -127
- package/test/auto_test.sh +0 -321
- package/test/k2hdkc_test_load.sh +0 -198
- package/test/k2hr3template_test.sh +0 -296
- package/test/manual_test.sh +0 -321
- package/test/run_local_test_k2hdkc.sh +0 -154
package/config/keystone_v2.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Local variables:
|
|
38
|
+
* tab-width: 4
|
|
39
|
+
* c-basic-offset: 4
|
|
40
|
+
* End:
|
|
41
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
42
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
40
43
|
*/
|
package/config/keystone_v3.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Local variables:
|
|
38
|
+
* tab-width: 4
|
|
39
|
+
* c-basic-offset: 4
|
|
40
|
+
* End:
|
|
41
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
42
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
40
43
|
*/
|
package/lib/basicipcheck.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -367,7 +367,10 @@ exports.checkAddressesAlive = function(ipdatas, chkipconfig)
|
|
|
367
367
|
};
|
|
368
368
|
|
|
369
369
|
/*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
370
|
+
* Local variables:
|
|
371
|
+
* tab-width: 4
|
|
372
|
+
* c-basic-offset: 4
|
|
373
|
+
* End:
|
|
374
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
375
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
373
376
|
*/
|
package/lib/cacerts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -61,7 +61,10 @@ function loadCACert()
|
|
|
61
61
|
exports.ca = loadCACert();
|
|
62
62
|
|
|
63
63
|
/*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* Local variables:
|
|
65
|
+
* tab-width: 4
|
|
66
|
+
* c-basic-offset: 4
|
|
67
|
+
* End:
|
|
68
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
69
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
67
70
|
*/
|
package/lib/dbglogging.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -142,7 +142,10 @@ exports.dump = function(obj)
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
/*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
145
|
+
* Local variables:
|
|
146
|
+
* tab-width: 4
|
|
147
|
+
* c-basic-offset: 4
|
|
148
|
+
* End:
|
|
149
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
150
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
148
151
|
*/
|
package/lib/dummyuserapi.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -757,7 +757,10 @@ exports.getUserTenantList = function(unscopedtoken, userid, callback)
|
|
|
757
757
|
};
|
|
758
758
|
|
|
759
759
|
/*
|
|
760
|
-
*
|
|
761
|
-
*
|
|
762
|
-
*
|
|
760
|
+
* Local variables:
|
|
761
|
+
* tab-width: 4
|
|
762
|
+
* c-basic-offset: 4
|
|
763
|
+
* End:
|
|
764
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
765
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
763
766
|
*/
|
package/lib/ipwatch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -370,7 +370,10 @@ exports.watchAddressesAlive = function(oneshotCB)
|
|
|
370
370
|
};
|
|
371
371
|
|
|
372
372
|
/*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
373
|
+
* Local variables:
|
|
374
|
+
* tab-width: 4
|
|
375
|
+
* c-basic-offset: 4
|
|
376
|
+
* End:
|
|
377
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
378
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
376
379
|
*/
|
package/lib/k2hr3acrutil.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -508,9 +508,11 @@ exports.getACRSendVerify = function(token, user, passwd, tenant, verifyurl, call
|
|
|
508
508
|
return rawACRSendVerify(token, user, passwd, tenant, verifyurl, callback);
|
|
509
509
|
};
|
|
510
510
|
|
|
511
|
-
|
|
512
511
|
/*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
512
|
+
* Local variables:
|
|
513
|
+
* tab-width: 4
|
|
514
|
+
* c-basic-offset: 4
|
|
515
|
+
* End:
|
|
516
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
517
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
516
518
|
*/
|
package/lib/k2hr3apiutil.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -1485,7 +1485,10 @@ exports.checkMakeDir = function(path)
|
|
|
1485
1485
|
};
|
|
1486
1486
|
|
|
1487
1487
|
/*
|
|
1488
|
-
*
|
|
1489
|
-
*
|
|
1490
|
-
*
|
|
1488
|
+
* Local variables:
|
|
1489
|
+
* tab-width: 4
|
|
1490
|
+
* c-basic-offset: 4
|
|
1491
|
+
* End:
|
|
1492
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
1493
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
1491
1494
|
*/
|
package/lib/k2hr3cliutil.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -182,7 +182,10 @@ exports.inputObjectData = function(is_string, callback)
|
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
/*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
185
|
+
* Local variables:
|
|
186
|
+
* tab-width: 4
|
|
187
|
+
* c-basic-offset: 4
|
|
188
|
+
* End:
|
|
189
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
190
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
188
191
|
*/
|
package/lib/k2hr3config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -805,7 +805,10 @@ exports.chkipType = chkipconfigType;
|
|
|
805
805
|
exports.r3ApiConfig = R3ApiConfig;
|
|
806
806
|
|
|
807
807
|
/*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
808
|
+
* Local variables:
|
|
809
|
+
* tab-width: 4
|
|
810
|
+
* c-basic-offset: 4
|
|
811
|
+
* End:
|
|
812
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
813
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
811
814
|
*/
|
package/lib/k2hr3cryptutil.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2018 Yahoo
|
|
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.
|
|
@@ -243,7 +243,10 @@ exports.r3Gunzip = function(bin, callback)
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
/*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
246
|
+
* Local variables:
|
|
247
|
+
* tab-width: 4
|
|
248
|
+
* c-basic-offset: 4
|
|
249
|
+
* End:
|
|
250
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
251
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
249
252
|
*/
|
package/lib/k2hr3dkc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -11565,7 +11565,10 @@ exports.getAllUsers = function()
|
|
|
11565
11565
|
};
|
|
11566
11566
|
|
|
11567
11567
|
/*
|
|
11568
|
-
*
|
|
11569
|
-
*
|
|
11570
|
-
*
|
|
11568
|
+
* Local variables:
|
|
11569
|
+
* tab-width: 4
|
|
11570
|
+
* c-basic-offset: 4
|
|
11571
|
+
* End:
|
|
11572
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
11573
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
11571
11574
|
*/
|
package/lib/k2hr3extdata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2018 Yahoo
|
|
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.
|
|
@@ -189,7 +189,10 @@ var ExtdataProcess = (function()
|
|
|
189
189
|
exports.extdataProcess = ExtdataProcess;
|
|
190
190
|
|
|
191
191
|
/*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
192
|
+
* Local variables:
|
|
193
|
+
* tab-width: 4
|
|
194
|
+
* c-basic-offset: 4
|
|
195
|
+
* End:
|
|
196
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
197
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
195
198
|
*/
|
package/lib/k2hr3keys.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -224,7 +224,10 @@ exports.getK2hr3Keys = function(user, tenant, service)
|
|
|
224
224
|
};
|
|
225
225
|
|
|
226
226
|
/*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
227
|
+
* Local variables:
|
|
228
|
+
* tab-width: 4
|
|
229
|
+
* c-basic-offset: 4
|
|
230
|
+
* End:
|
|
231
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
232
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
230
233
|
*/
|
package/lib/k2hr3resutil.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -91,7 +91,10 @@ exports.errResponse = function(req, res, status, msgbody, strType)
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
/*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
94
|
+
* Local variables:
|
|
95
|
+
* tab-width: 4
|
|
96
|
+
* c-basic-offset: 4
|
|
97
|
+
* End:
|
|
98
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
99
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
97
100
|
*/
|
package/lib/k2hr3template.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -6914,7 +6914,10 @@ var K2hr3TemplateEngine = (function()
|
|
|
6914
6914
|
exports.r3template = K2hr3TemplateEngine;
|
|
6915
6915
|
|
|
6916
6916
|
/*
|
|
6917
|
-
*
|
|
6918
|
-
*
|
|
6919
|
-
*
|
|
6917
|
+
* Local variables:
|
|
6918
|
+
* tab-width: 4
|
|
6919
|
+
* c-basic-offset: 4
|
|
6920
|
+
* End:
|
|
6921
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
6922
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
6920
6923
|
*/
|
package/lib/k2hr3tokens.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -2703,7 +2703,10 @@ exports.checkToken = function(req, is_scoped, is_user)
|
|
|
2703
2703
|
};
|
|
2704
2704
|
|
|
2705
2705
|
/*
|
|
2706
|
-
*
|
|
2707
|
-
*
|
|
2708
|
-
*
|
|
2706
|
+
* Local variables:
|
|
2707
|
+
* tab-width: 4
|
|
2708
|
+
* c-basic-offset: 4
|
|
2709
|
+
* End:
|
|
2710
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
2711
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
2709
2712
|
*/
|
package/lib/k2hr3userdata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2018 Yahoo
|
|
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.
|
|
@@ -37,7 +37,7 @@ var EmptyScriptContents = [
|
|
|
37
37
|
'#',
|
|
38
38
|
'# K2HR3 Frontend Web Application',
|
|
39
39
|
'#',
|
|
40
|
-
'# Copyright(C) 2018 Yahoo
|
|
40
|
+
'# Copyright(C) 2018 Yahoo Japan Corporation.',
|
|
41
41
|
'#',
|
|
42
42
|
'# K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers',
|
|
43
43
|
'# common management information for the cloud.',
|
|
@@ -303,7 +303,10 @@ var UserdataProcess = (function()
|
|
|
303
303
|
exports.userdataProcess = UserdataProcess;
|
|
304
304
|
|
|
305
305
|
/*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
306
|
+
* Local variables:
|
|
307
|
+
* tab-width: 4
|
|
308
|
+
* c-basic-offset: 4
|
|
309
|
+
* End:
|
|
310
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
311
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
309
312
|
*/
|
package/lib/k8soidc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
//
|
|
38
38
|
// {
|
|
39
39
|
// 'k8soidc': {
|
|
40
|
-
// 'audience':
|
|
41
|
-
// 'issuer':
|
|
42
|
-
// 'usernamekey':
|
|
43
|
-
// 'k8sapi_url':
|
|
44
|
-
// 'k8s_ca_path':
|
|
45
|
-
// 'k8s_sa_token':
|
|
40
|
+
// 'audience': '<client id for open id connect>',
|
|
41
|
+
// 'issuer': '<issue url for open id connect>',
|
|
42
|
+
// 'usernamekey': '<user name key name in token>',
|
|
43
|
+
// 'k8sapi_url': '<kubernetes api url>',
|
|
44
|
+
// 'k8s_ca_path': '<CA cert file path for kubernetes api url>',
|
|
45
|
+
// 'k8s_sa_token': '<Service account token for kubernetes>'
|
|
46
|
+
// 'unscopedtoken_exp':'<Expire limit for unscoped Token created from oidc>'
|
|
46
47
|
// }
|
|
47
48
|
// }
|
|
48
49
|
//
|
|
@@ -75,6 +76,12 @@
|
|
|
75
76
|
// API. If you're running the K2HR3 API inside a Kubernetes pod,
|
|
76
77
|
// it's '/var/run/secrets/kubernetes.io/serviceaccount/token'.
|
|
77
78
|
// This key and value are required.
|
|
79
|
+
// [unscopedtoken_exp]
|
|
80
|
+
// Specifies the expiration date of the Unscoped token created by
|
|
81
|
+
// OIDC. This value is specified in seconds(s).
|
|
82
|
+
// If this value does not exist or is less than or equal to 0,
|
|
83
|
+
// the default value will be used. The default value is the same
|
|
84
|
+
// as the OIDC token expiration date.
|
|
78
85
|
//
|
|
79
86
|
//------------------------------------------------------------------------
|
|
80
87
|
|
|
@@ -115,6 +122,7 @@ var oidc_username = null;
|
|
|
115
122
|
var k8s_api_url = null;
|
|
116
123
|
var k8s_ca_cert = null;
|
|
117
124
|
var k2hr3_k8s_sa_token = null;
|
|
125
|
+
var unscopedtoken_exp = 0; // Expire limit for unscoped Token created from oidc(default is 0 means as same as oidc limit)
|
|
118
126
|
|
|
119
127
|
(function()
|
|
120
128
|
{
|
|
@@ -123,12 +131,17 @@ var k2hr3_k8s_sa_token = null;
|
|
|
123
131
|
oidc_config = apiConf.getOtherObject('k8soidc');
|
|
124
132
|
|
|
125
133
|
if(apiutil.isSafeEntity(oidc_config)){
|
|
126
|
-
oidc_audience
|
|
127
|
-
oidc_issuer
|
|
128
|
-
oidc_username
|
|
129
|
-
k8s_api_url
|
|
130
|
-
k8s_ca_cert
|
|
131
|
-
k2hr3_k8s_sa_token
|
|
134
|
+
oidc_audience = oidc_config.audience;
|
|
135
|
+
oidc_issuer = oidc_config.issuer;
|
|
136
|
+
oidc_username = oidc_config.usernamekey;
|
|
137
|
+
k8s_api_url = oidc_config.k8sapi_url;
|
|
138
|
+
k8s_ca_cert = oidc_config.k8s_ca_path;
|
|
139
|
+
k2hr3_k8s_sa_token = fs.readFileSync(oidc_config.k8s_sa_token, 'utf8');
|
|
140
|
+
|
|
141
|
+
// unscopedtoken_exp must be number
|
|
142
|
+
if(apiutil.isSafeEntity(oidc_config.unscopedtoken_exp) && !isNaN(oidc_config.unscopedtoken_exp) && 0 < oidc_config.unscopedtoken_exp){
|
|
143
|
+
unscopedtoken_exp = oidc_config.unscopedtoken_exp;
|
|
144
|
+
}
|
|
132
145
|
}
|
|
133
146
|
}());
|
|
134
147
|
|
|
@@ -186,8 +199,12 @@ function rawCreateUserTokenByK8sUser(user, user_id, tenant, expire_limit)
|
|
|
186
199
|
if(!apiutil.isSafeString(tenant)){
|
|
187
200
|
tenant = null;
|
|
188
201
|
}
|
|
189
|
-
if(
|
|
190
|
-
expire_limit =
|
|
202
|
+
if(0 < unscopedtoken_exp){
|
|
203
|
+
expire_limit = unscopedtoken_exp; // override expire limit by config
|
|
204
|
+
}else{
|
|
205
|
+
if(!apiutil.isSafeEntity(expire_limit) || isNaN(expire_limit) || expire_limit <= 0){
|
|
206
|
+
expire_limit = 24 * 60 * 60; // default 24H
|
|
207
|
+
}
|
|
191
208
|
}
|
|
192
209
|
|
|
193
210
|
var dkcobj = k2hr3.getK2hdkc(true, false); // use permanent object(need to clean)
|
|
@@ -799,7 +816,15 @@ function rawGetUserUnscopedTokenK8s(token, callback)
|
|
|
799
816
|
|
|
800
817
|
// core seed
|
|
801
818
|
var user_id_uuid4 = apiutil.cvtNumberStringToUuid4(userid, 10); // payload.sub is decimal string
|
|
802
|
-
var expire_limit
|
|
819
|
+
var expire_limit;
|
|
820
|
+
if(apiutil.isSafeEntity(payload['exp']) && !isNaN(payload['exp'])){
|
|
821
|
+
expire_limit = payload['exp'] - apiutil.getUnixtime();
|
|
822
|
+
if(expire_limit <= 0){
|
|
823
|
+
expire_limit= 24 * 60 * 60; // default 24H
|
|
824
|
+
}
|
|
825
|
+
}else{
|
|
826
|
+
expire_limit = 24 * 60 * 60; // default 24H
|
|
827
|
+
}
|
|
803
828
|
|
|
804
829
|
// create token
|
|
805
830
|
var resobj = rawCreateUserTokenByK8sUser(lower_username, user_id_uuid4, null, expire_limit);
|
package/lib/openstackapiv2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -756,7 +756,10 @@ exports.getUserTenantList = function(unscopedtoken, userid, callback)
|
|
|
756
756
|
};
|
|
757
757
|
|
|
758
758
|
/*
|
|
759
|
-
*
|
|
760
|
-
*
|
|
761
|
-
*
|
|
759
|
+
* Local variables:
|
|
760
|
+
* tab-width: 4
|
|
761
|
+
* c-basic-offset: 4
|
|
762
|
+
* End:
|
|
763
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
764
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
762
765
|
*/
|
package/lib/openstackapiv3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -1023,7 +1023,10 @@ exports.getUserTenantList = function(unscopedtoken, userid, callback)
|
|
|
1023
1023
|
};
|
|
1024
1024
|
|
|
1025
1025
|
/*
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1026
|
+
* Local variables:
|
|
1027
|
+
* tab-width: 4
|
|
1028
|
+
* c-basic-offset: 4
|
|
1029
|
+
* End:
|
|
1030
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
1031
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
1029
1032
|
*/
|
package/lib/openstackep.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* K2HR3 REST API
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2017 Yahoo
|
|
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.
|
|
@@ -544,7 +544,10 @@ exports.getKeystoneEndpoint = function(callback, is_v3, is_test, timeout)
|
|
|
544
544
|
};
|
|
545
545
|
|
|
546
546
|
/*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
547
|
+
* Local variables:
|
|
548
|
+
* tab-width: 4
|
|
549
|
+
* c-basic-offset: 4
|
|
550
|
+
* End:
|
|
551
|
+
* vim600: noexpandtab sw=4 ts=4 fdm=marker
|
|
552
|
+
* vim<600: noexpandtab sw=4 ts=4
|
|
550
553
|
*/
|