cassproject 0.5.25 → 0.5.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/package.json +26 -24
- package/src/com/eduworks/ec/graph/EcFrameworkGraph.js +13 -13
- package/src/com/eduworks/ec/graph/EcFrameworkGraph.test.js +41 -19
- package/src/com/eduworks/schema/ebac/EbacContact.js +3 -3
- package/src/com/eduworks/schema/ebac/EbacContactGrant.js +3 -3
- package/src/com/eduworks/schema/ebac/EbacCredential.js +3 -3
- package/src/com/eduworks/schema/ebac/EbacCredentialCommit.js +3 -3
- package/src/com/eduworks/schema/ebac/EbacCredentials.js +3 -3
- package/src/com/eduworks/schema/ebac/EbacEncryptedSecret.js +3 -3
- package/src/org/cass/importer/ASNImport.js +43 -20
- package/src/org/cass/importer/CTDLASNCSVConceptImport.js +207 -207
- package/src/org/cass/importer/CTDLASNCSVImport.js +686 -353
- package/src/org/cass/importer/Importer.js +2 -2
- package/src/org/cass/profile/EcAssertion.js +1 -1
- package/src/org/cassproject/ebac/identity/EcIdentity.js +1 -1
- package/src/org/cassproject/ebac/identity/EcRekeyRequest.js +1 -0
- package/src/org/cassproject/ebac/repository/EcEncryptedValue.js +19 -9
- package/src/org/cassproject/ebac/repository/EcRepository.js +13 -6
- package/src/org/cassproject/ebac/repository/EcRepository.test.js +102 -50
- package/src/org/cassproject/general/repository/GeneralFile.js +1 -1
- package/src/org/cassproject/schema/cass/competency/Framework.js +5 -5
- package/src/org/cassproject/schema/cass/competency/Level.js +5 -5
- package/src/org/cassproject/schema/cass/competency/RollupRule.js +4 -4
- package/src/org/cassproject/schema/cass/profile/Assertion.js +6 -5
- package/src/org/cassproject/schema/general/EcRemoteLinkedData.js +1 -0
- package/src/org/json/ld/EcLinkedData.js +29 -26
- package/src/org/schema/EcPerson.js +19 -3
- package/src/org/w3/skos/Concept.js +2 -2
- package/src/org/w3/skos/ConceptScheme.js +2 -2
package/README.md
CHANGED
|
@@ -44,6 +44,12 @@ Development unit tests presume you have a CaSS Repository running on `localhost:
|
|
|
44
44
|
|
|
45
45
|
# Changelog
|
|
46
46
|
|
|
47
|
+
## 0.5.28
|
|
48
|
+
* Bug fixes and library updates.
|
|
49
|
+
|
|
50
|
+
## 0.5.26
|
|
51
|
+
* Revised method of SSO based decryption.
|
|
52
|
+
|
|
47
53
|
## 0.5.23
|
|
48
54
|
* Securing Proxy data structures and repository.
|
|
49
55
|
* Negative assertion handling in graphs was corrected.
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cassproject",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.29",
|
|
4
4
|
"description": "Competency and Skills Service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "npm run test05 && npm run test14 && npm run test13 && npm run test12",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
8
|
+
"testCassTest": "npm run testkill && docker run -d --name cass-test -p80:80 cass-test && wait-on http://localhost/api/ping && npm run testCypressEdge && npm run testCypress && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testkill",
|
|
9
|
+
"test05": "npm run testkill && docker run -d --name cass-test -p80:80 cassproject/cass:0.5.6 && wait-on http://localhost/api/ping && npm run testCypressEdge && npm run testCypress && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testkill",
|
|
10
|
+
"test14": "npm run testkill && docker run -d --name cass-test -p80:80 cassproject/cass:1.4.4 && wait-on http://localhost/api/ping && npm run testCypressEdge && npm run testCypress && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testkill",
|
|
11
|
+
"test13": "npm run testkill && docker run -d --name cass-test -p80:80 cassproject/cass:1.3.18 && wait-on http://localhost/api/ping && npm run testCypressEdge && npm run testCypress && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testkill",
|
|
12
|
+
"test12": "npm run testkill && docker run -d --name cass-test -p80:80 cassproject/cass:1.2.44 && wait-on http://localhost/api/ping && npm run testCypressEdge && npm run testCypress && npm run testNode16 && npm run testNode15 && npm run testNode14 && npm run testNode13 && npm run testNode12 && npm run testkill",
|
|
12
13
|
"testkill": "docker kill cass-test | exit 0 && docker rm cass-test | exit 0",
|
|
13
14
|
"testNode16": "docker kill npm-cass & docker rm -f npm-cass & docker build --progress plain -f docker/node16 -t npm-cass . & docker run --network=\"host\" --name npm-cass npm-cass",
|
|
14
15
|
"testNode15": "docker kill npm-cass & docker rm -f npm-cass & docker build --progress plain -f docker/node15 -t npm-cass . & docker run --network=\"host\" --name npm-cass npm-cass",
|
|
@@ -21,9 +22,10 @@
|
|
|
21
22
|
"autoindex": "nodemon index.js",
|
|
22
23
|
"mocha": "mocha -b src/**/*.test.js",
|
|
23
24
|
"automocha": "nodemon --exec \"npm run mocha\"",
|
|
25
|
+
"automocha:clientSideCertificates": "set CASS_LOOPBACK=https://localhost/api/&& nodemon --exec \"npm run mocha\"",
|
|
24
26
|
"lint": "eslint src -c .eslintrc.js --ext .js --fix",
|
|
25
|
-
"docs": "
|
|
26
|
-
"doclint": "
|
|
27
|
+
"docs": "yuidoc -c yuidoc.json -o docs -e .js src",
|
|
28
|
+
"doclint": "yuidoc --lint -c yuidoc.json -o docs -e .js src",
|
|
27
29
|
"browserify:cypress:open": "cypress open --config-file cypressBrowserify.json",
|
|
28
30
|
"webpack:cypress:open": "cypress open --config-file cypressWebpack.json",
|
|
29
31
|
"browserify:cypress": "cypress run --config-file cypressBrowserify.json --headless --browser chrome",
|
|
@@ -33,11 +35,11 @@
|
|
|
33
35
|
},
|
|
34
36
|
"contributors": [
|
|
35
37
|
{
|
|
36
|
-
"name": "Devlin Junker",
|
|
38
|
+
"name": "Devlin Junker (Retired)",
|
|
37
39
|
"email": "devlin.junker@eduworks.com"
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
|
-
"name": "Thomas Buskirk",
|
|
42
|
+
"name": "Thomas Buskirk (Departed)",
|
|
41
43
|
"email": "tom.buskirk@eduworks.com"
|
|
42
44
|
},
|
|
43
45
|
{
|
|
@@ -50,18 +52,16 @@
|
|
|
50
52
|
}
|
|
51
53
|
],
|
|
52
54
|
"dependencies": {
|
|
53
|
-
"axios": "^0.
|
|
54
|
-
"base64-arraybuffer": "^0.
|
|
55
|
+
"axios": "^0.24.0",
|
|
56
|
+
"base64-arraybuffer": "^1.0.1",
|
|
55
57
|
"forge": "^2.3.0",
|
|
56
|
-
"form-data": "^
|
|
57
|
-
"jsonld": "
|
|
58
|
-
"node-forge": "^
|
|
58
|
+
"form-data": "^4.0.0",
|
|
59
|
+
"jsonld": "^5.2.0",
|
|
60
|
+
"node-forge": "^1.2.1",
|
|
59
61
|
"papaparse": "^5.3.1",
|
|
60
62
|
"pem-jwk": "^2.0.0",
|
|
61
63
|
"promise-worker": "^2.0.1",
|
|
62
|
-
"web-worker": "^1.1.0"
|
|
63
|
-
"yuidoc-ember-cli-theme": "^1.0.4",
|
|
64
|
-
"yuidocjs": "^0.10.2"
|
|
64
|
+
"web-worker": "^1.1.0"
|
|
65
65
|
},
|
|
66
66
|
"files": [
|
|
67
67
|
"lib/",
|
|
@@ -85,17 +85,17 @@
|
|
|
85
85
|
},
|
|
86
86
|
"homepage": "https://github.com/cassproject/cass-npm#readme",
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@babel/core": "^7.
|
|
89
|
-
"@babel/preset-env": "^7.
|
|
88
|
+
"@babel/core": "^7.16.5",
|
|
89
|
+
"@babel/preset-env": "^7.16.5",
|
|
90
90
|
"@cypress/browserify-preprocessor": "^3.0.1",
|
|
91
|
-
"@cypress/webpack-preprocessor": "^5.
|
|
91
|
+
"@cypress/webpack-preprocessor": "^5.11.0",
|
|
92
92
|
"babel-eslint": "^10.1.0",
|
|
93
|
-
"babel-loader": "^8.2.
|
|
93
|
+
"babel-loader": "^8.2.3",
|
|
94
94
|
"babel-plugin-transform-remove-strict-mode": "^0.0.2",
|
|
95
95
|
"chai": "^4.3.4",
|
|
96
96
|
"convert-hrtime": "^5.0.0",
|
|
97
|
-
"cypress": "^
|
|
98
|
-
"eslint": "^
|
|
97
|
+
"cypress": "^9.2.0",
|
|
98
|
+
"eslint": "^8.5.0",
|
|
99
99
|
"mocha": "^9.1.2",
|
|
100
100
|
"node-polyfill-webpack-plugin": "^1.1.3",
|
|
101
101
|
"nodemon": "^2.0.7",
|
|
@@ -103,6 +103,8 @@
|
|
|
103
103
|
"tap": "^15.0.9",
|
|
104
104
|
"wait-on": "^6.0.0",
|
|
105
105
|
"webpack": "^5.39.1",
|
|
106
|
-
"webpack-cli": "^4.8.0"
|
|
106
|
+
"webpack-cli": "^4.8.0",
|
|
107
|
+
"yuidoc-ember-cli-theme": "^1.0.4",
|
|
108
|
+
"yuidocjs": "^0.10.2"
|
|
107
109
|
}
|
|
108
110
|
}
|
|
@@ -143,9 +143,9 @@ module.exports = class EcFrameworkGraph extends EcDirectedGraph {
|
|
|
143
143
|
assertion
|
|
144
144
|
);
|
|
145
145
|
await Promise.all(
|
|
146
|
-
this.getOutEdges(competency).map((alignment) =>
|
|
147
|
-
this.getCompetency(alignment.target).then((t) =>
|
|
148
|
-
this.processAssertionBooleanOutward(
|
|
146
|
+
await this.getOutEdges(competency).map(async (alignment) =>
|
|
147
|
+
await this.getCompetency(alignment.target).then(async (t) =>
|
|
148
|
+
await this.processAssertionBooleanOutward(
|
|
149
149
|
alignment,
|
|
150
150
|
t,
|
|
151
151
|
assertion,
|
|
@@ -154,11 +154,11 @@ module.exports = class EcFrameworkGraph extends EcDirectedGraph {
|
|
|
154
154
|
)
|
|
155
155
|
)
|
|
156
156
|
)
|
|
157
|
-
).then(() =>
|
|
158
|
-
Promise.all(
|
|
159
|
-
this.getInEdges(competency).map((alignment) =>
|
|
160
|
-
this.getCompetency(alignment.source).then((s) =>
|
|
161
|
-
this.processAssertionBooleanInward(
|
|
157
|
+
).then(async() =>
|
|
158
|
+
await Promise.all(
|
|
159
|
+
this.getInEdges(competency).map(async (alignment) =>
|
|
160
|
+
await this.getCompetency(alignment.source).then(async (s) =>
|
|
161
|
+
await this.processAssertionBooleanInward(
|
|
162
162
|
alignment,
|
|
163
163
|
s,
|
|
164
164
|
assertion,
|
|
@@ -187,11 +187,11 @@ module.exports = class EcFrameworkGraph extends EcDirectedGraph {
|
|
|
187
187
|
)
|
|
188
188
|
)
|
|
189
189
|
)
|
|
190
|
-
).then(() =>
|
|
191
|
-
Promise.all(
|
|
192
|
-
this.getOutEdges(competency).map((alignment) =>
|
|
193
|
-
this.getCompetency(alignment.target).then((s) =>
|
|
194
|
-
this.processAssertionBooleanInward(
|
|
190
|
+
).then(async () =>
|
|
191
|
+
await Promise.all(
|
|
192
|
+
this.getOutEdges(competency).map(async (alignment) =>
|
|
193
|
+
await this.getCompetency(alignment.target).then(async (s) =>
|
|
194
|
+
await this.processAssertionBooleanInward(
|
|
195
195
|
alignment,
|
|
196
196
|
s,
|
|
197
197
|
assertion,
|
|
@@ -11,6 +11,10 @@ const EcAlignment = require("../../../../org/cass/competency/EcAlignment.js");
|
|
|
11
11
|
const EcRsaOaepAsyncWorker = require("../crypto/EcRsaOaepAsyncWorker.js");
|
|
12
12
|
const EcIdentityManager = require("../../../../org/cassproject/ebac/identity/EcIdentityManager");
|
|
13
13
|
const EcAes = require("../crypto/EcAes.js");
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const https = require('https');
|
|
16
|
+
const EcCrypto = require("../../../../com/eduworks/ec/crypto/EcCrypto.js");
|
|
17
|
+
const EcEncryptedValue = require("../../../../org/cassproject/ebac/repository/EcEncryptedValue.js");
|
|
14
18
|
|
|
15
19
|
let hrtime = function() {
|
|
16
20
|
try {
|
|
@@ -44,20 +48,20 @@ var failure = function (p1) {
|
|
|
44
48
|
console.trace(p1);
|
|
45
49
|
assert.fail();
|
|
46
50
|
};
|
|
51
|
+
|
|
52
|
+
if (fs.readFileSync != null) {
|
|
53
|
+
https.globalAgent.options.key = fs.readFileSync('client.key');
|
|
54
|
+
https.globalAgent.options.cert = fs.readFileSync('client.crt');
|
|
55
|
+
https.globalAgent.options.ca = fs.readFileSync('ca.crt');
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
let repo = new EcRepository();
|
|
48
59
|
repo.selectedServer = process.env.CASS_LOOPBACK || "http://localhost/api/";
|
|
49
60
|
repo.selectedServerProxy = process.env.CASS_LOOPBACK_PROXY || null;
|
|
50
|
-
let newId1 = new EcIdentity();
|
|
51
|
-
newId1.ppk = EcPpk.fromPem(
|
|
52
|
-
"-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEAz4BiFucFE9bNcKfGD+e6aPRHl402YM4Z6nrurDRNlnwsWpsCoZasPLkjC314pVtHAI2duZo+esGKDloBsiLxASRJo3R2XiXVh2Y8U1RcHA5mWL4tMG5UY2d0libpNEHbHPNBmooVYpA2yhxN/vGibIk8x69uZWxJcFOxOg6zWG8EjF8UMgGnRCVSMTY3THhTlfZ0cGUzvrfb7OvHUgdCe285XkmYkj/V9P/m7hbWoOyJAJSTOm4/s6fIKpl72lblfN7bKaxTCsJp6/rQdmUeo+PIaa2lDOfo7dWbuTMcqkZ93kispNfYYhsEGUGlCsrrVWhlve8MenO4GdLsFP+HRwIDAQABAoIBAGaQpOuBIYde44lNxJ7UAdYi+Mg2aqyK81Btl0/TQo6hriLTAAfzPAt/z4y8ZkgFyCDD3zSAw2VWCPFzF+d/UfUohKWgyWlb9iHJLQRbbHQJwhkXV6raviesWXpmnVrROocizkie/FcNxac9OmhL8+cGJt7lHgJP9jTpiW6TGZ8ZzM8KBH2l80x9AWdvCjsICuPIZRjc706HtkKZzTROtq6Z/F4Gm0uWRnwAZrHTRpnh8qjtdBLYFrdDcUoFtzOM6UVRmocTfsNe4ntPpvwY2aGTWY7EmTj1kteMJ+fCQFIS+KjyMWQHsN8yQNfD5/j2uv6/BdSkO8uorGSJT6DwmTECgYEA8ydoQ4i58+A1udqA+fujM0Zn46++NTehFe75nqIt8rfQgoduBam3lE5IWj2U2tLQeWxQyr1ZJkLbITtrAI3PgfMnuFAii+cncwFo805Fss/nbKx8K49vBuCEAq3MRhLjWy3ZvIgUHj67jWvl50dbNqc7TUguxhS4BxGr/cPPkP0CgYEA2nbJPGzSKhHTETL37NWIUAdU9q/6NVRISRRXeRqZYwE1VPzs2sIUxA8zEDBHX7OtvCKzvZy1Lg5Unx1nh4nCEVkbW/8npLlRG2jOcZJF6NRfhzwLz3WMIrP6j9SmjJaB+1mnrTjfsg36tDEPDjjJLjJHCx9z/qRJh1v4bh4aPpMCgYACG31T2IOEEZVlnvcvM3ceoqWT25oSbAEBZ6jSLyWmzOEJwJK7idUFfAg0gAQiQWF9K+snVqzHIB02FIXA43nA7pKRjmA+RiqZXJHEShFgk1y2HGiXGA8mSBvcyhTTJqbBy4vvjl5eRLzrZNwBPSUVPC3PZajCHrvZk9WhxWivIQKBgQCzCu1MH2dy4R7ZlqsIJ8zKweeJMZpfQI7pjclO0FTrhh7+Yzd+5db9A/P2jYrBTVHSwaILgTYf49DIguHJfEZXz26TzB7iapqlWxTukVHISt1ryPNo+E58VoLAhChnSiaHJ+g7GESE+d4A9cAACNwgh0YgQIvhIyW70M1e+j7KDwKBgQDQSBLFDFmvvTP3sIRAr1+0OZWd1eRcwdhs0U9GwootoCoUP/1Y64pqukT6B9oIB/No9Nyn8kUX3/ZDtCslaGKEUGMJXQ4hc5J+lq0tSi9ZWBdhqOuMPEfUF3IxW+9yeILP4ppUBn1m5MVOWg5CvuuEeCmy4bhMaUErUlHZ78t5cA==-----END RSA PRIVATE KEY-----"
|
|
53
|
-
);
|
|
54
|
-
EcIdentityManager.default.ids = [];
|
|
55
|
-
EcIdentityManager.default.addIdentity(newId1);
|
|
56
61
|
async function newAssertion(competencyToAssert) {
|
|
57
62
|
var a = new EcAssertion();
|
|
58
63
|
a.generateId(repo.selectedServer);
|
|
59
64
|
a.addOwner(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
60
|
-
a.addReader(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
61
65
|
await a.setSubject(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
62
66
|
await a.setAgent(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
63
67
|
await a.setCompetency(competencyToAssert.shortId());
|
|
@@ -73,7 +77,6 @@ async function newFalseAssertion(competencyToAssert) {
|
|
|
73
77
|
a.generateId(repo.selectedServer);
|
|
74
78
|
a.addOwner(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
75
79
|
await a.setSubject(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
76
|
-
await a.addReader(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
77
80
|
await a.setAgent(EcIdentityManager.default.ids[0].ppk.toPk());
|
|
78
81
|
await a.setCompetency(competencyToAssert.shortId());
|
|
79
82
|
await a.setConfidence(1.0);
|
|
@@ -121,6 +124,22 @@ async function newFramework(frameworkName) {
|
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
describe("EcFrameworkGraph", () => {
|
|
127
|
+
it('init', async () => {
|
|
128
|
+
let newId1;
|
|
129
|
+
EcIdentityManager.default.clearIdentities();
|
|
130
|
+
await repo.init(process.env.CASS_LOOPBACK || "http://localhost/api/", null, null, console.log);
|
|
131
|
+
newId1 = null;
|
|
132
|
+
if (EcIdentityManager.default.ids.length > 0)
|
|
133
|
+
newId1 = EcIdentityManager.default.ids[0];
|
|
134
|
+
else {
|
|
135
|
+
newId1 = new EcIdentity();
|
|
136
|
+
newId1.ppk = EcPpk.fromPem(
|
|
137
|
+
"-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEAz4BiFucFE9bNcKfGD+e6aPRHl402YM4Z6nrurDRNlnwsWpsCoZasPLkjC314pVtHAI2duZo+esGKDloBsiLxASRJo3R2XiXVh2Y8U1RcHA5mWL4tMG5UY2d0libpNEHbHPNBmooVYpA2yhxN/vGibIk8x69uZWxJcFOxOg6zWG8EjF8UMgGnRCVSMTY3THhTlfZ0cGUzvrfb7OvHUgdCe285XkmYkj/V9P/m7hbWoOyJAJSTOm4/s6fIKpl72lblfN7bKaxTCsJp6/rQdmUeo+PIaa2lDOfo7dWbuTMcqkZ93kispNfYYhsEGUGlCsrrVWhlve8MenO4GdLsFP+HRwIDAQABAoIBAGaQpOuBIYde44lNxJ7UAdYi+Mg2aqyK81Btl0/TQo6hriLTAAfzPAt/z4y8ZkgFyCDD3zSAw2VWCPFzF+d/UfUohKWgyWlb9iHJLQRbbHQJwhkXV6raviesWXpmnVrROocizkie/FcNxac9OmhL8+cGJt7lHgJP9jTpiW6TGZ8ZzM8KBH2l80x9AWdvCjsICuPIZRjc706HtkKZzTROtq6Z/F4Gm0uWRnwAZrHTRpnh8qjtdBLYFrdDcUoFtzOM6UVRmocTfsNe4ntPpvwY2aGTWY7EmTj1kteMJ+fCQFIS+KjyMWQHsN8yQNfD5/j2uv6/BdSkO8uorGSJT6DwmTECgYEA8ydoQ4i58+A1udqA+fujM0Zn46++NTehFe75nqIt8rfQgoduBam3lE5IWj2U2tLQeWxQyr1ZJkLbITtrAI3PgfMnuFAii+cncwFo805Fss/nbKx8K49vBuCEAq3MRhLjWy3ZvIgUHj67jWvl50dbNqc7TUguxhS4BxGr/cPPkP0CgYEA2nbJPGzSKhHTETL37NWIUAdU9q/6NVRISRRXeRqZYwE1VPzs2sIUxA8zEDBHX7OtvCKzvZy1Lg5Unx1nh4nCEVkbW/8npLlRG2jOcZJF6NRfhzwLz3WMIrP6j9SmjJaB+1mnrTjfsg36tDEPDjjJLjJHCx9z/qRJh1v4bh4aPpMCgYACG31T2IOEEZVlnvcvM3ceoqWT25oSbAEBZ6jSLyWmzOEJwJK7idUFfAg0gAQiQWF9K+snVqzHIB02FIXA43nA7pKRjmA+RiqZXJHEShFgk1y2HGiXGA8mSBvcyhTTJqbBy4vvjl5eRLzrZNwBPSUVPC3PZajCHrvZk9WhxWivIQKBgQCzCu1MH2dy4R7ZlqsIJ8zKweeJMZpfQI7pjclO0FTrhh7+Yzd+5db9A/P2jYrBTVHSwaILgTYf49DIguHJfEZXz26TzB7iapqlWxTukVHISt1ryPNo+E58VoLAhChnSiaHJ+g7GESE+d4A9cAACNwgh0YgQIvhIyW70M1e+j7KDwKBgQDQSBLFDFmvvTP3sIRAr1+0OZWd1eRcwdhs0U9GwootoCoUP/1Y64pqukT6B9oIB/No9Nyn8kUX3/ZDtCslaGKEUGMJXQ4hc5J+lq0tSi9ZWBdhqOuMPEfUF3IxW+9yeILP4ppUBn1m5MVOWg5CvuuEeCmy4bhMaUErUlHZ78t5cA==-----END RSA PRIVATE KEY-----"
|
|
138
|
+
);
|
|
139
|
+
EcIdentityManager.default.ids = [];
|
|
140
|
+
EcIdentityManager.default.addIdentity(newId1);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
124
143
|
it('encryption then decryption', async () => {
|
|
125
144
|
var randomString = EcAes.newIv(256).substring(0, 190);
|
|
126
145
|
var ppk = EcPpk.fromPem(
|
|
@@ -166,7 +185,7 @@ describe("EcFrameworkGraph", () => {
|
|
|
166
185
|
await deleteById(a.shortId());
|
|
167
186
|
});
|
|
168
187
|
assert.deepEqual(result, [1]);
|
|
169
|
-
}).timeout(
|
|
188
|
+
}).timeout(15000);
|
|
170
189
|
it('basic false test', async () => {
|
|
171
190
|
var f = await newFramework("basic false framework");
|
|
172
191
|
var c = await newCompetency("Add");
|
|
@@ -181,7 +200,8 @@ describe("EcFrameworkGraph", () => {
|
|
|
181
200
|
() => {}
|
|
182
201
|
).then(async () => {
|
|
183
202
|
let assertions = [];
|
|
184
|
-
|
|
203
|
+
let assertion = await EcAssertion.get(a.shortId());
|
|
204
|
+
assertions.push(assertion);
|
|
185
205
|
let result = await fg.processAssertionsBoolean(
|
|
186
206
|
assertions,
|
|
187
207
|
() => {},
|
|
@@ -191,10 +211,12 @@ describe("EcFrameworkGraph", () => {
|
|
|
191
211
|
result.push(fg.getMetaStateCompetency(c)["negativeAssertion"]?.length);
|
|
192
212
|
return result;
|
|
193
213
|
}).catch((err) => {
|
|
214
|
+
console.trace(err);
|
|
194
215
|
assert.fail(err);
|
|
195
216
|
});
|
|
196
217
|
return result;
|
|
197
218
|
}).catch((err) => {
|
|
219
|
+
console.trace(err);
|
|
198
220
|
assert.fail(err);
|
|
199
221
|
}).finally(async () => {
|
|
200
222
|
await deleteById(f.shortId());
|
|
@@ -218,8 +240,8 @@ describe("EcFrameworkGraph", () => {
|
|
|
218
240
|
() => {}
|
|
219
241
|
).then(async () => {
|
|
220
242
|
let assertions = [];
|
|
221
|
-
assertions.push(a);
|
|
222
|
-
assertions.push(a2);
|
|
243
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
244
|
+
assertions.push(await EcAssertion.get(a2.shortId()));
|
|
223
245
|
let result = await fg.processAssertionsBoolean(
|
|
224
246
|
assertions,
|
|
225
247
|
() => {},
|
|
@@ -338,7 +360,7 @@ describe("EcFrameworkGraph", () => {
|
|
|
338
360
|
() => {}
|
|
339
361
|
).then(async () => {
|
|
340
362
|
let assertions = [];
|
|
341
|
-
assertions.push(a);
|
|
363
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
342
364
|
let result = await fg.processAssertionsBoolean(
|
|
343
365
|
assertions,
|
|
344
366
|
() => {},
|
|
@@ -382,8 +404,8 @@ describe("EcFrameworkGraph", () => {
|
|
|
382
404
|
() => {}
|
|
383
405
|
).then(async () => {
|
|
384
406
|
let assertions = [];
|
|
385
|
-
assertions.push(a);
|
|
386
|
-
assertions.push(a2);
|
|
407
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
408
|
+
assertions.push(await EcAssertion.get(a2.shortId()));
|
|
387
409
|
let result = await fg.processAssertionsBoolean(
|
|
388
410
|
assertions,
|
|
389
411
|
() => {},
|
|
@@ -611,7 +633,7 @@ describe("EcFrameworkGraph", () => {
|
|
|
611
633
|
() => {}
|
|
612
634
|
).then(async () => {
|
|
613
635
|
let assertions = [];
|
|
614
|
-
assertions.push(a);
|
|
636
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
615
637
|
let result = await fg.processAssertionsBoolean(
|
|
616
638
|
assertions,
|
|
617
639
|
() => {},
|
|
@@ -654,7 +676,7 @@ describe("EcFrameworkGraph", () => {
|
|
|
654
676
|
() => {}
|
|
655
677
|
).then(async () => {
|
|
656
678
|
let assertions = [];
|
|
657
|
-
assertions.push(a);
|
|
679
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
658
680
|
let result = await fg.processAssertionsBoolean(
|
|
659
681
|
assertions,
|
|
660
682
|
() => {},
|
|
@@ -697,7 +719,7 @@ describe("EcFrameworkGraph", () => {
|
|
|
697
719
|
() => {}
|
|
698
720
|
).then(async () => {
|
|
699
721
|
let assertions = [];
|
|
700
|
-
assertions.push(a);
|
|
722
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
701
723
|
let result = await fg.processAssertionsBoolean(
|
|
702
724
|
assertions,
|
|
703
725
|
() => {},
|
|
@@ -794,7 +816,7 @@ describe("EcFrameworkGraph", () => {
|
|
|
794
816
|
() => {}
|
|
795
817
|
).then(async () => {
|
|
796
818
|
let assertions = [];
|
|
797
|
-
assertions.push(a);
|
|
819
|
+
assertions.push(await EcAssertion.get(a.shortId()));
|
|
798
820
|
let result = await fg.processAssertionsBoolean(
|
|
799
821
|
assertions,
|
|
800
822
|
() => {},
|
|
@@ -59,16 +59,16 @@ module.exports = class EbacContact extends EcLinkedData {
|
|
|
59
59
|
source = null;
|
|
60
60
|
upgrade() {
|
|
61
61
|
super.upgrade();
|
|
62
|
-
if (EbacContact.TYPE_0_1
|
|
62
|
+
if (EbacContact.TYPE_0_1 == (this.type)) {
|
|
63
63
|
var me = this;
|
|
64
64
|
if (me["@context"] == null && me["@schema"] != null)
|
|
65
65
|
me["@context"] = me["@schema"];
|
|
66
66
|
this.setContextAndType(Ebac.context_0_2, EbacContact.TYPE_0_2);
|
|
67
67
|
}
|
|
68
|
-
if (EbacContact.TYPE_0_2
|
|
68
|
+
if (EbacContact.TYPE_0_2 == (this.getFullType())) {
|
|
69
69
|
this.setContextAndType(Ebac.context_0_3, EbacContact.TYPE_0_3);
|
|
70
70
|
}
|
|
71
|
-
if (EbacContact.TYPE_0_3
|
|
71
|
+
if (EbacContact.TYPE_0_3 == (this.getFullType())) {
|
|
72
72
|
this.setContextAndType(Ebac.context_0_4, EbacContact.TYPE_0_4);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -54,16 +54,16 @@ module.exports = class EbacContactGrant extends EcRemoteLinkedData {
|
|
|
54
54
|
responseSignature = null;
|
|
55
55
|
upgrade() {
|
|
56
56
|
super.upgrade();
|
|
57
|
-
if (EbacContactGrant.TYPE_0_1
|
|
57
|
+
if (EbacContactGrant.TYPE_0_1 == (this.type)) {
|
|
58
58
|
var me = this;
|
|
59
59
|
if (me["@context"] == null && me["@schema"] != null)
|
|
60
60
|
me["@context"] = me["@schema"];
|
|
61
61
|
this.setContextAndType(Ebac.context_0_2, EbacContactGrant.TYPE_0_2);
|
|
62
62
|
}
|
|
63
|
-
if (EbacContactGrant.TYPE_0_2
|
|
63
|
+
if (EbacContactGrant.TYPE_0_2 == (this.getFullType())) {
|
|
64
64
|
this.setContextAndType(Ebac.context_0_3, EbacContactGrant.TYPE_0_3);
|
|
65
65
|
}
|
|
66
|
-
if (EbacContactGrant.TYPE_0_3
|
|
66
|
+
if (EbacContactGrant.TYPE_0_3 == (this.getFullType())) {
|
|
67
67
|
this.setContextAndType(Ebac.context_0_4, EbacContactGrant.TYPE_0_4);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -48,16 +48,16 @@ module.exports = class EbacCredential extends EcLinkedData {
|
|
|
48
48
|
displayName = null;
|
|
49
49
|
upgrade() {
|
|
50
50
|
super.upgrade();
|
|
51
|
-
if (EbacCredential.TYPE_0_1
|
|
51
|
+
if (EbacCredential.TYPE_0_1 == (this.type)) {
|
|
52
52
|
var me = this;
|
|
53
53
|
if (me["@context"] == null && me["@schema"] != null)
|
|
54
54
|
me["@context"] = me["@schema"];
|
|
55
55
|
this.setContextAndType(Ebac.context_0_2, EbacCredential.TYPE_0_2);
|
|
56
56
|
}
|
|
57
|
-
if (EbacCredential.TYPE_0_2
|
|
57
|
+
if (EbacCredential.TYPE_0_2 == (this.getFullType())) {
|
|
58
58
|
this.setContextAndType(Ebac.context_0_3, EbacCredential.TYPE_0_3);
|
|
59
59
|
}
|
|
60
|
-
if (EbacCredential.TYPE_0_3
|
|
60
|
+
if (EbacCredential.TYPE_0_3 == (this.getFullType())) {
|
|
61
61
|
this.setContextAndType(Ebac.context_0_4, EbacCredential.TYPE_0_4);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -52,7 +52,7 @@ module.exports = class EbacCredentialCommit extends EcLinkedData {
|
|
|
52
52
|
credentials = null;
|
|
53
53
|
upgrade() {
|
|
54
54
|
super.upgrade();
|
|
55
|
-
if (EbacCredentialCommit.TYPE_0_1
|
|
55
|
+
if (EbacCredentialCommit.TYPE_0_1 == (this.type)) {
|
|
56
56
|
var me = this;
|
|
57
57
|
if (me["@context"] == null && me["@schema"] != null)
|
|
58
58
|
me["@context"] = me["@schema"];
|
|
@@ -61,13 +61,13 @@ module.exports = class EbacCredentialCommit extends EcLinkedData {
|
|
|
61
61
|
EbacCredentialCommit.TYPE_0_2
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
if (EbacCredentialCommit.TYPE_0_2
|
|
64
|
+
if (EbacCredentialCommit.TYPE_0_2 == (this.getFullType())) {
|
|
65
65
|
this.setContextAndType(
|
|
66
66
|
Ebac.context_0_3,
|
|
67
67
|
EbacCredentialCommit.TYPE_0_3
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
if (EbacCredentialCommit.TYPE_0_3
|
|
70
|
+
if (EbacCredentialCommit.TYPE_0_3 == (this.getFullType())) {
|
|
71
71
|
this.setContextAndType(
|
|
72
72
|
Ebac.context_0_4,
|
|
73
73
|
EbacCredentialCommit.TYPE_0_4
|
|
@@ -47,16 +47,16 @@ module.exports = class EbacCredentials extends EcLinkedData {
|
|
|
47
47
|
contacts = null;
|
|
48
48
|
upgrade() {
|
|
49
49
|
super.upgrade();
|
|
50
|
-
if (EbacCredentials.TYPE_0_1
|
|
50
|
+
if (EbacCredentials.TYPE_0_1 == (this.type)) {
|
|
51
51
|
var me = this;
|
|
52
52
|
if (me["@context"] == null && me["@schema"] != null)
|
|
53
53
|
me["@context"] = me["@schema"];
|
|
54
54
|
this.setContextAndType(Ebac.context_0_2, EbacCredentials.TYPE_0_2);
|
|
55
55
|
}
|
|
56
|
-
if (EbacCredentials.TYPE_0_2
|
|
56
|
+
if (EbacCredentials.TYPE_0_2 == (this.getFullType())) {
|
|
57
57
|
this.setContextAndType(Ebac.context_0_3, EbacCredentials.TYPE_0_3);
|
|
58
58
|
}
|
|
59
|
-
if (EbacCredentials.TYPE_0_3
|
|
59
|
+
if (EbacCredentials.TYPE_0_3 == (this.getFullType())) {
|
|
60
60
|
this.setContextAndType(Ebac.context_0_4, EbacCredentials.TYPE_0_4);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -86,7 +86,7 @@ module.exports = class EbacEncryptedSecret extends EcLinkedData {
|
|
|
86
86
|
}
|
|
87
87
|
upgrade() {
|
|
88
88
|
super.upgrade();
|
|
89
|
-
if (EbacEncryptedSecret.TYPE_0_1
|
|
89
|
+
if (EbacEncryptedSecret.TYPE_0_1 == this.type) {
|
|
90
90
|
var me = this;
|
|
91
91
|
if (me["@context"] == null && me["@schema"] != null)
|
|
92
92
|
me["@context"] = me["@schema"];
|
|
@@ -95,13 +95,13 @@ module.exports = class EbacEncryptedSecret extends EcLinkedData {
|
|
|
95
95
|
EbacEncryptedSecret.TYPE_0_2
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
if (EbacEncryptedSecret.TYPE_0_2
|
|
98
|
+
if (EbacEncryptedSecret.TYPE_0_2 == this.getFullType()) {
|
|
99
99
|
this.setContextAndType(
|
|
100
100
|
Ebac.context_0_3,
|
|
101
101
|
EbacEncryptedSecret.TYPE_0_3
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
-
if (EbacEncryptedSecret.TYPE_0_3
|
|
104
|
+
if (EbacEncryptedSecret.TYPE_0_3 == this.getFullType()) {
|
|
105
105
|
this.setContextAndType(
|
|
106
106
|
Ebac.context_0_4,
|
|
107
107
|
EbacEncryptedSecret.TYPE_0_4
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const EcRemoteLinkedData = require("../../cassproject/schema/general/EcRemoteLinkedData");
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Import methods to handle an ASN JSON file containing a framework,
|
|
3
5
|
* competencies and relationships, and store them in a CASS instance
|
|
@@ -53,7 +55,7 @@ module.exports = class ASNImport extends Importer {
|
|
|
53
55
|
if (children != null)
|
|
54
56
|
for (var j = 0; j < children.length; j++) {
|
|
55
57
|
ASNImport.relationCount++;
|
|
56
|
-
ASNImport.asnJsonPrime(obj, children[j]["value"]);
|
|
58
|
+
ASNImport.asnJsonPrime(obj, EcRemoteLinkedData.trimVersionFromUrl(children[j]["value"]));
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -98,7 +100,7 @@ module.exports = class ASNImport extends Importer {
|
|
|
98
100
|
for (var j = 0; j < children.length; j++) {
|
|
99
101
|
ASNImport.asnJsonPrime(
|
|
100
102
|
obj,
|
|
101
|
-
children[j]["value"]
|
|
103
|
+
EcRemoteLinkedData.trimVersionFromUrl(children[j]["value"])
|
|
102
104
|
);
|
|
103
105
|
}
|
|
104
106
|
}
|
|
@@ -141,6 +143,13 @@ module.exports = class ASNImport extends Importer {
|
|
|
141
143
|
ASNImport.jsonCompetencies = {};
|
|
142
144
|
ASNImport.jsonFramework = null;
|
|
143
145
|
ASNImport.frameworkUrl = "";
|
|
146
|
+
for (let each in jsonObj) {
|
|
147
|
+
if (each !== EcRemoteLinkedData.trimVersionFromUrl(each)) {
|
|
148
|
+
let trimmed = EcRemoteLinkedData.trimVersionFromUrl(each);
|
|
149
|
+
jsonObj[trimmed] = jsonObj[each];
|
|
150
|
+
delete jsonObj[each];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
144
153
|
ASNImport.lookThroughSource(jsonObj);
|
|
145
154
|
if (ASNImport.jsonFramework == null) {
|
|
146
155
|
failure("Could not find StandardDocument.");
|
|
@@ -178,9 +187,13 @@ module.exports = class ASNImport extends Importer {
|
|
|
178
187
|
success,
|
|
179
188
|
failure,
|
|
180
189
|
incremental,
|
|
181
|
-
repo
|
|
190
|
+
repo,
|
|
191
|
+
eim
|
|
182
192
|
) {
|
|
183
193
|
ASNImport.competencies = {};
|
|
194
|
+
if (eim === undefined || eim == null) {
|
|
195
|
+
eim = EcIdentityManager.default;
|
|
196
|
+
}
|
|
184
197
|
if (createFramework) {
|
|
185
198
|
ASNImport.importedFramework = new EcFramework();
|
|
186
199
|
ASNImport.importedFramework.competency = [];
|
|
@@ -205,7 +218,8 @@ module.exports = class ASNImport extends Importer {
|
|
|
205
218
|
owner,
|
|
206
219
|
success,
|
|
207
220
|
failure,
|
|
208
|
-
repo
|
|
221
|
+
repo,
|
|
222
|
+
eim
|
|
209
223
|
);
|
|
210
224
|
} else {
|
|
211
225
|
var compList = [];
|
|
@@ -217,12 +231,14 @@ module.exports = class ASNImport extends Importer {
|
|
|
217
231
|
},
|
|
218
232
|
failure,
|
|
219
233
|
incremental,
|
|
220
|
-
repo
|
|
234
|
+
repo,
|
|
235
|
+
eim
|
|
221
236
|
);
|
|
222
237
|
},
|
|
223
238
|
failure,
|
|
224
239
|
incremental,
|
|
225
|
-
repo
|
|
240
|
+
repo,
|
|
241
|
+
eim
|
|
226
242
|
);
|
|
227
243
|
}
|
|
228
244
|
/**
|
|
@@ -250,7 +266,8 @@ module.exports = class ASNImport extends Importer {
|
|
|
250
266
|
success,
|
|
251
267
|
failure,
|
|
252
268
|
incremental,
|
|
253
|
-
repo
|
|
269
|
+
repo,
|
|
270
|
+
eim
|
|
254
271
|
) {
|
|
255
272
|
ASNImport.savedCompetencies = 0;
|
|
256
273
|
for (var key in ASNImport.jsonCompetencies) {
|
|
@@ -284,7 +301,7 @@ module.exports = class ASNImport extends Importer {
|
|
|
284
301
|
if (ASNImport.importedFramework != null)
|
|
285
302
|
ASNImport.importedFramework.addCompetency(comp.shortId());
|
|
286
303
|
ASNImport.competencies[key] = comp;
|
|
287
|
-
ASNImport.saveCompetency(success, failure, incremental, comp, repo);
|
|
304
|
+
ASNImport.saveCompetency(success, failure, incremental, comp, repo, eim);
|
|
288
305
|
}
|
|
289
306
|
}
|
|
290
307
|
static saveCompetency(success, failure, incremental, comp, repo, eim) {
|
|
@@ -354,7 +371,8 @@ module.exports = class ASNImport extends Importer {
|
|
|
354
371
|
success,
|
|
355
372
|
failure,
|
|
356
373
|
incremental,
|
|
357
|
-
repo
|
|
374
|
+
repo,
|
|
375
|
+
eim
|
|
358
376
|
) {
|
|
359
377
|
ASNImport.savedRelations = 0;
|
|
360
378
|
if (ASNImport.relationCount == 0) {
|
|
@@ -363,11 +381,12 @@ module.exports = class ASNImport extends Importer {
|
|
|
363
381
|
var children = node["http://purl.org/gem/qualifiers/hasChild"];
|
|
364
382
|
if (children != null)
|
|
365
383
|
for (var j = 0; j < children.length; j++) {
|
|
384
|
+
let sourceId = EcRemoteLinkedData.trimVersionFromUrl(children[j]["value"]);
|
|
366
385
|
if (nodeId != null) {
|
|
367
386
|
var relation = new EcAlignment();
|
|
368
|
-
relation.target = ASNImport.competencies[nodeId].id;
|
|
387
|
+
relation.target = EcRemoteLinkedData.trimVersionFromUrl(ASNImport.competencies[nodeId].id);
|
|
369
388
|
relation.source =
|
|
370
|
-
ASNImport.competencies[
|
|
389
|
+
EcRemoteLinkedData.trimVersionFromUrl(ASNImport.competencies[sourceId].id);
|
|
371
390
|
relation.relationType = "narrows";
|
|
372
391
|
relation.name = "";
|
|
373
392
|
relation.description = "";
|
|
@@ -387,18 +406,20 @@ module.exports = class ASNImport extends Importer {
|
|
|
387
406
|
failure,
|
|
388
407
|
incremental,
|
|
389
408
|
relation,
|
|
390
|
-
repo
|
|
409
|
+
repo,
|
|
410
|
+
eim
|
|
391
411
|
);
|
|
392
412
|
}
|
|
393
413
|
ASNImport.createRelationships(
|
|
394
414
|
serverUrl,
|
|
395
415
|
owner,
|
|
396
|
-
ASNImport.jsonCompetencies[
|
|
397
|
-
|
|
416
|
+
ASNImport.jsonCompetencies[sourceId],
|
|
417
|
+
sourceId,
|
|
398
418
|
success,
|
|
399
419
|
failure,
|
|
400
420
|
incremental,
|
|
401
|
-
repo
|
|
421
|
+
repo,
|
|
422
|
+
eim
|
|
402
423
|
);
|
|
403
424
|
}
|
|
404
425
|
}
|
|
@@ -447,15 +468,17 @@ module.exports = class ASNImport extends Importer {
|
|
|
447
468
|
* @private
|
|
448
469
|
* @static
|
|
449
470
|
*/
|
|
450
|
-
static createFramework(serverUrl, owner, success, failure, repo) {
|
|
471
|
+
static createFramework(serverUrl, owner, success, failure, repo, eim) {
|
|
451
472
|
ASNImport.importedFramework.name =
|
|
452
473
|
ASNImport.jsonFramework["http://purl.org/dc/elements/1.1/title"][
|
|
453
474
|
"0"
|
|
454
475
|
]["value"];
|
|
455
|
-
ASNImport.
|
|
456
|
-
ASNImport.
|
|
457
|
-
"
|
|
458
|
-
|
|
476
|
+
if (ASNImport.jsonFramework["http://purl.org/dc/terms/description"]) {
|
|
477
|
+
ASNImport.importedFramework.description =
|
|
478
|
+
ASNImport.jsonFramework["http://purl.org/dc/terms/description"][
|
|
479
|
+
"0"
|
|
480
|
+
]["value"];
|
|
481
|
+
}
|
|
459
482
|
ASNImport.importedFramework.id = ASNImport.frameworkUrl;
|
|
460
483
|
if (ASNImport.importedFramework.id == null) {
|
|
461
484
|
if (repo == null || repo.selectedServer.indexOf(serverUrl) != -1)
|