@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Astratra
3
+ Copyright (c) 2026 Astratra contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@astratra/credentials",
3
- "version": "1.1.0",
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": ">=20"
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
@@ -203,7 +203,7 @@ function createBalanceProbe(options = {}) {
203
203
  async function check(key, opts = {}) {
204
204
  if (!definitions.has(key)) return null;
205
205
 
206
- let value = null;
206
+ let value;
207
207
  try {
208
208
  value = await readValue(key);
209
209
  } catch (_error) {
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();
@@ -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 },