cassproject 5.0.8 → 5.0.10

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/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2017 Eduworks Corporation
189
+ Copyright 2017-2026 Eduworks Corporation
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -2,6 +2,16 @@ cass-npm
2
2
 
3
3
  CaSS NPM is the CaSS Library, published and available on NPM.
4
4
 
5
+ # Documentation
6
+
7
+ Documentation for the CaSS Library can be found in the [documentation](documentation/) folder:
8
+
9
+ * **[Architecture & Walkthrough](documentation/ARCHITECTURE.md)**: An overview of the library's architecture, core components, and common workflows.
10
+ * **[Coding Rules & Standards](documentation/RULES.md)**: Guidelines, conventions, and architectural rules for contributors.
11
+ * **[Requirements](documentation/REQUIREMENTS.md)**: Project requirements and scope.
12
+ * **[Design Patterns](documentation/DESIGN.md)**: Detailed design principles and patterns.
13
+
14
+
5
15
  # Getting Started as a user of the library
6
16
  We're assuming you're coming from the NPM / GitHub space. To see a developer guide, go to https://devs.cassproject.org/
7
17
 
@@ -21,7 +31,7 @@ Running `npm test` requires Docker.
21
31
 
22
32
  ## Release testing
23
33
 
24
- * `npm test` - Runs unit tests in docker images against the CaSS 1.5 repositories using Node versions 12-16 and Cypress against Edge, Chrome, Firefox and Electron. Takes some time.
34
+ * `npm test` - Runs unit tests in docker images against the CaSS 1.5 repositories using supported Node versions (18+) and Cypress against Edge, Chrome and Electron. Takes some time.
25
35
 
26
36
  ## Development unit testing
27
37
  Development unit tests presume you have a CaSS Repository running on `localhost:80`. You may get one by running `docker run -d --name cass-test -p80:80 cassproject/cass:1.5.0`
@@ -35,412 +45,19 @@ Development unit tests presume you have a CaSS Repository running on `localhost:
35
45
 
36
46
  ## Publish checklist
37
47
 
38
- * `npm upgrade --save` Review dependencies, autocomplete version numbers to latest versions.
39
- * Increment version number in package.json and yuidoc.json.
40
- * Update changelog.
41
- * `npm install`
42
- * `npm audit` and fix any audit issues.
43
- * Update CaSS server version if necessary in package.json
44
- * `npm test` - Must not fail any tests.
45
- * `npm run webpack:cypressFirefoxHttps` See if the firefox test case has changed.
46
- * Document code coverage output by the previous step.
47
- * Commit changes to GitHub.
48
- * Tag release with semantic version from package.json, push tag.
49
- * `npm publish` (must be `npm login`ed)
48
+ * `npm upgrade --save` Review dependencies, autocomplete version numbers to latest versions.
49
+ * Increment version number using `npm version <patch|minor|major>`. This automatically updates `package.json` and `yuidoc.json`.
50
+ * Update changelog using `npm run changelog`, and review the changes in `CHANGELOG.md`.
51
+ * `npm install`
52
+ * `npm audit` and fix any audit issues.
53
+ * Update CaSS server version if necessary in package.json
54
+ * `npm test` - Must not fail any tests.
55
+ * `npm run webpack:cypressFirefoxHttps` See if the firefox test case has changed.
56
+ * Document code coverage output by the previous step.
57
+ * Commit changes to GitHub.
58
+ * Tag release with semantic version from package.json, push tag.
59
+ * `npm publish` (must be `npm login`ed)
50
60
 
51
61
  # Changelog
52
62
 
53
- ## 5.0.8
54
- * Security updates
55
- * CTDL-ASN import fixes
56
-
57
- ## 5.0.7
58
- * Security updates
59
- * Assertions with the same registration will no longer propagate to the same inferred assertions.
60
- * CTDL-ASN fixes
61
-
62
- ## 5.0.6
63
- * Fixed bug using success in precache with L2 caching.
64
-
65
- ## 5.0.5
66
- * Added implies relation.
67
-
68
- ## 5.0.4
69
- * Updates to CEASN CSV Import validation
70
- * Security updates.
71
-
72
- ## 5.0.3
73
- * Updates to CEASN import/export.
74
- * Security updates.
75
-
76
- ## 5.0.2
77
- * Cosmetic and security updates (to dev dependencies)
78
-
79
- ## 5.0.1
80
- * Updated CEASN import to include versionIdentifier.
81
-
82
- ## 5.0.0
83
- * Added multidelete to EcRepository.
84
- * NPM requires semantic versioning coherence, so I must now use big number for version.
85
- * Added and refined tests to include deleting, multideleting.
86
- * Made use of EcRepository.cache more consistent.
87
- * Updated libraries.
88
-
89
- ## 1.5.74
90
- * Lost Node 18 FIPS support due to incompatibility.
91
- * Updated cryptography to operate 4-10x faster.
92
- * Added Node 22 test dockerfiles.
93
-
94
- ## 1.5.73
95
- * CSV export fix
96
- * Updated libraries
97
- * CTDL ASN export fix
98
- * Caching for EcLinkedData recast (taxonomy conversion)
99
-
100
- ## 1.5.72
101
- * Throws error when importing CTDL/ASN with blank competency text.
102
-
103
- ## 1.5.71
104
- * Fixed issue by trimming spaces in some inputs.
105
-
106
- ## 1.5.70
107
- * Fixed issue with L2 caching of data with mismatched index/permanent records.
108
- * Lots of updates to tests.
109
-
110
- ## 1.5.68
111
- * Hardening and CI/CD testing.
112
- * Fixed CEASN infinite loop.
113
-
114
- ## 1.5.66
115
- * Fixed null pointer in L2 caching with arrays.
116
-
117
- ## 1.5.65
118
- * Removed memory leak in EcCrypto when caching is off.
119
- * Implemented multithreaded subtlecrypto decryption in Node.
120
- * Improved L2 cache retrieval to avoid transactions and handles.
121
- * Fixed bug with EcRepository.searchWithParams not calling eachSuccess.
122
-
123
- ## 1.5.63
124
- * Prevent search from running success more than once.
125
-
126
- ## 1.5.62
127
- * Fixed bug where setting a cache value to null was returning falsish.
128
-
129
- ## 1.5.61
130
- * Fixed bug where EcRepository.precache was modifying array of urls passed in.
131
-
132
- ## 1.5.59
133
- * Fixed bug with EcRepository.precache with CachingL2.
134
-
135
- ## 1.5.58
136
- * Added L2 Caching (persists over F5 using IndexedDB)
137
-
138
- ## 1.5.54
139
- * Fix bug in EcRepository.precache where a promise was not being returned.
140
-
141
- ## 1.5.53
142
- * EcRepository precache no longer fails to invoke success/failure on precache with cached values.
143
-
144
- ## 1.5.52
145
- * Fixed bug in EcRepository.deleteRegistered with owned objects -- ReferenceError.
146
-
147
- ## 1.5.51
148
- * Fixed bug in node causing EPIPE and ENOTFOUND under heavy load.
149
-
150
- ## 1.5.49
151
- * Fixed bug in precache.
152
-
153
- ## 1.5.48
154
- * EcRepository.precache now returns all urls it can, regardless of whether they were fetched from the server.
155
-
156
- ## 1.5.47
157
- * Fixed bug with EcRepository.get and registered data.
158
-
159
- ## 1.5.46
160
- * Added addFrameworkSoft to EcFrameworkGraph -- works better with large, poor frameworks.
161
-
162
- ## 1.5.45
163
- * Fixed an issue with caching registered data.
164
- * Updated libraries
165
-
166
- ## 1.5.41
167
- * Updates to CEASN Concept Scheme import
168
- * Updated libraries
169
- * Failing to log an error message now logs an error message.
170
-
171
- ## 1.5.40
172
- * Fixed an issue found in downstream unit tests.
173
-
174
- ## 1.5.39
175
- * Removed axios due to incompatibility with http2 and security findings.
176
- * Now uses fetch for http/s traffic.
177
- * To use fetch with http2 compatibility or on node 16, `npm install undici` (node's native fetch library, but with more features)
178
- * Started investigating node 21 compatibility.
179
-
180
- ## 1.5.38
181
- * Fixed issue with CTDL-ASN import.
182
- * Use of cassproject library with Vite.js now has appropriate mitigations in place. You will need to include the following libraries
183
- * `"buffer": "^6.0.3"`
184
- * `"stream": "npm:stream-browserify@^3.0.0"`
185
-
186
- ## 1.5.37
187
- * Can now search for and de-duplicate competencies on import.
188
-
189
- ## 1.5.35
190
- * If --force-fips is enabled, always tries to use SHA-256 instead of crashing.
191
-
192
- ### FIPS:
193
- FIPS is supported both client-side and server-side in CaSS. Here is the relevant compatibility table.
194
-
195
- Sources: https://www.openssl.org/blog/blog/2023/05/29/FIPS-3-0-8/
196
-
197
- | --> Server --> | < 1.5.35 | >= 1.5.35 with <br> OpenSSL 3.0.8 and<br> --force-fips | >= 1.5.35 with <br>OpenSSL 3.0.8 and<br> --force-fips and<br> env REJECT_SHA1=true |
198
- | - | - | - | - |
199
- | **Client/Library** | |
200
- | < 1.5.35 | SHA-1 (no FIPS) | SHA-1 (Verify only) | Incompatible
201
- | < 1.5.35 and<br> OpenSSL 3.0.8 and<br> env FIPS=true | SHA-1 (partial FIPS) | SHA-1 (Verify only) | Incompatible
202
- | >= 1.5.35 | SHA-1 (no FIPS) | SHA-1 (Verify only*), SHA-256 (FIPS) | SHA-256 (FIPS)
203
- | >= 1.5.35 and<br> env FIPS=true | SHA-1 (partial FIPS) | SHA-1 (Verify only*), SHA-256 (FIPS) | SHA-256 (FIPS)
204
- | >= 1.5.35 and<br> --force-fips | Incompatible | SHA-256 (FIPS) | SHA-256 (FIPS)
205
-
206
- To get FIPS, it is recommended to use the docker container builds.
207
-
208
- Partial FIPS means that we are still violating FIPS by using SHA-1 hashing. All other cryptographic operations are using the FIPS module.
209
-
210
- Verify only uses the exception that permits SHA-1 verification but not generation.
211
-
212
- Verify only* may fall back to SHA-1 verification if SHA-256 negotiation failed, but typically will not use SHA-1.
213
-
214
- ## 1.5.34
215
- * FIPS support (Does not support SHA-1)
216
- * Default signature method is now SHA-256
217
- * Introduced backwards compatible method of using SHA-1 signatures with servers where the feature is not detected (1.5.34 and behind).
218
-
219
- ## 1.5.32
220
- * Library updates.
221
- * Skip empty rows in Relation import.
222
-
223
- ## 1.5.30
224
- * Library updates.
225
- * Using less memory for keys in decryption cache.
226
-
227
- ## 1.5.28
228
- * Library updates.
229
-
230
- ## 1.5.27
231
- * CORS Origins and CORS requests are now sent with credentials to enable cross origin credentialing.
232
- * Extra lines in CSV import are ignored.
233
-
234
- ## 1.5.25
235
- * Repo init now fetches max length of posts. Multiput now uses multiple requests if the POST length is too long.
236
-
237
- ## 1.5.23
238
- * Fixed issue that was preventing use of webcrypto module.
239
-
240
- ## 1.5.22
241
- * Code cleanup
242
- * Better certificate authority support by setting global.ca
243
-
244
- ## 1.5.20
245
- * Added history fetch (fetches a list of results)
246
-
247
- ## 1.5.19
248
- * No longer use the selectedServerProxy URL to communicate in any context.
249
-
250
- ## 1.5.18
251
- * (PR #268) Updated Progression Type from ceasn to asn
252
- * (PR #264) Ignore sample lines in CEASN import
253
-
254
- ## 1.5.15
255
- * Fixed issue combining use of client side certificates with HTTP/2
256
- * Support import of ceasn:ProgressionModel
257
- * Ignore sample data for CEASN import.
258
- * Skip empty lines on CSV taxonomy import.
259
- * Introduced way to debounce EcRepository.get to prevent multiple HTTP requests for the same piece of data in a race condition environment.
260
- * EcPerson.getByPk now fetches people by their PK more reliably.
261
- *
262
-
263
- ## 1.5.13
264
- * Audit logging.
265
- * Classification and Markings remain unencrypted on objects.
266
- * Last login time field in stored identity object.
267
-
268
- ## 1.5.12
269
- * Improved window crypto detection.
270
-
271
- ## 1.5.11
272
- * Login fix for folks with contacts.
273
-
274
- ## 1.5.10
275
- * FIPS support on Node 18 with custom Node 18 compilation and compiled OpenSSL library.
276
-
277
- ## 1.5.9
278
- * Code coverage documentation
279
- * Login record migration
280
-
281
- ## 1.5.8
282
- * Added additional webworker fallback for forge in web worker mode.
283
- * Fixes to http2 mode
284
- * CTDLASN CSV Import fixes.
285
- * Static analysis fixes.
286
-
287
- ## 1.5.7
288
- * Browser crypto module now detected correctly
289
-
290
- ## 1.5.6
291
- * Plugin support now informed by repository
292
-
293
- ## 1.5.5
294
- * Compatibility with Vite
295
- * Directories of private frameworks are no longer encrypted.
296
-
297
- ## 1.5.4
298
- * HTTP2 support.
299
-
300
- ## 1.5.3
301
- * Library Version Increment
302
- * CTDL-ASN bug fix.
303
-
304
- ## 1.5.2
305
- * Library Version Increment
306
- * CTDL-ASN bug fix.
307
-
308
- ## 1.5.1
309
- * CTDL-ASN bug fix.
310
-
311
- ## 1.5.0
312
- * Version increment
313
-
314
- ## 0.5.31
315
- * Optimized performance of EcFrameworkGraph
316
-
317
- ## 0.5.30
318
- * Optimized performance of EcFrameworkGraph
319
- * Library Updates
320
-
321
- ## 0.5.28
322
- * Bug fixes and library updates.
323
-
324
- ## 0.5.26
325
- * Revised method of SSO based decryption.
326
-
327
- ## 0.5.23
328
- * Securing Proxy data structures and repository.
329
- * Negative assertion handling in graphs was corrected.
330
-
331
- ## 0.5.20
332
- * Bug fixes
333
- * No longer depends on yuidoc, as yuidoc is included as part of the documentation script.
334
-
335
- ## 0.5.15 to 0.5.19
336
- * Bug fixes
337
- * Wide variety of Unit tests on multiple versions of CaSS and in browsers
338
- * Updated CTDLASN CSV import
339
- * Added support for proxy servers, separating where data goes from where data belongs. `repo.selectedServerProxy`
340
-
341
- ## 0.5.8 to 0.5.15
342
- * Bug fixes.
343
- * Can now POST unlimited amounts of data.
344
- * Added unit tests in node (mocha), cypress
345
-
346
- ## 0.5.4 to 0.5.8
347
- * Bug fixes.
348
- * Performance improvements. Runs ~10x faster than 4.x.x.
349
- * Added mocha test suite. `npm run mocha` or `npm run automocha` to execute.
350
-
351
- ## 0.5.4 to 0.5.5
352
- * Now testing against Node 12-16
353
- * Fixed node async worker based cryptography.
354
-
355
- ## 0.5.3 to 0.5.4
356
- * Bug fixes. Dependency updates.
357
-
358
- ## 0.5.2 to 0.5.3
359
- EcIdentityManager is now instantiatable and may be passed into many library functions. Many method signatures have changed.
360
-
361
- ### BREAKING:
362
- * All static EcIdentityManager methods are now instance methods.
363
-
364
- ### UPDATES:
365
- * All functions with web interactions will optionally allow `repo` to be specified.
366
- * All functions with web or decryption interactions will optionally allow `eim` to be specified.
367
- * If `repo` is not specified, the library will employ several methods for operating on that data (in the case of get, delete). If it is specified, the library will strictly only operate on data in that repository. If that is not the case, that is now a defect.
368
- * If `eim` is not specified, the library will use a default EcIdentityManager found at `EcIdentityManager.default` to perform any necessary operations. In an enforced multitenancy situation, we recommend setting EcIdentityManager.default to null, in order to force errors.
369
- * If you are using `eim`, we strongly recommend disabling caching to prevent any tenancy leaks.
370
-
371
- ### Migration Guide
372
-
373
- #### 1. Replace all: `EcIdentityManager.` -> `EcIdentityManager.default.`
374
- As the new EcIdentityManager is instanceable and the static methods and properties are gone, use the default EcIdentityManager.
375
-
376
- ## 0.5.1 to 0.5.2
377
-
378
- ### CAUTION:
379
- * Caching has been altered. Results that are not found are now stored in the cache and used to speed up (failed) retreival of data.
380
-
381
- ## 4.x.x to 0.5.1
382
-
383
- Please migrate your code in a separate branch, as you may need to wait for bug fixes and the like.
384
-
385
- ### BREAKING:
386
- * All blocking calls are now asynchronous, and the blocking calls have been removed, except for fallback EcCrypto methods.
387
- * All callback based methods now primarily support promise / async / await methods.
388
- * Removed all assertion processing methods except for EcFrameworkGraph.
389
- * Removed rollup rule parsed language.
390
- * Removed /bin/. It was a neat idea.
391
- * Removed dependencies on most JS files in /lib/, except one to facilitate worker based asynchronous cryptography.
392
- * All schema.org objects are now in a schema object. As an example, `Thing` is now `schema.Thing`, `Person` is now `schema.Person`. Schema.org objects have been updated to the most recent version.
393
- * All CTDL objects are now in a `ce` object. As an example, CE’s version of `Competency` is now available under `ce.Competency`. CTDL objects have been updated to the most recent version.
394
- * All objects have been moved from using a st-js shim to do class definitions to the ECMAScript 6 class object.
395
- * Removed dependencies on antlr4, browser-or-node, pure-uuid, request, text-encoding, xmlhttprequest, and added dependencies to axios, web-worker, promise-worker.
396
- ### Migration Guide
397
- #### 1. `let out = Ec<something>.getBlocking(id)` -> `let out = await Ec<something>.get(id)`
398
- `.getBlocking` is gone. This pattern must be migrated throughout. `null` is the default return value if the method fails.
399
- #### 2. `Ec<something>.<function>(<parameters>, success, failure)`
400
- This pattern will continue to function as expected. If failure is omitted, a `new Error(error)` will be thrown instead. The following patterns are available to augment use:
401
- ##### 2.1 `await Ec<something>.<function>(<parameters>,success,failure)`
402
- All such functions will now return a promise and function with await. If you find one that does not, that is a bug.
403
- ##### 2.2 `Ec<something>.<function>(<parameters>,success,failure) .then((output)=>console.log(output)) .catch((error)=>console.error(output))`
404
- * You may use promise chaining in conjunction with callbacks.
405
- * The callbacks will operate first, and the promise chains will operate second.
406
- * The callbacks are wired into the promises, so you may `return something` from the callbacks and they will be passed into the promises `.then((something)=>{})`
407
- * The return value from `success` or `failure` will also be available as the result of an `await`ed promise.
408
- * The return value from `success` or `failure` may also be a promise.
409
- * `success` or `failure` methods may be async... that seems obvious, but you never know.
410
- ##### 2.3 `Ec<something>.<function>(<parameters>) .then( (output)=>console.log(output)) .catch((error)=>console.error(output))`
411
- You may also omit the callbacks. No callbacks are required. If failure is omitted, a `new Error(error)` will be thrown if an error occurs.
412
- ##### 2.4 `await Ec<something>.<function>(<parameters>) .then( (output)=>console.log(output)) .catch((error)=>console.error(output))`
413
- Await on promise based functions also work. This includes search and save and delete!
414
- ##### 2.5 `let out = await Ec<something>.<function>(<parameters>)`
415
- Anything that had a `success(output)` can now retreive that `output` using assignment.
416
- * `.search`, `EcEncryptedValue`, `EcFrameworkGraph` and any other methods will either use the `failure` callback or, if it doesn't exist, will `throw new Error(error)` and need `try/catch` blocks or `.catch((error)=>console.error(error))` to catch the errors.
417
- * `.get` and `Ec<RsaOaep/AesCtr>Async` will `return null` if the operations fail, though you may use a `failure` method if desired, as the callbacks are still supported. These are a special case to mirror the blockable methods.
418
- #### 3. `EcAssertion.get<encryptedField> / EcAssertion.set<encryptedField>`
419
- These methods now use awaitable promises to perform their cryptography.
420
- #### 4. `else`
421
- If any of these patterns do not work, please ask before working around, as there are expected to be edge cases that have not yet been found.
422
- #### 5. Webpack configuration
423
- If you're using the CaSS libraries with Webpack in the browser, you may need to add a rule to the Webpack configuration so that the application can understand the modern syntax used in the libraries. In the CaSS Editor application, this was accomplished by adding the following to the `configureWebpack` section of `vue.config.js`.
424
- ```
425
- module: {
426
- rules: [
427
- {
428
- test: /\.m?js$/,
429
- exclude: {test: /node_modules/, // Exclude libraries in node_modules ...
430
- not: [
431
- // Except for a few of them that needs to be transpiled because they use modern syntax
432
- /cassproject/
433
- ]},
434
- use: {
435
- loader: 'babel-loader'
436
- }
437
- }
438
- ]
439
- }
440
- ```
441
-
442
- ## 3.x to 4.x
443
-
444
- * The cassproject library is no longer created in the eduworks/ec library, and resides entirely within the cass-npm repository.
445
- * All functions work in an equivalent manner.
446
- * You must combine cass-npm with a browserify type method to make it usable on the web.
63
+ See [CHANGELOG.md](CHANGELOG.md)