@noy-db/at-macos-keychain 0.7.0-pre.9 → 0.8.0-pre.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 +202 -21
- package/NOTICE +1 -0
- package/README.md +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +14 -13
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 vLannaAi
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
noy-db — Copyright 2026 vLannaAi
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @noy-db/at-macos-keychain
|
|
2
2
|
|
|
3
|
-
**macOS Keychain sealing key provider for noy-db [managed-secret mode](https://github.com/
|
|
3
|
+
**macOS Keychain sealing key provider for noy-db [managed-secret mode](https://github.com/noy-db/core/issues/14).**
|
|
4
4
|
|
|
5
5
|
Desktop-app provider in the `at-*` family. Binds the sealing key to the user's macOS login Keychain — accessible only to processes running as the same user, optionally gated by Touch ID via Keychain Access UI.
|
|
6
6
|
|
|
@@ -57,7 +57,7 @@ const vault = db.vault('acme')
|
|
|
57
57
|
macos-keychain:<service>/<account>
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
E.g., `macos-keychain:com.acme.app/alice@acme.example`. This format is **frozen** per the [sealing pid stability rule](https://github.com/
|
|
60
|
+
E.g., `macos-keychain:com.acme.app/alice@acme.example`. This format is **frozen** per the [sealing pid stability rule](https://github.com/noy-db/docs/blob/main/content/docs/services/sealing-pid-stability.md) — once shipped, it never changes. The hub uses it as the dispatch key when reading an existing `_meta/sealed-secret` envelope.
|
|
61
61
|
|
|
62
62
|
## Touch ID
|
|
63
63
|
|
|
@@ -139,7 +139,7 @@ For real-Keychain integration tests on darwin CI runners, leave `entry` undefine
|
|
|
139
139
|
|
|
140
140
|
- [`@noy-db/at-env`](../at-env) — env-var sealing for server / container deployments.
|
|
141
141
|
- [`@noy-db/hub`](../hub) — the database core that consumes `NoydbSealer`.
|
|
142
|
-
- [Sealing pid stability rule](https://github.com/
|
|
142
|
+
- [Sealing pid stability rule](https://github.com/noy-db/docs/blob/main/content/docs/services/sealing-pid-stability.md)
|
|
143
143
|
|
|
144
144
|
## License
|
|
145
145
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { NoydbSealer } from '@noy-db/hub/at';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* **@noy-db/at-macos-keychain** — macOS Keychain sealing key provider
|
|
5
|
-
* for noy-db [managed-secret mode](https://github.com/
|
|
5
|
+
* for noy-db [managed-secret mode](https://github.com/noy-db/core/issues/14).
|
|
6
6
|
*
|
|
7
7
|
* Desktop-app provider in the `at-*` family. Binds the sealing key to
|
|
8
8
|
* the user's macOS login Keychain — accessible only to processes
|
|
@@ -140,7 +140,7 @@ interface AtMacosKeychainOptions {
|
|
|
140
140
|
*
|
|
141
141
|
* Provider `id` format: `macos-keychain:{service}/{account}`. The
|
|
142
142
|
* format is semver-frozen per the §11.9.1 stability rule; see
|
|
143
|
-
* `https://github.com/
|
|
143
|
+
* `https://github.com/noy-db/docs/blob/main/content/docs/services/sealing-pid-stability.md`.
|
|
144
144
|
*
|
|
145
145
|
* @throws Error at construction if `service` or `account` is empty,
|
|
146
146
|
* or on non-darwin platforms (with a pointer to platform-appropriate
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * **@noy-db/at-macos-keychain** — macOS Keychain sealing key provider\n * for noy-db [managed-secret mode](https://github.com/vLannaAi/noy-db/issues/14).\n *\n * Desktop-app provider in the `at-*` family. Binds the sealing key to\n * the user's macOS login Keychain — accessible only to processes\n * running as the same user, optionally gated by Touch ID via Keychain\n * Access UI (a one-time per-entry toggle the user enables themselves;\n * this package does not gate that programmatically).\n *\n * ## When to use\n *\n * - Desktop apps where the user expects \"log into my Mac = open the\n * vault.\" The Keychain entry persists across reboots, scoped to\n * the user account.\n * - Apps where `at-env` is unsuitable — laptops or shared dev machines\n * where other users with shell access can `echo $NOYDB_SEALING_KEY`\n * and exfiltrate the key.\n *\n * ## When NOT to use\n *\n * - Server-side / containerized deployments — there is no Keychain\n * there. Use `@noy-db/at-env` or `@noy-db/at-aws-kms` (when it\n * ships).\n * - Browser apps — Keychain is a native OS feature, not exposed to\n * browser sandboxes. Use `@noy-db/at-webauthn-prf` (when it ships).\n *\n * ## Setup\n *\n * ```bash\n * pnpm add @noy-db/hub @noy-db/at-macos-keychain @napi-rs/keyring\n * ```\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { atMacosKeychain } from '@noy-db/at-macos-keychain'\n *\n * const db = await createNoydb({\n * store,\n * user: 'alice',\n * secretMode: 'managed',\n * sealingKey: atMacosKeychain({\n * service: 'com.acme.app', // your bundle id / app namespace\n * account: 'alice@acme.example', // per-user keychain item\n * }),\n * })\n * ```\n *\n * First call generates a fresh 32-byte AES-256 key, stores it in the\n * Keychain under `(service, account)`, and uses it to seal the\n * hub-generated managed secret. Subsequent process launches\n * retrieve the same key and unseal transparently.\n *\n * ## Threat model\n *\n * The Keychain entry IS the security boundary. Strength bounded by:\n *\n * - **macOS user-account isolation.** Other processes running as the\n * same user can read the entry. macOS App Sandboxing limits this\n * for App Store apps; unsandboxed apps must trust co-resident\n * processes.\n * - **Login keychain lock state.** When the user's login keychain\n * is locked (default: never, unless explicitly configured), reads\n * surface a prompt or fail. Apps that need to operate when the\n * keychain is locked should consider explicit unlock UX.\n * - **Touch ID upgrade.** Users may add Touch ID gating to the\n * Keychain entry via Keychain Access.app → right-click → Get Info\n * → Access Control. This is opt-in per entry and out of band of\n * this package's API.\n *\n * Does NOT protect against:\n *\n * - Malware running as the same user with Keychain access.\n * - A physically present attacker who knows the user's login\n * password and can unlock the keychain.\n * - macOS itself being compromised below the Keychain Services\n * layer.\n *\n * @packageDocumentation\n */\n\nimport { createRequire } from 'node:module'\n\nimport type { NoydbSealer } from '@noy-db/hub/at'\n\n// ESM has no ambient `require`. Synthesize one bound to this module's URL so\n// the native `@napi-rs/keyring` addon (a CJS-only N-API binary) can still be\n// lazily loaded on darwin. This package is Node/darwin-only by definition, so\n// node:module is always available here.\nconst require = createRequire(import.meta.url)\n\n/**\n * Structural shape of `@napi-rs/keyring`'s `Entry` class.\n *\n * Defined here as a structural type rather than importing the\n * concrete class so that:\n *\n * 1. Test code can inject a memory-backed stub for cross-platform\n * unit tests (the real Entry only works on darwin/win32/linux).\n * 2. We don't pin a specific version of `@napi-rs/keyring`'s\n * exported types — the structural match is exact across 1.x.\n *\n * @public\n */\nexport interface KeychainEntry {\n /** Returns the stored secret, or `null` when no entry exists. */\n getPassword(): string | null\n /** Persists the secret. Overwrites any existing value. */\n setPassword(value: string): void\n /** Removes the entry. Returns `true` if an entry was removed. */\n deletePassword(): boolean\n}\n\n/**\n * Options for {@link atMacosKeychain}.\n *\n * The pair `(service, account)` becomes the Keychain lookup key. By\n * convention:\n *\n * - `service` is your app's bundle id or stable app namespace, e.g.\n * `'com.acme.app'`. Stable across users; identifies the app.\n * - `account` is per-user, typically the user's email or stable\n * user id, e.g. `'alice@acme.example'`. Different users = different\n * Keychain entries.\n */\nexport interface AtMacosKeychainOptions {\n /** Keychain service identifier — typically your app's bundle id. */\n readonly service: string\n /** Per-user account identifier inside the service. */\n readonly account: string\n /**\n * Test-injection hook. Pass a pre-constructed `KeychainEntry`\n * (e.g., a memory-backed stub) to bypass the real Keychain. The\n * production code path defaults to `new Entry(service, account)`\n * from `@napi-rs/keyring`.\n *\n * @internal — production callers should leave undefined.\n */\n readonly entry?: KeychainEntry\n}\n\n/**\n * Build a {@link NoydbSealer} backed by a macOS Keychain entry.\n *\n * The 32-byte AES-256-GCM sealing key is generated on first use and\n * persisted in the Keychain under `(service, account)`. Subsequent\n * calls (this process or any future process running as the same\n * user) retrieve the same key — the vault round-trips across\n * restarts.\n *\n * Provider `id` format: `macos-keychain:{service}/{account}`. The\n * format is semver-frozen per the §11.9.1 stability rule; see\n * `https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/sealing-pid-stability.md`.\n *\n * @throws Error at construction if `service` or `account` is empty,\n * or on non-darwin platforms (with a pointer to platform-appropriate\n * providers).\n */\nexport function atMacosKeychain(\n opts: AtMacosKeychainOptions,\n): NoydbSealer {\n if (!opts.service || typeof opts.service !== 'string') {\n throw new Error(\n '@noy-db/at-macos-keychain: `service` is required, must be a non-empty string. '\n + 'Typically your app bundle id (e.g., \"com.acme.app\").',\n )\n }\n if (!opts.account || typeof opts.account !== 'string') {\n throw new Error(\n '@noy-db/at-macos-keychain: `account` is required, must be a non-empty string. '\n + 'Typically the user\\'s email or stable user id (e.g., \"alice@acme.example\").',\n )\n }\n\n // Hard platform check unless the caller supplied a test stub.\n // Per §11.9.1 spec Q.3: fail loudly on the wrong platform.\n if (opts.entry === undefined && process.platform !== 'darwin') {\n throw new Error(\n `@noy-db/at-macos-keychain: refusing to construct provider on `\n + `platform \"${process.platform}\". This package only operates on `\n + 'darwin (macOS). For other platforms use @noy-db/at-env (server), '\n + '@noy-db/at-wincred (Windows desktop), @noy-db/at-libsecret (Linux desktop), '\n + 'or @noy-db/at-webauthn-prf (browser).',\n )\n }\n\n // Resolved lazily so that production callers don't pay the require\n // cost (or fail loudly on wrong platform) until they actually invoke\n // seal/unseal. Construction-site failure of new Entry() on unsupported\n // platforms is caught and rethrown with a clearer message.\n let resolvedEntry: KeychainEntry | undefined = opts.entry\n const getEntry = (): KeychainEntry => {\n if (resolvedEntry) return resolvedEntry\n // Dynamic require so non-darwin imports don't crash on package load.\n // The platform check above guards production callers; this branch\n // only runs for production (opts.entry was undefined) on darwin.\n /* eslint-disable @typescript-eslint/no-require-imports */\n let Entry: new (service: string, account: string) => KeychainEntry\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const mod = require('@napi-rs/keyring') as { Entry: any }\n Entry = mod.Entry\n } catch (err) {\n throw new Error(\n '@noy-db/at-macos-keychain: failed to load `@napi-rs/keyring`. '\n + 'Ensure it is installed (`pnpm add @napi-rs/keyring`) and that '\n + 'the platform-specific binary for darwin is available. '\n + 'Original error: '\n + (err instanceof Error ? err.message : String(err)),\n )\n }\n /* eslint-enable */\n resolvedEntry = new Entry(opts.service, opts.account)\n return resolvedEntry\n }\n\n // Cache the imported CryptoKey for the lifetime of this provider\n // instance. Matches at-env's pattern; avoids a Keychain round-trip\n // per seal/unseal operation in long-running processes.\n let cachedKey: Promise<CryptoKey> | null = null\n const getKey = (): Promise<CryptoKey> => {\n if (!cachedKey) {\n cachedKey = (async (): Promise<CryptoKey> => {\n const entry = getEntry()\n let stored = entry.getPassword()\n if (stored === null) {\n // First call ever for this (service, account) — generate a\n // fresh 32-byte AES-256 key, base64-encode for string\n // storage, persist.\n const fresh = new Uint8Array(32)\n globalThis.crypto.getRandomValues(fresh)\n entry.setPassword(bytesToBase64(fresh))\n stored = entry.getPassword()\n if (stored === null) {\n throw new Error(\n '@noy-db/at-macos-keychain: setPassword succeeded but '\n + 'getPassword returned null immediately after. '\n + 'Keychain may be denying access or the entry was '\n + 'deleted out from under us.',\n )\n }\n }\n const keyBytes = base64ToBytes(stored)\n if (keyBytes.length !== 32) {\n throw new Error(\n `@noy-db/at-macos-keychain: stored key for service=\"${opts.service}\" `\n + `account=\"${opts.account}\" decodes to ${keyBytes.length} bytes; `\n + 'expected 32. The Keychain entry may have been tampered with — '\n + 'delete the entry (Keychain Access.app → search → right-click → Delete) '\n + 'and reopen the vault to regenerate.',\n )\n }\n return globalThis.crypto.subtle.importKey(\n 'raw',\n keyBytes as unknown as BufferSource,\n 'AES-GCM',\n false,\n ['encrypt', 'decrypt'],\n )\n })()\n }\n return cachedKey\n }\n\n return {\n id: `macos-keychain:${opts.service}/${opts.account}`,\n\n async seal(secret: Uint8Array): Promise<Uint8Array> {\n const key = await getKey()\n const iv = globalThis.crypto.getRandomValues(new Uint8Array(12))\n const ciphertext = await globalThis.crypto.subtle.encrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n key,\n secret as unknown as BufferSource,\n )\n // Output format: [12-byte IV][ciphertext + 16-byte GCM tag]\n // Identical wire layout to at-env, by design — the hub envelope\n // dispatches on pid, not on per-provider format.\n const out = new Uint8Array(12 + ciphertext.byteLength)\n out.set(iv, 0)\n out.set(new Uint8Array(ciphertext), 12)\n return out\n },\n\n async unseal(sealed: Uint8Array): Promise<Uint8Array> {\n // 12-byte IV + ≥ 16-byte GCM tag minimum.\n if (sealed.length < 12 + 16) {\n throw new Error(\n `@noy-db/at-macos-keychain: sealed bytes too short (${sealed.length} < 28). `\n + 'Input is not a valid at-macos-keychain-sealed envelope.',\n )\n }\n const iv = sealed.subarray(0, 12)\n const body = sealed.subarray(12)\n const key = await getKey()\n const plaintext = await globalThis.crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n key,\n body as unknown as BufferSource,\n )\n return new Uint8Array(plaintext)\n },\n }\n}\n\n// ─── base64 helpers (browser + node compatible) ──────────────────────────\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n let binary = ''\n for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]!)\n return btoa(binary)\n}\n\nfunction base64ToBytes(b64: string): Uint8Array {\n if (!/^[A-Za-z0-9+/]+={0,2}$/.test(b64.trim())) {\n throw new Error('input contains characters outside the base64 alphabet')\n }\n const binary = atob(b64)\n const out = new Uint8Array(binary.length)\n for (let i = 0; i < binary.length; i++) out[i] = binary.charCodeAt(i)\n return out\n}\n"],"mappings":";AAiFA,SAAS,qBAAqB;AAQ9B,IAAMA,WAAU,cAAc,YAAY,GAAG;AAqEtC,SAAS,gBACd,MACa;AACb,MAAI,CAAC,KAAK,WAAW,OAAO,KAAK,YAAY,UAAU;AACrD,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,MAAI,CAAC,KAAK,WAAW,OAAO,KAAK,YAAY,UAAU;AACrD,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AAIA,MAAI,KAAK,UAAU,UAAa,QAAQ,aAAa,UAAU;AAC7D,UAAM,IAAI;AAAA,MACR,0EACe,QAAQ,QAAQ;AAAA,IAIjC;AAAA,EACF;AAMA,MAAI,gBAA2C,KAAK;AACpD,QAAM,WAAW,MAAqB;AACpC,QAAI,cAAe,QAAO;AAK1B,QAAI;AACJ,QAAI;AAEF,YAAM,MAAMA,SAAQ,kBAAkB;AACtC,cAAQ,IAAI;AAAA,IACd,SAAS,KAAK;AACZ,YAAM,IAAI;AAAA,QACR,wMAIG,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAAA,MACpD;AAAA,IACF;AAEA,oBAAgB,IAAI,MAAM,KAAK,SAAS,KAAK,OAAO;AACpD,WAAO;AAAA,EACT;AAKA,MAAI,YAAuC;AAC3C,QAAM,SAAS,MAA0B;AACvC,QAAI,CAAC,WAAW;AACd,mBAAa,YAAgC;AAC3C,cAAM,QAAQ,SAAS;AACvB,YAAI,SAAS,MAAM,YAAY;AAC/B,YAAI,WAAW,MAAM;AAInB,gBAAM,QAAQ,IAAI,WAAW,E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O;AACzB,YAAM,YAAY,MAAM,WAAW,OAAO,OAAO;AAAA,QAC/C,EAAE,MAAM,WAAW,GAAuB;AAAA,QAC1C;AAAA,QACA;AAAA,MACF;AACA,aAAO,IAAI,WAAW,SAAS;AAAA,IACjC;AAAA,EACF;AACF;AAIA,SAAS,cAAc,OAA2B;AAChD,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,WAAU,OAAO,aAAa,MAAM,CAAC,CAAE;AAC9E,SAAO,KAAK,MAAM;AACpB;AAEA,SAAS,cAAc,KAAyB;AAC9C,MAAI,CAAC,yBAAyB,KAAK,IAAI,KAAK,CAAC,GAAG;AAC9C,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,QAAM,SAAS,KAAK,GAAG;AACvB,QAAM,MAAM,IAAI,WAAW,OAAO,MAAM;AACxC,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,IAAK,KAAI,CAAC,IAAI,OAAO,WAAW,CAAC;AACpE,SAAO;AACT;","names":["require"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * **@noy-db/at-macos-keychain** — macOS Keychain sealing key provider\n * for noy-db [managed-secret mode](https://github.com/noy-db/core/issues/14).\n *\n * Desktop-app provider in the `at-*` family. Binds the sealing key to\n * the user's macOS login Keychain — accessible only to processes\n * running as the same user, optionally gated by Touch ID via Keychain\n * Access UI (a one-time per-entry toggle the user enables themselves;\n * this package does not gate that programmatically).\n *\n * ## When to use\n *\n * - Desktop apps where the user expects \"log into my Mac = open the\n * vault.\" The Keychain entry persists across reboots, scoped to\n * the user account.\n * - Apps where `at-env` is unsuitable — laptops or shared dev machines\n * where other users with shell access can `echo $NOYDB_SEALING_KEY`\n * and exfiltrate the key.\n *\n * ## When NOT to use\n *\n * - Server-side / containerized deployments — there is no Keychain\n * there. Use `@noy-db/at-env` or `@noy-db/at-aws-kms` (when it\n * ships).\n * - Browser apps — Keychain is a native OS feature, not exposed to\n * browser sandboxes. Use `@noy-db/at-webauthn-prf` (when it ships).\n *\n * ## Setup\n *\n * ```bash\n * pnpm add @noy-db/hub @noy-db/at-macos-keychain @napi-rs/keyring\n * ```\n *\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { atMacosKeychain } from '@noy-db/at-macos-keychain'\n *\n * const db = await createNoydb({\n * store,\n * user: 'alice',\n * secretMode: 'managed',\n * sealingKey: atMacosKeychain({\n * service: 'com.acme.app', // your bundle id / app namespace\n * account: 'alice@acme.example', // per-user keychain item\n * }),\n * })\n * ```\n *\n * First call generates a fresh 32-byte AES-256 key, stores it in the\n * Keychain under `(service, account)`, and uses it to seal the\n * hub-generated managed secret. Subsequent process launches\n * retrieve the same key and unseal transparently.\n *\n * ## Threat model\n *\n * The Keychain entry IS the security boundary. Strength bounded by:\n *\n * - **macOS user-account isolation.** Other processes running as the\n * same user can read the entry. macOS App Sandboxing limits this\n * for App Store apps; unsandboxed apps must trust co-resident\n * processes.\n * - **Login keychain lock state.** When the user's login keychain\n * is locked (default: never, unless explicitly configured), reads\n * surface a prompt or fail. Apps that need to operate when the\n * keychain is locked should consider explicit unlock UX.\n * - **Touch ID upgrade.** Users may add Touch ID gating to the\n * Keychain entry via Keychain Access.app → right-click → Get Info\n * → Access Control. This is opt-in per entry and out of band of\n * this package's API.\n *\n * Does NOT protect against:\n *\n * - Malware running as the same user with Keychain access.\n * - A physically present attacker who knows the user's login\n * password and can unlock the keychain.\n * - macOS itself being compromised below the Keychain Services\n * layer.\n *\n * @packageDocumentation\n */\n\nimport { createRequire } from 'node:module'\n\nimport type { NoydbSealer } from '@noy-db/hub/at'\n\n// ESM has no ambient `require`. Synthesize one bound to this module's URL so\n// the native `@napi-rs/keyring` addon (a CJS-only N-API binary) can still be\n// lazily loaded on darwin. This package is Node/darwin-only by definition, so\n// node:module is always available here.\nconst require = createRequire(import.meta.url)\n\n/**\n * Structural shape of `@napi-rs/keyring`'s `Entry` class.\n *\n * Defined here as a structural type rather than importing the\n * concrete class so that:\n *\n * 1. Test code can inject a memory-backed stub for cross-platform\n * unit tests (the real Entry only works on darwin/win32/linux).\n * 2. We don't pin a specific version of `@napi-rs/keyring`'s\n * exported types — the structural match is exact across 1.x.\n *\n * @public\n */\nexport interface KeychainEntry {\n /** Returns the stored secret, or `null` when no entry exists. */\n getPassword(): string | null\n /** Persists the secret. Overwrites any existing value. */\n setPassword(value: string): void\n /** Removes the entry. Returns `true` if an entry was removed. */\n deletePassword(): boolean\n}\n\n/**\n * Options for {@link atMacosKeychain}.\n *\n * The pair `(service, account)` becomes the Keychain lookup key. By\n * convention:\n *\n * - `service` is your app's bundle id or stable app namespace, e.g.\n * `'com.acme.app'`. Stable across users; identifies the app.\n * - `account` is per-user, typically the user's email or stable\n * user id, e.g. `'alice@acme.example'`. Different users = different\n * Keychain entries.\n */\nexport interface AtMacosKeychainOptions {\n /** Keychain service identifier — typically your app's bundle id. */\n readonly service: string\n /** Per-user account identifier inside the service. */\n readonly account: string\n /**\n * Test-injection hook. Pass a pre-constructed `KeychainEntry`\n * (e.g., a memory-backed stub) to bypass the real Keychain. The\n * production code path defaults to `new Entry(service, account)`\n * from `@napi-rs/keyring`.\n *\n * @internal — production callers should leave undefined.\n */\n readonly entry?: KeychainEntry\n}\n\n/**\n * Build a {@link NoydbSealer} backed by a macOS Keychain entry.\n *\n * The 32-byte AES-256-GCM sealing key is generated on first use and\n * persisted in the Keychain under `(service, account)`. Subsequent\n * calls (this process or any future process running as the same\n * user) retrieve the same key — the vault round-trips across\n * restarts.\n *\n * Provider `id` format: `macos-keychain:{service}/{account}`. The\n * format is semver-frozen per the §11.9.1 stability rule; see\n * `https://github.com/noy-db/docs/blob/main/content/docs/services/sealing-pid-stability.md`.\n *\n * @throws Error at construction if `service` or `account` is empty,\n * or on non-darwin platforms (with a pointer to platform-appropriate\n * providers).\n */\nexport function atMacosKeychain(\n opts: AtMacosKeychainOptions,\n): NoydbSealer {\n if (!opts.service || typeof opts.service !== 'string') {\n throw new Error(\n '@noy-db/at-macos-keychain: `service` is required, must be a non-empty string. '\n + 'Typically your app bundle id (e.g., \"com.acme.app\").',\n )\n }\n if (!opts.account || typeof opts.account !== 'string') {\n throw new Error(\n '@noy-db/at-macos-keychain: `account` is required, must be a non-empty string. '\n + 'Typically the user\\'s email or stable user id (e.g., \"alice@acme.example\").',\n )\n }\n\n // Hard platform check unless the caller supplied a test stub.\n // Per §11.9.1 spec Q.3: fail loudly on the wrong platform.\n if (opts.entry === undefined && process.platform !== 'darwin') {\n throw new Error(\n `@noy-db/at-macos-keychain: refusing to construct provider on `\n + `platform \"${process.platform}\". This package only operates on `\n + 'darwin (macOS). For other platforms use @noy-db/at-env (server), '\n + '@noy-db/at-wincred (Windows desktop), @noy-db/at-libsecret (Linux desktop), '\n + 'or @noy-db/at-webauthn-prf (browser).',\n )\n }\n\n // Resolved lazily so that production callers don't pay the require\n // cost (or fail loudly on wrong platform) until they actually invoke\n // seal/unseal. Construction-site failure of new Entry() on unsupported\n // platforms is caught and rethrown with a clearer message.\n let resolvedEntry: KeychainEntry | undefined = opts.entry\n const getEntry = (): KeychainEntry => {\n if (resolvedEntry) return resolvedEntry\n // Dynamic require so non-darwin imports don't crash on package load.\n // The platform check above guards production callers; this branch\n // only runs for production (opts.entry was undefined) on darwin.\n /* eslint-disable @typescript-eslint/no-require-imports */\n let Entry: new (service: string, account: string) => KeychainEntry\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const mod = require('@napi-rs/keyring') as { Entry: any }\n Entry = mod.Entry\n } catch (err) {\n throw new Error(\n '@noy-db/at-macos-keychain: failed to load `@napi-rs/keyring`. '\n + 'Ensure it is installed (`pnpm add @napi-rs/keyring`) and that '\n + 'the platform-specific binary for darwin is available. '\n + 'Original error: '\n + (err instanceof Error ? err.message : String(err)),\n )\n }\n /* eslint-enable */\n resolvedEntry = new Entry(opts.service, opts.account)\n return resolvedEntry\n }\n\n // Cache the imported CryptoKey for the lifetime of this provider\n // instance. Matches at-env's pattern; avoids a Keychain round-trip\n // per seal/unseal operation in long-running processes.\n let cachedKey: Promise<CryptoKey> | null = null\n const getKey = (): Promise<CryptoKey> => {\n if (!cachedKey) {\n cachedKey = (async (): Promise<CryptoKey> => {\n const entry = getEntry()\n let stored = entry.getPassword()\n if (stored === null) {\n // First call ever for this (service, account) — generate a\n // fresh 32-byte AES-256 key, base64-encode for string\n // storage, persist.\n const fresh = new Uint8Array(32)\n globalThis.crypto.getRandomValues(fresh)\n entry.setPassword(bytesToBase64(fresh))\n stored = entry.getPassword()\n if (stored === null) {\n throw new Error(\n '@noy-db/at-macos-keychain: setPassword succeeded but '\n + 'getPassword returned null immediately after. '\n + 'Keychain may be denying access or the entry was '\n + 'deleted out from under us.',\n )\n }\n }\n const keyBytes = base64ToBytes(stored)\n if (keyBytes.length !== 32) {\n throw new Error(\n `@noy-db/at-macos-keychain: stored key for service=\"${opts.service}\" `\n + `account=\"${opts.account}\" decodes to ${keyBytes.length} bytes; `\n + 'expected 32. The Keychain entry may have been tampered with — '\n + 'delete the entry (Keychain Access.app → search → right-click → Delete) '\n + 'and reopen the vault to regenerate.',\n )\n }\n return globalThis.crypto.subtle.importKey(\n 'raw',\n keyBytes as unknown as BufferSource,\n 'AES-GCM',\n false,\n ['encrypt', 'decrypt'],\n )\n })()\n }\n return cachedKey\n }\n\n return {\n id: `macos-keychain:${opts.service}/${opts.account}`,\n\n async seal(secret: Uint8Array): Promise<Uint8Array> {\n const key = await getKey()\n const iv = globalThis.crypto.getRandomValues(new Uint8Array(12))\n const ciphertext = await globalThis.crypto.subtle.encrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n key,\n secret as unknown as BufferSource,\n )\n // Output format: [12-byte IV][ciphertext + 16-byte GCM tag]\n // Identical wire layout to at-env, by design — the hub envelope\n // dispatches on pid, not on per-provider format.\n const out = new Uint8Array(12 + ciphertext.byteLength)\n out.set(iv, 0)\n out.set(new Uint8Array(ciphertext), 12)\n return out\n },\n\n async unseal(sealed: Uint8Array): Promise<Uint8Array> {\n // 12-byte IV + ≥ 16-byte GCM tag minimum.\n if (sealed.length < 12 + 16) {\n throw new Error(\n `@noy-db/at-macos-keychain: sealed bytes too short (${sealed.length} < 28). `\n + 'Input is not a valid at-macos-keychain-sealed envelope.',\n )\n }\n const iv = sealed.subarray(0, 12)\n const body = sealed.subarray(12)\n const key = await getKey()\n const plaintext = await globalThis.crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: iv as BufferSource },\n key,\n body as unknown as BufferSource,\n )\n return new Uint8Array(plaintext)\n },\n }\n}\n\n// ─── base64 helpers (browser + node compatible) ──────────────────────────\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n let binary = ''\n for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]!)\n return btoa(binary)\n}\n\nfunction base64ToBytes(b64: string): Uint8Array {\n if (!/^[A-Za-z0-9+/]+={0,2}$/.test(b64.trim())) {\n throw new Error('input contains characters outside the base64 alphabet')\n }\n const binary = atob(b64)\n const out = new Uint8Array(binary.length)\n for (let i = 0; i < binary.length; i++) out[i] = binary.charCodeAt(i)\n return out\n}\n"],"mappings":";AAiFA,SAAS,qBAAqB;AAQ9B,IAAMA,WAAU,cAAc,YAAY,GAAG;AAqEtC,SAAS,gBACd,MACa;AACb,MAAI,CAAC,KAAK,WAAW,OAAO,KAAK,YAAY,UAAU;AACrD,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,MAAI,CAAC,KAAK,WAAW,OAAO,KAAK,YAAY,UAAU;AACrD,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AAIA,MAAI,KAAK,UAAU,UAAa,QAAQ,aAAa,UAAU;AAC7D,UAAM,IAAI;AAAA,MACR,0EACe,QAAQ,QAAQ;AAAA,IAIjC;AAAA,EACF;AAMA,MAAI,gBAA2C,KAAK;AACpD,QAAM,WAAW,MAAqB;AACpC,QAAI,cAAe,QAAO;AAK1B,QAAI;AACJ,QAAI;AAEF,YAAM,M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4
4
|
"description": "macOS Keychain sealing key provider for noy-db managed-secret mode — AES-256-GCM under a 32-byte key stored in the user's login Keychain. Desktop-app provider in the at-* family; pairs with Touch ID via Keychain Access UI.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
6
|
"author": "vLannaAi <vicio@lanna.ai>",
|
|
7
|
-
"homepage": "https://github.com/
|
|
7
|
+
"homepage": "https://github.com/noy-db/at/tree/main/at-macos-keychain#readme",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/
|
|
11
|
-
"directory": "
|
|
10
|
+
"url": "git+https://github.com/noy-db/at.git",
|
|
11
|
+
"directory": "at-macos-keychain"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/noy-db/at/issues"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"sideEffects": false,
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
28
28
|
"README.md",
|
|
29
|
-
"LICENSE"
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"NOTICE"
|
|
30
31
|
],
|
|
31
32
|
"os": [
|
|
32
33
|
"darwin"
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@napi-rs/keyring": "^1.1.0",
|
|
39
|
-
"@noy-db/hub": "^0.7.0-pre.
|
|
40
|
+
"@noy-db/hub": "^0.7.0 || ^0.8.0-pre.0"
|
|
40
41
|
},
|
|
41
42
|
"peerDependenciesMeta": {
|
|
42
43
|
"@napi-rs/keyring": {
|
|
@@ -45,11 +46,11 @@
|
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@napi-rs/keyring": "^1.1.0",
|
|
48
|
-
"@
|
|
49
|
-
"@noy-db/
|
|
50
|
-
"@noy-db/
|
|
51
|
-
"@noy-db/
|
|
52
|
-
"@
|
|
49
|
+
"@noy-db/hub": "0.8.0-pre.0",
|
|
50
|
+
"@noy-db/on-shamir": "0.8.0-pre.0",
|
|
51
|
+
"@noy-db/test-sealer-conformance": "0.8.0-pre.0",
|
|
52
|
+
"@noy-db/to-memory": "0.8.0-pre.0",
|
|
53
|
+
"@types/node": "^22.0.0"
|
|
53
54
|
},
|
|
54
55
|
"keywords": [
|
|
55
56
|
"noy-db",
|