@wirecat/cli-base 0.47.4 → 0.47.5
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/CHANGELOG.md +13 -0
- package/dist/credentials.js +3 -2
- package/dist/keyring.js +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,19 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b
|
|
|
8
8
|
Every entry says what changed as a caller sees it, why, and what to watch for — the rules are
|
|
9
9
|
[`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog).
|
|
10
10
|
|
|
11
|
+
## 0.47.5 — 21.10.2026
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **On Linux the OS keyring now means the Secret Service, never the kernel keyring.** `@napi-rs/keyring` silently
|
|
16
|
+
fell back to the in-memory kernel keyring when the Secret Service did not answer (gnome-keyring locked, D-Bus
|
|
17
|
+
timeout): reads of stored secrets came back empty with no hint why, and writes went to memory that a reboot
|
|
18
|
+
clears. `systemKeyring` now pins every entry to the Secret Service, so such a failure throws and `Credentials`
|
|
19
|
+
in `auto` mode warns once and uses its file. What to watch for: a machine with no Secret Service but a working
|
|
20
|
+
kernel keyring now gets the credentials file instead; a secret written to the kernel keyring by an earlier
|
|
21
|
+
version is no longer read and has to be stored again. The warning now reads "could not reach the OS keyring — it
|
|
22
|
+
may be locked, or no keyring service is running (…); using <file> instead, readable only by you".
|
|
23
|
+
|
|
11
24
|
## 0.47.4 — 20.10.2026
|
|
12
25
|
|
|
13
26
|
### Added
|
package/dist/credentials.js
CHANGED
|
@@ -110,8 +110,9 @@ export class Credentials {
|
|
|
110
110
|
catch (error) {
|
|
111
111
|
if (!this.#warned) {
|
|
112
112
|
this.#warned = true;
|
|
113
|
-
this.#warn(`the OS keyring
|
|
114
|
-
`
|
|
113
|
+
this.#warn(`could not reach the OS keyring — it may be locked, or no keyring service is running ` +
|
|
114
|
+
`(${error instanceof Error ? error.message : String(error)}); ` +
|
|
115
|
+
`using ${this.#path()} instead, readable only by you`);
|
|
115
116
|
}
|
|
116
117
|
return undefined;
|
|
117
118
|
}
|
package/dist/keyring.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
+
// Without a pinned store the binding silently falls back to the kernel keyring when the Secret
|
|
3
|
+
// Service fails (locked, not running): reads miss every stored secret and writes are lost on
|
|
4
|
+
// reboot, and nothing throws, so `Credentials` never falls back to its file. Ignored off Linux.
|
|
5
|
+
const ENTRY_OPTIONS = { linux: { store: "secret-service" } };
|
|
2
6
|
const require = createRequire(import.meta.url);
|
|
3
7
|
let cached;
|
|
4
8
|
// Loaded on first use, not at import: `@napi-rs/keyring` is a native module, and a machine
|
|
@@ -7,15 +11,15 @@ const entryClass = () => {
|
|
|
7
11
|
cached ??= require("@napi-rs/keyring").Entry;
|
|
8
12
|
return cached;
|
|
9
13
|
};
|
|
14
|
+
const entry = (service, account) => new (entryClass())(service, account, ENTRY_OPTIONS);
|
|
10
15
|
export const systemKeyring = {
|
|
11
16
|
// Returns null for an absent entry rather than throwing — measured against @napi-rs/keyring
|
|
12
17
|
// on 2026-09-13, and the difference matters: a throw here means the keychain is unusable.
|
|
13
|
-
get: (service, account) =>
|
|
18
|
+
get: (service, account) => entry(service, account).getPassword(),
|
|
14
19
|
set: (service, account, secret) => {
|
|
15
|
-
;
|
|
16
|
-
new (entryClass())(service, account).setPassword(secret);
|
|
20
|
+
entry(service, account).setPassword(secret);
|
|
17
21
|
},
|
|
18
|
-
delete: (service, account) =>
|
|
22
|
+
delete: (service, account) => entry(service, account).deletePassword(),
|
|
19
23
|
};
|
|
20
24
|
/** An in-memory stand-in. Every test uses this; none can reach the real keychain. */
|
|
21
25
|
export const memoryKeyring = (initial = {}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.5",
|
|
4
4
|
"description": "The parts every command line tool needs: output modes, terminal rendering, error model, exit codes, credentials, clocks",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|