@astratra/credentials 1.1.0 → 1.2.0
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 +1 -1
- package/package.json +3 -3
- package/src/balance.js +1 -1
- package/src/vault.js +1 -1
- package/src/versionedStores.js +2 -0
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astratra/credentials",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Encrypted service keys stored in your database, editable from the interface, with no restart.",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22"
|
|
7
7
|
},
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"types": "src/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@astratra/core": "^1.0.0",
|
|
34
|
-
"express": "^4.18.3",
|
|
34
|
+
"express": "^4.18.3 || ^5.0.0",
|
|
35
35
|
"express-validator": "^7.3.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
package/src/balance.js
CHANGED
package/src/vault.js
CHANGED
|
@@ -300,7 +300,7 @@ function createCredentialVault(options = {}) {
|
|
|
300
300
|
* it. A screenshot of this screen must compromise nothing.
|
|
301
301
|
*/
|
|
302
302
|
async function status() {
|
|
303
|
-
let rows
|
|
303
|
+
let rows;
|
|
304
304
|
try {
|
|
305
305
|
rows = await store.findAll(scope || undefined, { strict });
|
|
306
306
|
if (!Array.isArray(rows) || rows.some(row => !row || typeof row.key !== 'string' || typeof row.value !== 'string' || (scope && !sameScope(row, scope)))) throw new Error();
|
package/src/versionedStores.js
CHANGED
|
@@ -81,6 +81,8 @@ function createMongoVersionedCredentialStore({ collection, isReady = () => true,
|
|
|
81
81
|
const next = change(copy(old));
|
|
82
82
|
if (!old) {
|
|
83
83
|
try { await collection.insertOne({ _id: id, revision: 1, ...next }); return next; }
|
|
84
|
+
// Sans « cause », exprès : l'erreur du pilote peut citer le document, donc une valeur secrète.
|
|
85
|
+
// eslint-disable-next-line preserve-caught-error
|
|
84
86
|
catch (error) { if (error.code === 11000) continue; throw new Error('Credential store write failed.'); }
|
|
85
87
|
}
|
|
86
88
|
const result = await collection.updateOne({ _id: id, revision: old.revision },
|