cassproject 5.0.14 → 5.0.16
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/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cassproject",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.16",
|
|
4
4
|
"description": "Competency and Skills Service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "concurrently --maxProcesses=1 --kill-others-on-fail \"npm run test16HttpsFips\" \"npm run test16Https11Fips\" \"npm run test16Https\" \"npm run test16Https11\" \"npm run test16Fips\" \"npm run test16\" \"npm run test15HttpsFips\" \"npm run test15Https11Fips\" \"npm run test15Https\" \"npm run test15Https11\" \"npm run test15Fips\" \"npm run test15\"",
|
|
8
|
-
"testActionCypress": "npm run testkill && export CASS_LOOPBACK=http://cass-test15/api/|| set CASS_LOOPBACK=http://cass-test15/api/&& npm run testkill15 && docker run -d --
|
|
8
|
+
"testActionCypress": "npm run testkill && export CASS_LOOPBACK=http://cass-test15/api/|| set CASS_LOOPBACK=http://cass-test15/api/&& npm run testkill15 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.75 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\"",
|
|
9
9
|
"testCustom": "npm run test14 && npm run test13 && npm run test12",
|
|
10
10
|
"multitest": "concurrently --kill-others-on-fail \"npm run test15\" \"npm run test14\" \"npm run test13\" \"npm run test12\"",
|
|
11
|
-
"testCassTest": "npm run testkill && docker run -d --
|
|
12
|
-
"testDevHttps": "npm run testkill && docker run -d --
|
|
13
|
-
"test16HttpsFips": "export CASS_LOOPBACK=https://cass-testsf16/api/|| set CASS_LOOPBACK=https://cass-testsf16/api/&& npm run testkillsf16 && docker run -d --
|
|
14
|
-
"test16Https11Fips": "export CASS_LOOPBACK=https://cass-testsf1116/api/|| set CASS_LOOPBACK=https://cass-testsf1116/api/&& npm run testkillsf1116 && docker run -d --
|
|
15
|
-
"test16Https": "export CASS_LOOPBACK=https://cass-tests16/api/|| set CASS_LOOPBACK=https://cass-tests16/api/&& npm run testkills16 && docker run -d --
|
|
16
|
-
"test16HttpsNoFips": "export CASS_LOOPBACK=https://cass-tests16/api/|| set CASS_LOOPBACK=https://cass-tests16/api/&& npm run testkills16 && docker run -d --
|
|
17
|
-
"test16Https11": "export CASS_LOOPBACK=https://cass-tests1116/api/|| set CASS_LOOPBACK=https://cass-tests1116/api/&& npm run testkills1116 && docker run -d --
|
|
18
|
-
"test16Https11NoFips": "export CASS_LOOPBACK=https://cass-tests1116/api/|| set CASS_LOOPBACK=https://cass-tests1116/api/&& npm run testkills1116 && docker run -d --
|
|
19
|
-
"test16Fips": "export CASS_LOOPBACK=http://cass-testf16/api/|| set CASS_LOOPBACK=http://cass-testf16/api/&& npm run testkillf16 && docker run -d --
|
|
20
|
-
"test16": "export CASS_LOOPBACK=http://cass-test16/api/|| set CASS_LOOPBACK=http://cass-test16/api/&& npm run testkill16 && docker run -d --
|
|
21
|
-
"test16NoFips": "export CASS_LOOPBACK=http://cass-test16/api/|| set CASS_LOOPBACK=http://cass-test16/api/&& npm run testkill16 && docker run -d --
|
|
22
|
-
"test15HttpsFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-testsf15/api/|| set CASS_LOOPBACK=https://cass-testsf15/api/&& npm run testkillsf15 && docker run -d --
|
|
23
|
-
"test15Https11Fips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-testsf1115/api/|| set CASS_LOOPBACK=https://cass-testsf1115/api/&& npm run testkillsf1115 && docker run -d --
|
|
24
|
-
"test15Https": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests15/api/|| set CASS_LOOPBACK=https://cass-tests15/api/&& npm run testkills15 && docker run -d --
|
|
25
|
-
"test15HttpsNoFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests15/api/|| set CASS_LOOPBACK=https://cass-tests15/api/&& npm run testkills15 && docker run -d --
|
|
26
|
-
"test15Https11": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests1115/api/|| set CASS_LOOPBACK=https://cass-tests1115/api/&& npm run testkills1115 && docker run -d --
|
|
27
|
-
"test15Https11NoFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests1115/api/|| set CASS_LOOPBACK=https://cass-tests1115/api/&& npm run testkills1115 && docker run -d --
|
|
28
|
-
"test15Fips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=http://cass-testf15/api/|| set CASS_LOOPBACK=http://cass-testf15/api/&& npm run testkillf15 && docker run -d --
|
|
29
|
-
"test15NoFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=http://cass-test15/api/|| set CASS_LOOPBACK=http://cass-test15/api/&& npm run testkill15 && docker run -d --
|
|
30
|
-
"test15": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=http://cass-test15/api/|| set CASS_LOOPBACK=http://cass-test15/api/&& npm run testkill15 && docker run -d --
|
|
31
|
-
"test14": "npm run testkill14 && docker run -d --
|
|
32
|
-
"test13": "npm run testkill13 && docker run -d --
|
|
33
|
-
"test12": "npm run testkill12 && docker run -d --
|
|
11
|
+
"testCassTest": "npm run testkill && docker run -d --network cass-net --name cass-test -p80:80 -e CASS_LOOPBACK cass-test && wait-on http://localhost/api/ping && npm run testNode18 && npm run testNode18Fips && npm run testCypressEdge && npm run testCypress && npm run testkill",
|
|
12
|
+
"testDevHttps": "npm run testkill && docker run -d --network cass-net --name cass-test -p443:80 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:dev && wait-on https://localhost/api/ping && npm run testNode18HttpsFips && npm run testNode18Https && npm run testCypressEdgeHttps && npm run testCypressHttps",
|
|
13
|
+
"test16HttpsFips": "export CASS_LOOPBACK=https://cass-testsf16/api/|| set CASS_LOOPBACK=https://cass-testsf16/api/&& npm run testkillsf16 && docker run -d --network cass-net --name cass-testsf16 -p450:443 -e CASS_LOOPBACK -e HTTPS=true --pull always cassproject/cass:1.6 && wait-on https://localhost:450/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode24HttpsForceFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode22HttpsForceFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode20HttpsForceFips\" \"npm run testNode18Https\" && npm run testkillsf16",
|
|
14
|
+
"test16Https11Fips": "export CASS_LOOPBACK=https://cass-testsf1116/api/|| set CASS_LOOPBACK=https://cass-testsf1116/api/&& npm run testkillsf1116 && docker run -d --network cass-net --name cass-testsf1116 -p449:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.6 && wait-on https://localhost:449/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode24HttpsForceFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode22HttpsForceFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode20HttpsForceFips\" \"npm run testNode18Https\" && npm run testkillsf1116",
|
|
15
|
+
"test16Https": "export CASS_LOOPBACK=https://cass-tests16/api/|| set CASS_LOOPBACK=https://cass-tests16/api/&& npm run testkills16 && docker run -d --network cass-net --name cass-tests16 -p448:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.6 && wait-on https://localhost:448/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode18Https\" && npm run testkills16",
|
|
16
|
+
"test16HttpsNoFips": "export CASS_LOOPBACK=https://cass-tests16/api/|| set CASS_LOOPBACK=https://cass-tests16/api/&& npm run testkills16 && docker run -d --network cass-net --name cass-tests16 -p448:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.6 && wait-on https://localhost:448/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode22Https\" \"npm run testNode20Https\" \"npm run testNode18Https\" && npm run testkills16",
|
|
17
|
+
"test16Https11": "export CASS_LOOPBACK=https://cass-tests1116/api/|| set CASS_LOOPBACK=https://cass-tests1116/api/&& npm run testkills1116 && docker run -d --network cass-net --name cass-tests1116 -p451:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.6 && wait-on https://localhost:451/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode18Https\" && npm run testkills1116",
|
|
18
|
+
"test16Https11NoFips": "export CASS_LOOPBACK=https://cass-tests1116/api/|| set CASS_LOOPBACK=https://cass-tests1116/api/&& npm run testkills1116 && docker run -d --network cass-net --name cass-tests1116 -p451:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.6 && wait-on https://localhost:451/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode22Https\" \"npm run testNode20Https\" \"npm run testNode18Https\" && npm run testkills1116",
|
|
19
|
+
"test16Fips": "export CASS_LOOPBACK=http://cass-testf16/api/|| set CASS_LOOPBACK=http://cass-testf16/api/&& npm run testkillf16 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-testf16 -p83:80 cassproject/cass:1.6 && wait-on http://localhost:83/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode24\" \"npm run testNode24Fips\" \"npm run testNode24ForceFips\" \"npm run testNode22\" \"npm run testNode22Fips\" \"npm run testNode22ForceFips\" \"npm run testNode20\" \"npm run testNode20Fips\" \"npm run testNode20ForceFips\" \"npm run testNode18\" && npm run testkillf16",
|
|
20
|
+
"test16": "export CASS_LOOPBACK=http://cass-test16/api/|| set CASS_LOOPBACK=http://cass-test16/api/&& npm run testkill16 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test16 -p82:80 cassproject/cass:1.6 && wait-on http://localhost:82/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode24\" \"npm run testNode24Fips\" \"npm run testNode22\" \"npm run testNode22Fips\" \"npm run testNode20\" \"npm run testNode20Fips\" \"npm run testNode18\" && npm run testkill16",
|
|
21
|
+
"test16NoFips": "export CASS_LOOPBACK=http://cass-test16/api/|| set CASS_LOOPBACK=http://cass-test16/api/&& npm run testkill16 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test16 -p82:80 cassproject/cass:1.6 && wait-on http://localhost:82/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode24\" \"npm run testNode22\" \"npm run testNode20\" \"npm run testNode18\" && npm run testkill16",
|
|
22
|
+
"test15HttpsFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-testsf15/api/|| set CASS_LOOPBACK=https://cass-testsf15/api/&& npm run testkillsf15 && docker run -d --network cass-net --name cass-testsf15 -p446:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.75 && wait-on https://localhost:446/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode22HttpsForceFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode20HttpsForceFips\" \"npm run testNode18Https\" && npm run testkillsf15",
|
|
23
|
+
"test15Https11Fips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-testsf1115/api/|| set CASS_LOOPBACK=https://cass-testsf1115/api/&& npm run testkillsf1115 && docker run -d --network cass-net --name cass-testsf1115 -p447:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.75 && wait-on https://localhost:447/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode24HttpsForceFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode22HttpsForceFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode20HttpsForceFips\" \"npm run testNode18Https\" && npm run testkillsf1115",
|
|
24
|
+
"test15Https": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests15/api/|| set CASS_LOOPBACK=https://cass-tests15/api/&& npm run testkills15 && docker run -d --network cass-net --name cass-tests15 -p444:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.75 && wait-on https://localhost:444/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode18Https\" && npm run testkills15",
|
|
25
|
+
"test15HttpsNoFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests15/api/|| set CASS_LOOPBACK=https://cass-tests15/api/&& npm run testkills15 && docker run -d --network cass-net --name cass-tests15 -p444:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.75 && wait-on https://localhost:444/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode22Https\" \"npm run testNode20Https\" \"npm run testNode18Https\" && npm run testkills15",
|
|
26
|
+
"test15Https11": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests1115/api/|| set CASS_LOOPBACK=https://cass-tests1115/api/&& npm run testkills1115 && docker run -d --network cass-net --name cass-tests1115 -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.75 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode24HttpsFips\" \"npm run testNode22Https\" \"npm run testNode22HttpsFips\" \"npm run testNode20Https\" \"npm run testNode20HttpsFips\" \"npm run testNode18Https\" && npm run testkills1115",
|
|
27
|
+
"test15Https11NoFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=https://cass-tests1115/api/|| set CASS_LOOPBACK=https://cass-tests1115/api/&& npm run testkills1115 && docker run -d --network cass-net --name cass-tests1115 -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.75 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode24Https\" \"npm run testNode22Https\" \"npm run testNode20Https\" \"npm run testNode18Https\" && npm run testkills1115",
|
|
28
|
+
"test15Fips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=http://cass-testf15/api/|| set CASS_LOOPBACK=http://cass-testf15/api/&& npm run testkillf15 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-testf15 -p81:80 cassproject/cass:1.5.75 && wait-on http://localhost:81/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode24\" \"npm run testNode24Fips\" \"npm run testNode24ForceFips\" \"npm run testNode22\" \"npm run testNode22Fips\" \"npm run testNode22ForceFips\" \"npm run testNode20\" \"npm run testNode20Fips\" \"npm run testNode20ForceFips\" \"npm run testNode18\" && npm run testkillf15",
|
|
29
|
+
"test15NoFips": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=http://cass-test15/api/|| set CASS_LOOPBACK=http://cass-test15/api/&& npm run testkill15 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.75 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode24\" \"npm run testNode22\" \"npm run testNode20\" \"npm run testNode18\" && npm run testkill15",
|
|
30
|
+
"test15": "export TESTLEVEL=15|| set TESTLEVEL=15&& export CASS_LOOPBACK=http://cass-test15/api/|| set CASS_LOOPBACK=http://cass-test15/api/&& npm run testkill15 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.75 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode24\" \"npm run testNode24Fips\" \"npm run testNode22\" \"npm run testNode22Fips\" \"npm run testNode20\" \"npm run testNode20Fips\" \"npm run testNode18\" && npm run testkill15",
|
|
31
|
+
"test14": "npm run testkill14 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test14 -p80:80 cassproject/cass:1.4.4 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode16\" && npm run testkill14",
|
|
32
|
+
"test13": "npm run testkill13 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test13 -p80:80 cassproject/cass:1.3.18 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode16\" && npm run testkill13",
|
|
33
|
+
"test12": "npm run testkill12 && docker run -d --network cass-net -e CASS_LOOPBACK --name cass-test12 -p80:80 cassproject/cass:1.2.44 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode16\" && npm run testkill12",
|
|
34
34
|
"testkillsf16": "docker kill cass-testsf16 | exit 0 && docker rm cass-testsf16 | exit 0 && docker network create cass-net | exit 0",
|
|
35
35
|
"testkillsf1116": "(docker kill cass-testsf1116 | exit 0) && (docker rm cass-testsf1116 | exit 0) && docker network create cass-net | exit 0",
|
|
36
36
|
"testkills16": "docker kill cass-tests16 | exit 0 && docker rm cass-tests16 | exit 0 && docker network create cass-net | exit 0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"base64-arraybuffer": "^1.0.2",
|
|
144
144
|
"jsonld": "^9.0.0",
|
|
145
145
|
"node-forge": "^1.4.0",
|
|
146
|
-
"papaparse": "^5.5.
|
|
146
|
+
"papaparse": "^5.5.4",
|
|
147
147
|
"promise-worker": "^2.0.1",
|
|
148
148
|
"web-worker": "1.3.0"
|
|
149
149
|
},
|
|
@@ -169,20 +169,20 @@
|
|
|
169
169
|
},
|
|
170
170
|
"homepage": "https://github.com/cassproject/cass-npm#readme",
|
|
171
171
|
"devDependencies": {
|
|
172
|
-
"@cypress/webpack-preprocessor": "^7.
|
|
172
|
+
"@cypress/webpack-preprocessor": "^7.1.1",
|
|
173
173
|
"chai": "^4.5.0",
|
|
174
|
-
"concurrently": "^
|
|
175
|
-
"cypress": "^15.
|
|
174
|
+
"concurrently": "^10.0.3",
|
|
175
|
+
"cypress": "^15.18.0",
|
|
176
176
|
"cypress-fail-fast": "^8.1.0",
|
|
177
|
-
"eslint": "^10.
|
|
177
|
+
"eslint": "^10.5.0",
|
|
178
178
|
"fake-indexeddb": "^6.2.5",
|
|
179
|
-
"mocha": "^11.7.
|
|
179
|
+
"mocha": "^11.7.6",
|
|
180
180
|
"node-polyfill-webpack-plugin": "^4.1.0",
|
|
181
181
|
"nodemon": "^3.1.14",
|
|
182
182
|
"nyc": "^18.0.0",
|
|
183
183
|
"sinon": "^21.1.2",
|
|
184
|
-
"wait-on": "^9.0.
|
|
185
|
-
"webpack": "^5.
|
|
184
|
+
"wait-on": "^9.0.10",
|
|
185
|
+
"webpack": "^5.107.2"
|
|
186
186
|
},
|
|
187
187
|
"packageManager": "npm@11.3.0+sha512.96eb611483f49c55f7fa74df61b588de9e213f80a256728e6798ddc67176c7b07e4a1cfc7de8922422cbce02543714367037536955221fa451b0c4fefaf20c66"
|
|
188
188
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const { v4: uuidv4 } = require('uuid');
|
|
2
1
|
let forge = require("node-forge");
|
|
3
2
|
/**
|
|
4
3
|
* @author Fritz
|
|
@@ -71,9 +70,19 @@ module.exports = class EcCrypto {
|
|
|
71
70
|
return new TextEncoder("utf-8").encode(str).buffer;
|
|
72
71
|
}
|
|
73
72
|
static generateUUID()
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return
|
|
73
|
+
{
|
|
74
|
+
var d = new Date().getTime(); //Timestamp
|
|
75
|
+
var d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now() * 1000)) || 0;//Time in microseconds since page-load or 0 if unsupported
|
|
76
|
+
return 'xxxxxxxx-c455-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
77
|
+
var r = Math.random() * 16;//random number between 0 and 16
|
|
78
|
+
if (d > 0) {//Use timestamp until depleted
|
|
79
|
+
r = (d + r) % 16 | 0;
|
|
80
|
+
d = Math.floor(d / 16);
|
|
81
|
+
} else {//Use microseconds since page-load if supported
|
|
82
|
+
r = (d2 + r) % 16 | 0;
|
|
83
|
+
d2 = Math.floor(d2 / 16);
|
|
84
|
+
}
|
|
85
|
+
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
|
86
|
+
});
|
|
78
87
|
}
|
|
79
88
|
};
|
package/src/index/env.js
CHANGED
|
@@ -4,16 +4,19 @@ if (typeof window !== "undefined" && window) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
global.generateUUID = function () {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
var d = new Date().getTime(); //Timestamp
|
|
8
|
+
var d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now() * 1000)) || 0;//Time in microseconds since page-load or 0 if unsupported
|
|
9
|
+
return 'xxxxxxxx-c455-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
10
|
+
var r = Math.random() * 16;//random number between 0 and 16
|
|
11
|
+
if (d > 0) {//Use timestamp until depleted
|
|
12
|
+
r = (d + r) % 16 | 0;
|
|
13
|
+
d = Math.floor(d / 16);
|
|
14
|
+
} else {//Use microseconds since page-load if supported
|
|
15
|
+
r = (d2 + r) % 16 | 0;
|
|
16
|
+
d2 = Math.floor(d2 / 16);
|
|
17
|
+
}
|
|
18
|
+
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
|
15
19
|
});
|
|
16
|
-
return uuid;
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
try {
|
|
@@ -122,13 +122,12 @@ module.exports = class EcLevel extends Level {
|
|
|
122
122
|
repo, eim
|
|
123
123
|
) {
|
|
124
124
|
let a = new EcAlignment();
|
|
125
|
-
a.source = this.
|
|
126
|
-
a.target = targetLevel.
|
|
125
|
+
a.source = this.shortId();
|
|
126
|
+
a.target = targetLevel.shortId();
|
|
127
127
|
a.relationType = alignmentType;
|
|
128
128
|
a.addOwner(identity.toPk());
|
|
129
129
|
if (repo?.selectedServer != null)
|
|
130
130
|
a.generateId(repo.selectedServer);
|
|
131
|
-
await a.signWith(identity);
|
|
132
131
|
await a.save(success, failure, repo, eim);
|
|
133
132
|
return a;
|
|
134
133
|
}
|
|
@@ -146,7 +146,9 @@ module.exports = class EcRepository {
|
|
|
146
146
|
postMaxSize = null;
|
|
147
147
|
init(selectedServer, success, failure, loginObjectCallback) {
|
|
148
148
|
this.selectedServer = selectedServer;
|
|
149
|
-
return this.negotiateTimeOffset(success, failure, loginObjectCallback)
|
|
149
|
+
return this.negotiateTimeOffset(success, failure, loginObjectCallback).then(()=>{
|
|
150
|
+
return this.fetchServerAdminKeys()
|
|
151
|
+
});
|
|
150
152
|
}
|
|
151
153
|
negotiateTimeOffset = function (success, failure, loginObjectCallback) {
|
|
152
154
|
let oldTimeout = EcRemote.timeout;
|
|
@@ -781,16 +783,7 @@ module.exports = class EcRepository {
|
|
|
781
783
|
} else {
|
|
782
784
|
offset = repo.timeOffset;
|
|
783
785
|
}
|
|
784
|
-
|
|
785
|
-
p = eim.signatureSheetFor(
|
|
786
|
-
data.owner,
|
|
787
|
-
300000 + offset,
|
|
788
|
-
data.id,
|
|
789
|
-
null, null, repo != null ? repo.signatureSheetHashAlgorithm : null
|
|
790
|
-
);
|
|
791
|
-
} else {
|
|
792
|
-
p = eim.signatureSheet(300000 + offset, data.id, null, null, repo != null ? repo.signatureSheetHashAlgorithm : null);
|
|
793
|
-
}
|
|
786
|
+
p = eim.signatureSheet(300000 + offset, data.id, null, null, repo != null ? repo.signatureSheetHashAlgorithm : null);
|
|
794
787
|
p = p.then((signatureSheet) => {
|
|
795
788
|
let fd = new FormData();
|
|
796
789
|
fd.append("data", data.toJson());
|
|
@@ -895,23 +888,18 @@ module.exports = class EcRepository {
|
|
|
895
888
|
let targetUrl;
|
|
896
889
|
targetUrl = data.shortId();
|
|
897
890
|
let offset = this.setOffset(data.id);
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
);
|
|
911
|
-
});
|
|
912
|
-
} else {
|
|
913
|
-
return EcRemote._delete(targetUrl, [], success, failure);
|
|
914
|
-
}
|
|
891
|
+
return eim.signatureSheet(
|
|
892
|
+
300000 + offset,
|
|
893
|
+
data.id,
|
|
894
|
+
null, null, repo != null ? repo.signatureSheetHashAlgorithm : null
|
|
895
|
+
).then((signatureSheet) => {
|
|
896
|
+
return EcRemote._delete(
|
|
897
|
+
targetUrl,
|
|
898
|
+
signatureSheet,
|
|
899
|
+
success,
|
|
900
|
+
failure
|
|
901
|
+
);
|
|
902
|
+
});
|
|
915
903
|
};
|
|
916
904
|
/**
|
|
917
905
|
* Attempts to delete a piece of data.
|
|
@@ -965,23 +953,18 @@ module.exports = class EcRepository {
|
|
|
965
953
|
EcCrypto.md5(data.shortId())
|
|
966
954
|
);
|
|
967
955
|
let offset = EcRepository.setOffset(data.id);
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
);
|
|
981
|
-
});
|
|
982
|
-
} else {
|
|
983
|
-
return EcRemote._delete(targetUrl, [], success, failure);
|
|
984
|
-
}
|
|
956
|
+
return eim.signatureSheet(
|
|
957
|
+
300000 + offset,
|
|
958
|
+
data.id,
|
|
959
|
+
null, null, this != null ? this.signatureSheetHashAlgorithm : null
|
|
960
|
+
).then((signatureSheet) => {
|
|
961
|
+
return EcRemote._delete(
|
|
962
|
+
targetUrl,
|
|
963
|
+
signatureSheet,
|
|
964
|
+
success,
|
|
965
|
+
failure
|
|
966
|
+
);
|
|
967
|
+
});
|
|
985
968
|
};
|
|
986
969
|
/**
|
|
987
970
|
* Attempts to save many pieces of data. Does some checks before saving to
|
|
@@ -1001,7 +984,6 @@ module.exports = class EcRepository {
|
|
|
1001
984
|
multiput = function (data, success, failure, eim) {
|
|
1002
985
|
if (eim === undefined || eim == null)
|
|
1003
986
|
eim = EcIdentityManager.default;
|
|
1004
|
-
let allOwners = [];
|
|
1005
987
|
for (let d of data) {
|
|
1006
988
|
if (d.invalid())
|
|
1007
989
|
throw new Error("Cannot save data. It is missing a vital component.");
|
|
@@ -1034,9 +1016,6 @@ module.exports = class EcRepository {
|
|
|
1034
1016
|
)
|
|
1035
1017
|
];
|
|
1036
1018
|
}
|
|
1037
|
-
if (d.owner != null)
|
|
1038
|
-
for (let j = 0; j < d.owner.length; j++)
|
|
1039
|
-
EcArray.setAdd(allOwners, d.owner[j]);
|
|
1040
1019
|
}
|
|
1041
1020
|
let encryptionAndSigningPromises = data.map((d) => {
|
|
1042
1021
|
return cassReturnAsPromise(d)
|
|
@@ -1064,19 +1043,10 @@ module.exports = class EcRepository {
|
|
|
1064
1043
|
return Promise.all(encryptionAndSigningPromises)
|
|
1065
1044
|
.then((readyToSendData) => {
|
|
1066
1045
|
preparedData = readyToSendData;
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
this.selectedServer,
|
|
1072
|
-
null, null, this.signatureSheetHashAlgorithm
|
|
1073
|
-
);
|
|
1074
|
-
} else {
|
|
1075
|
-
return eim.signatureSheet(
|
|
1076
|
-
300000 + this.timeOffset,
|
|
1077
|
-
this.selectedServer, null, null, this.signatureSheetHashAlgorithm
|
|
1078
|
-
);
|
|
1079
|
-
}
|
|
1046
|
+
return eim.signatureSheet(
|
|
1047
|
+
300000 + this.timeOffset,
|
|
1048
|
+
this.selectedServer, null, null, this.signatureSheetHashAlgorithm
|
|
1049
|
+
);
|
|
1080
1050
|
})
|
|
1081
1051
|
.then((signatureSheet) => {
|
|
1082
1052
|
let fd = new FormData();
|
|
@@ -1950,7 +1920,7 @@ module.exports = class EcRepository {
|
|
|
1950
1920
|
service = "/sky/admin";
|
|
1951
1921
|
}
|
|
1952
1922
|
let me = this;
|
|
1953
|
-
EcRemote.getExpectingObject(
|
|
1923
|
+
return EcRemote.getExpectingObject(
|
|
1954
1924
|
this.selectedServer,
|
|
1955
1925
|
service,
|
|
1956
1926
|
function (p1) {
|
|
@@ -1959,10 +1929,16 @@ module.exports = class EcRepository {
|
|
|
1959
1929
|
for (let i = 0; i < ary.length; i++) {
|
|
1960
1930
|
me.adminKeys.push(ary[i]);
|
|
1961
1931
|
}
|
|
1962
|
-
success
|
|
1932
|
+
if (success != null)
|
|
1933
|
+
success(ary);
|
|
1934
|
+
else
|
|
1935
|
+
return ary;
|
|
1963
1936
|
},
|
|
1964
1937
|
function (p1) {
|
|
1965
|
-
failure
|
|
1938
|
+
if (failure != null)
|
|
1939
|
+
failure(p1);
|
|
1940
|
+
else
|
|
1941
|
+
throw new Error(p1);
|
|
1966
1942
|
}
|
|
1967
1943
|
);
|
|
1968
1944
|
};
|
|
@@ -1981,9 +1957,7 @@ module.exports = class EcRepository {
|
|
|
1981
1957
|
} else
|
|
1982
1958
|
return p1;
|
|
1983
1959
|
}
|
|
1984
|
-
p1 = await EcEncryptedValue.fromEncryptedValue(
|
|
1985
|
-
p1, null, null, eim
|
|
1986
|
-
);
|
|
1960
|
+
p1 = await EcEncryptedValue.fromEncryptedValue(p1, null, null, eim);
|
|
1987
1961
|
if (p1.isAny(result.getTypes())) {
|
|
1988
1962
|
result.copyFrom(p1, eim);
|
|
1989
1963
|
if (this.caching) {
|
|
@@ -9,128 +9,6 @@ const EcIdentityManager = require('../org/cassproject/ebac/identity/EcIdentityMa
|
|
|
9
9
|
const { expect } = chai;
|
|
10
10
|
|
|
11
11
|
describe('EcLevel', () => {
|
|
12
|
-
let sandbox;
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
sandbox = sinon.createSandbox();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
afterEach(() => {
|
|
19
|
-
sandbox.restore();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
describe('get', () => {
|
|
23
|
-
it('should retrieve a level by ID', (done) => {
|
|
24
|
-
const id = 'testId';
|
|
25
|
-
const success = sinon.spy();
|
|
26
|
-
const failure = sinon.spy();
|
|
27
|
-
const repo = {};
|
|
28
|
-
const eim = {};
|
|
29
|
-
|
|
30
|
-
sandbox.stub(EcRepository, 'getAs').callsFake((id, level, successCallback, failureCallback, repo, eim) => {
|
|
31
|
-
successCallback(level);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
EcLevel.get(id, success, failure, repo, eim);
|
|
35
|
-
|
|
36
|
-
expect(success.calledOnce).to.be.true;
|
|
37
|
-
expect(failure.called).to.be.false;
|
|
38
|
-
done();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('getBlocking', () => {
|
|
43
|
-
it('should retrieve a level by ID synchronously', () => {
|
|
44
|
-
const id = 'testId';
|
|
45
|
-
const repo = {};
|
|
46
|
-
const eim = {};
|
|
47
|
-
|
|
48
|
-
sandbox.stub(EcRepository, 'getAs').returns(new EcLevel());
|
|
49
|
-
|
|
50
|
-
const result = EcLevel.getBlocking(id, repo, eim);
|
|
51
|
-
|
|
52
|
-
expect(result).to.be.instanceOf(EcLevel);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe('search', () => {
|
|
57
|
-
it('should search for levels with a query', (done) => {
|
|
58
|
-
const repo = {};
|
|
59
|
-
const query = 'testQuery';
|
|
60
|
-
const success = sinon.spy();
|
|
61
|
-
const failure = sinon.spy();
|
|
62
|
-
const paramObj = {};
|
|
63
|
-
const eim = {};
|
|
64
|
-
|
|
65
|
-
sandbox.stub(EcRepository, 'searchAs').callsFake((repo, query, levelFactory, successCallback, failureCallback, paramObj, eim) => {
|
|
66
|
-
successCallback([new EcLevel()]);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
EcLevel.search(repo, query, success, failure, paramObj, eim);
|
|
70
|
-
|
|
71
|
-
expect(success.calledOnce).to.be.true;
|
|
72
|
-
expect(failure.called).to.be.false;
|
|
73
|
-
done();
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('searchByCompetency', () => {
|
|
78
|
-
it('should search for levels by competency ID', (done) => {
|
|
79
|
-
const repo = {};
|
|
80
|
-
const competencyId = 'testCompetencyId';
|
|
81
|
-
const success = sinon.spy();
|
|
82
|
-
const failure = sinon.spy();
|
|
83
|
-
const paramObj = {};
|
|
84
|
-
const eim = {};
|
|
85
|
-
|
|
86
|
-
sandbox.stub(EcLevel, 'search').callsFake((repo, query, successCallback, failureCallback, paramObj, eim) => {
|
|
87
|
-
successCallback([new EcLevel()]);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
EcLevel.searchByCompetency(repo, competencyId, success, failure, paramObj, eim);
|
|
91
|
-
|
|
92
|
-
expect(success.calledOnce).to.be.true;
|
|
93
|
-
expect(failure.called).to.be.false;
|
|
94
|
-
done();
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('should call failure callback if no competency ID is provided', () => {
|
|
98
|
-
const repo = {};
|
|
99
|
-
const competencyId = '';
|
|
100
|
-
const success = sinon.spy();
|
|
101
|
-
const failure = sinon.spy();
|
|
102
|
-
const paramObj = {};
|
|
103
|
-
const eim = {};
|
|
104
|
-
|
|
105
|
-
EcLevel.searchByCompetency(repo, competencyId, success, failure, paramObj, eim);
|
|
106
|
-
|
|
107
|
-
expect(failure.calledOnce).to.be.true;
|
|
108
|
-
expect(success.called).to.be.false;
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe('addRelationship', () => {
|
|
113
|
-
it('should add a relationship between levels', async () => {
|
|
114
|
-
const level = new EcLevel();
|
|
115
|
-
level.id = 'sourceId';
|
|
116
|
-
const targetLevel = new EcLevel();
|
|
117
|
-
targetLevel.id = 'targetId';
|
|
118
|
-
const alignmentType = 'testType';
|
|
119
|
-
const identity = EcPpk.generateKey();
|
|
120
|
-
const success = sinon.spy();
|
|
121
|
-
const failure = sinon.spy();
|
|
122
|
-
const repo = new EcRepository();
|
|
123
|
-
await repo.init(process.env.CASS_LOOPBACK || 'http://localhost/api/');
|
|
124
|
-
const eim = EcIdentityManager.default;
|
|
125
|
-
|
|
126
|
-
let a = await level.addRelationship(targetLevel, alignmentType, identity, success, failure, repo, eim);
|
|
127
|
-
|
|
128
|
-
expect(a.source).to.equal(level.id);
|
|
129
|
-
expect(a.target).to.equal(targetLevel.id);
|
|
130
|
-
expect(a.relationType).to.equal(alignmentType);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
|
|
134
12
|
describe('setName', () => {
|
|
135
13
|
it('should set the name of the level', () => {
|
|
136
14
|
const level = new EcLevel();
|