@astratra/credentials 1.1.0 → 1.2.1
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/README.md +1 -1
- package/package.json +4 -5
- package/src/balance.js +1 -1
- package/src/routes.js +1 -2
- package/src/vault.js +1 -1
- package/src/versionedStores.js +2 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -528,7 +528,7 @@ son `_id` unique et sa révision compare-and-swap rendent l'ajout atomique sans
|
|
|
528
528
|
transaction multi-document. L'historique de métadonnées grossit : archive-le
|
|
529
529
|
avant la limite de taille des documents Mongo si une clé reçoit beaucoup
|
|
530
530
|
d'écritures. Il ne réutilise pas automatiquement la collection du store plat.
|
|
531
|
-
Pour PostgreSQL ou
|
|
531
|
+
Pour PostgreSQL ou un schéma existant, fournis cet adapter :
|
|
532
532
|
|
|
533
533
|
```text
|
|
534
534
|
supportsScopes: true
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astratra/credentials",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
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",
|
|
@@ -30,9 +30,8 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@astratra/core": "^1.
|
|
34
|
-
"express": "^4.18.3"
|
|
35
|
-
"express-validator": "^7.3.2"
|
|
33
|
+
"@astratra/core": "^1.3.0",
|
|
34
|
+
"express": "^4.18.3 || ^5.0.0"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@astratra/security": "^1.8.0",
|
package/src/balance.js
CHANGED
package/src/routes.js
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
* out. Every response describes a key; none carries one.
|
|
10
10
|
*/
|
|
11
11
|
const express = require('express');
|
|
12
|
-
const { body, param } = require('
|
|
13
|
-
const { apiResponse, asyncHandler, validateMiddleware } = require('@astratra/core');
|
|
12
|
+
const { apiResponse, asyncHandler, validateMiddleware, body, param } = require('@astratra/core');
|
|
14
13
|
|
|
15
14
|
const NOOP_LOGGER = { info() {} };
|
|
16
15
|
|
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 },
|