cassproject 1.5.25 → 1.5.27
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/README.md
CHANGED
|
@@ -48,6 +48,10 @@ Development unit tests presume you have a CaSS Repository running on `localhost:
|
|
|
48
48
|
|
|
49
49
|
# Changelog
|
|
50
50
|
|
|
51
|
+
## 1.5.26
|
|
52
|
+
* CORS Origins and CORS requests are now sent with credentials to enable cross origin credentialing.
|
|
53
|
+
* Extra lines in CSV import are ignored.
|
|
54
|
+
|
|
51
55
|
## 1.5.25
|
|
52
56
|
* Repo init now fetches max length of posts. Multiput now uses multiple requests if the POST length is too long.
|
|
53
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cassproject",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.27",
|
|
4
4
|
"description": "Competency and Skills Service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"multitest": "concurrently --kill-others --kill-others-on-fail \"npm run test15\" \"npm run test14\" \"npm run test13\" \"npm run test12\"",
|
|
10
10
|
"testCassTest": "npm run testkill && docker run -d --name cass-test -p80:80 -e CASS_LOOPBACK cass-test && wait-on http://localhost/api/ping && npm run testNode18 && npm run testNode18Fips && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testCypressEdge && npm run testCypress && npm run testkill",
|
|
11
11
|
"testDevHttps": "npm run testkill && docker run -d --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 testNode16Https && npm run testNode15Https && npm run testNode14Https && npm run testNode13Https && npm run testNode12Https && npm run testCypressEdgeHttps && npm run testCypressHttps",
|
|
12
|
-
"test15Https": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.
|
|
13
|
-
"test15Https11": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.
|
|
14
|
-
"test15": "export CASS_LOOPBACK=http://localhost/api/|| set CASS_LOOPBACK=http://localhost/api/&& npm run testkill15 && docker run -d -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.
|
|
12
|
+
"test15Https": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true cassproject/cass:1.5.26 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode18HttpsFips\" \"npm run testNode18Https\" \"npm run testNode16Https\" && npm run testkill",
|
|
13
|
+
"test15Https11": "npm run testkill && docker run -d --name cass-test -p443:443 -e CASS_LOOPBACK -e HTTPS=true -e HTTP2=false cassproject/cass:1.5.26 && wait-on https://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypressHttps\" \"npm run testNode18HttpsFips\" \"npm run testNode18Https\" \"npm run testNode16Https\" && npm run testkill",
|
|
14
|
+
"test15": "export CASS_LOOPBACK=http://localhost/api/|| set CASS_LOOPBACK=http://localhost/api/&& npm run testkill15 && docker run -d -e CASS_LOOPBACK --name cass-test15 -p80:80 cassproject/cass:1.5.26 && wait-on http://localhost/api/ping && concurrently --kill-others-on-fail \"npm run testCypress\" \"npm run testNode18\" \"npm run testNode18Fips\" \"npm run testNode16\" && npm run testkill15",
|
|
15
15
|
"test14": "npm run testkill14 && docker run -d -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",
|
|
16
16
|
"test13": "npm run testkill13 && docker run -d -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",
|
|
17
17
|
"test12": "npm run testkill12 && docker run -d -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",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"http2-wrapper": "^2.2.0",
|
|
102
102
|
"jsonld": "^8.1.1",
|
|
103
103
|
"node-forge": "^1.3.1",
|
|
104
|
-
"papaparse": "^5.4.
|
|
104
|
+
"papaparse": "^5.4.1",
|
|
105
105
|
"pem-jwk": "^2.0.0",
|
|
106
106
|
"promise-worker": "^2.0.1",
|
|
107
107
|
"rdf-canonize": "^3.3.0",
|
|
@@ -129,24 +129,24 @@
|
|
|
129
129
|
},
|
|
130
130
|
"homepage": "https://github.com/cassproject/cass-npm#readme",
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@babel/core": "^7.21.
|
|
132
|
+
"@babel/core": "^7.21.3",
|
|
133
133
|
"@babel/preset-env": "^7.20.2",
|
|
134
134
|
"@cypress/browserify-preprocessor": "^3.0.2",
|
|
135
|
-
"@cypress/vite-dev-server": "^5.0.
|
|
135
|
+
"@cypress/vite-dev-server": "^5.0.5",
|
|
136
136
|
"@cypress/webpack-preprocessor": "^5.17.0",
|
|
137
137
|
"babel-eslint": "^10.1.0",
|
|
138
138
|
"babel-plugin-transform-remove-strict-mode": "^0.0.2",
|
|
139
139
|
"chai": "^4.3.7",
|
|
140
140
|
"concurrently": "^7.6.0",
|
|
141
141
|
"convert-hrtime": "^5.0.0",
|
|
142
|
-
"cypress": "^12.
|
|
143
|
-
"eslint": "^8.
|
|
142
|
+
"cypress": "^12.8.1",
|
|
143
|
+
"eslint": "^8.36.0",
|
|
144
144
|
"mocha": "^10.2.0",
|
|
145
145
|
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
146
|
-
"nodemon": "^2.0.
|
|
146
|
+
"nodemon": "^2.0.22",
|
|
147
147
|
"nyc": "^15.1.0",
|
|
148
148
|
"wait-on": "^7.0.1",
|
|
149
|
-
"webpack": "^5.
|
|
149
|
+
"webpack": "^5.76.3",
|
|
150
150
|
"webpack-cli": "^5.0.1"
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require("../../../../org/cassproject/general/AuditLogger.js");
|
|
2
2
|
|
|
3
3
|
global.axiosOptions = {};
|
|
4
|
+
global.corsOrigins = [];
|
|
4
5
|
let isNode = false;
|
|
5
6
|
if (typeof process === 'object') {
|
|
6
7
|
if (typeof process.versions === 'object') {
|
|
@@ -131,6 +132,13 @@ if (global.axios == null)
|
|
|
131
132
|
|
|
132
133
|
const { cassPromisify } = require("../promises/helpers");
|
|
133
134
|
|
|
135
|
+
getAxiosOptions = function(url) {
|
|
136
|
+
let newOptions = Object.assign({}, axiosOptions);
|
|
137
|
+
if (corsOrigins.findIndex((x) => url.startsWith(x)) > -1)
|
|
138
|
+
newOptions.withCredentials = true;
|
|
139
|
+
return newOptions;
|
|
140
|
+
}
|
|
141
|
+
|
|
134
142
|
/**
|
|
135
143
|
* Wrapper to handle all remote web service invocations.
|
|
136
144
|
*
|
|
@@ -257,8 +265,9 @@ module.exports = class EcRemote {
|
|
|
257
265
|
postHeaders["content-length"] = fd.getLengthSync();
|
|
258
266
|
if (headers !== undefined && headers != null)
|
|
259
267
|
for (let header in headers) postHeaders[header] = headers[header];
|
|
268
|
+
|
|
260
269
|
let p = axios.post(url, fd, {
|
|
261
|
-
...
|
|
270
|
+
...getAxiosOptions(url),
|
|
262
271
|
headers: postHeaders,
|
|
263
272
|
maxContentLength: Infinity,
|
|
264
273
|
maxBodyLength: Infinity
|
|
@@ -313,7 +322,7 @@ module.exports = class EcRemote {
|
|
|
313
322
|
let url = EcRemote.urlAppend(server, service);
|
|
314
323
|
url = EcRemote.upgradeHttpToHttps(url);
|
|
315
324
|
let p = axios
|
|
316
|
-
.get(url,
|
|
325
|
+
.get(url,getAxiosOptions(url))
|
|
317
326
|
.then((response) => {
|
|
318
327
|
global.auditLogger.report(global.auditLogger.LogCategory.NETWORK, global.auditLogger.Severity.INFO, "EcRemoteGetExpectString", response.request.socket ? response.request.socket.remoteAddress : '', url);
|
|
319
328
|
return response.data;
|
|
@@ -358,7 +367,7 @@ module.exports = class EcRemote {
|
|
|
358
367
|
url = EcRemote.upgradeHttpToHttps(url);
|
|
359
368
|
let p = axios
|
|
360
369
|
.delete(url, {
|
|
361
|
-
...
|
|
370
|
+
...getAxiosOptions(url),
|
|
362
371
|
headers: { signatureSheet: signatureSheet }
|
|
363
372
|
})
|
|
364
373
|
.then((response) => {
|
|
@@ -97,8 +97,12 @@ module.exports = class CTDLASNCSVImport {
|
|
|
97
97
|
let relationById = {};
|
|
98
98
|
for (let i = 0; i < tabularData.length; i++) {
|
|
99
99
|
let pretranslatedE = tabularData[i];
|
|
100
|
-
if
|
|
101
|
-
|
|
100
|
+
// Skip extra lines if found in file
|
|
101
|
+
if (!pretranslatedE || !pretranslatedE["@type"]) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (pretranslatedE["@type"].toLowerCase() &&
|
|
105
|
+
(pretranslatedE["@type"].toLowerCase().startsWith('sample') || pretranslatedE["@type"].toLowerCase().startsWith('instruction'))
|
|
102
106
|
) {
|
|
103
107
|
continue;
|
|
104
108
|
}
|
|
@@ -522,6 +526,10 @@ module.exports = class CTDLASNCSVImport {
|
|
|
522
526
|
let relationById = {};
|
|
523
527
|
for (let i = 0; i < tabularData.length; i++) {
|
|
524
528
|
let pretranslatedE = tabularData[i];
|
|
529
|
+
// Skip extra lines if found in file
|
|
530
|
+
if (!pretranslatedE || !pretranslatedE["@type"]) {
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
525
533
|
if (
|
|
526
534
|
pretranslatedE["@type"].toLowerCase().startsWith('sample') || pretranslatedE["@type"].toLowerCase().startsWith('instruction')
|
|
527
535
|
) {
|