Commit graph

93 commits

Author SHA1 Message Date
987acf8816
feat!: make RSA keys ephemeral by default
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 5m51s
BREAKING CHANGE: keyDir now defaults to null (ephemeral) instead of
'client_keys'. Clients that relied on keys persisting across restarts
must now pass keyDir explicitly.

The Python SDK defaults to key_dir=None: a key pair is generated in
memory for the session and never written to disk. The JS port defaulted
to 'client_keys' and always persisted, so merely constructing a client
wrote an RSA private key into the working directory. That is a weaker
default than the client it ports, and one users never asked for.

  - keyDir?: string | null, defaulting to undefined. null and undefined
    both mean ephemeral, matching Python's None.
  - Persistent mode is unchanged when keyDir is set: load the existing
    pair from that directory, otherwise generate and save one there.
  - Browsers are always ephemeral; they have no filesystem.

Key rotation follows the same rule. It previously hardcoded
'client_keys' as its fallback directory, so an ephemeral client would
have started writing private keys to disk on the first rotation tick.
Rotated keys are now persisted only where keyDir or keyRotationDir is
explicitly configured.

Tests assert the intent (that saveKeys is never called) rather than
probing the filesystem, since a leftover client_keys/ from the old
default would otherwise make them pass or fail for the wrong reason.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 11:19:03 +02:00
2495f1e6e8
fix: repair npm install and the rollup build
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 5m58s
Three independent breakages, all present on main before this branch:

1. `npm ci` always exited non-zero. The root package.json carried
   "install": "node-gyp-build", but binding.gyp lives in native/, so the
   script ran in a directory with nothing to build:

     gyp: binding.gyp not found (cwd: <repo root>)

   native/package.json already declares that same install script in the
   right place, alongside its binding.gyp and "gypfile": true, so the
   root copy was a duplicate in the wrong package. Removing it also
   clears the now-inaccurate hasInstallScript flag from the lockfile.
   `npm ci` exits 0 again; the addon still builds from native/.

2. `npm run build` failed at the first step. @rollup/plugin-typescript
   requires tslib as a peer, and nothing depended on it directly — it was
   only present transitively as an optional dev dep, so a clean install
   could omit it entirely. Declared explicitly.

3. rollup.config.js used ESM syntax while package.json has no
   "type": "module", so Node parsed it as CommonJS and threw
   "Cannot use import statement outside a module". Node 24 recovers by
   reparsing (with a warning); Node 18 fails outright. Renamed to
   rollup.config.mjs, which is unambiguous on both. Setting
   "type": "module" instead would have broken jest.config.js, which is
   CommonJS.

Verified on Node 18.19.1 and Node 24.18.0: npm ci exits 0, npm run build
produces all three bundles plus declarations, and 76/76 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 11:10:36 +02:00
84eae58317
fix: restore build and tests under TypeScript 6
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 5m55s
The dependency bumps on main left `npm test` and `npm run build:types`
broken independently of any feature work; both fail on a clean checkout
of origin/main.

TypeScript 6 no longer auto-includes @types packages the way node10
resolution did, so every test suite failed to compile with "Cannot find
name 'describe'/'expect'". Declare the needed @types explicitly instead:
  - tsconfig.json: types: ["node"]
  - jest.config.js: types: ["jest", "node"]

TypeScript 6 also errors on two settings this config relied on:
  - moduleResolution "node" (node10) is deprecated -> "bundler", which
    matches how the package is actually consumed (rollup-bundled, with
    "module": "ESNext")
  - an implicit rootDir is now an error when outDir/declarationDir are
    set -> rootDir: "./src"

Drop three unused imports that noUnusedLocals turns into hard errors,
failing --emitDeclarationOnly.

Finally, NodeSecureMemory logged to stdout unconditionally on
construction. This was dormant while the native addon failed to load;
once it loads, it broke the "no console.log when debug=false" test. A
library must not write to stdout uninvited, and the client already
reports this via getProtectionInfo() behind its own debug flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 10:59:28 +02:00
75867ef85a
feat: SGX attestation 2026-07-19 10:49:59 +02:00
b055df5b87 Merge pull request 'Update dependency node-gyp to v13' (#28) from renovate/node-gyp-13.x into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/28
2026-06-26 14:58:54 +02:00
opencode-agent[bot]
d3aa0e264c Node.js min bumped to 22.22.2
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m11s
Co-authored-by: alpha-nerd <alpha-nerd@users.noreply.bitfreedom.net>
2026-06-26 12:36:50 +00:00
c4419579c7 Merge pull request '.forgejo/workflows/opencode.yml aktualisiert' (#32) from alpha-nerd-patch-2 into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/32
2026-06-26 14:29:12 +02:00
20b5372295 .forgejo/workflows/opencode.yml aktualisiert
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m21s
model naming update
2026-06-26 14:28:51 +02:00
f8f655f5e7 Merge pull request 'Update dependency @types/node to v24.13.2' (#27) from renovate/node-24.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/27
2026-06-26 14:18:12 +02:00
32eb03d58e Merge pull request 'Update dependency rollup to v4.62.2' (#31) from renovate/rollup-4.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/31
2026-06-26 14:16:20 +02:00
Renovate Bot
66b7a89cf9 Update dependency rollup to v4.62.2
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m25s
2026-06-19 15:30:17 +00:00
Renovate Bot
21caa0ebab Update dependency @types/node to v24.13.2
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m24s
2026-06-13 12:28:30 +00:00
0e772bc9a6 Merge pull request 'Update dependency rollup to v4.62.0' (#30) from renovate/rollup-4.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/30
2026-06-13 13:30:41 +02:00
Renovate Bot
934e12bb36 Update dependency rollup to v4.62.0
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m27s
2026-06-13 09:28:25 +00:00
51cdff38f9 Merge pull request 'adding oc' (#29) from alpha-nerd-patch-1 into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/29
2026-06-13 09:56:29 +02:00
f3d0fcbfe5 adding oc
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m24s
2026-06-13 09:56:02 +02:00
Renovate Bot
88f189bced Update dependency node-gyp to v13
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m3s
2026-06-12 13:28:30 +00:00
84800d4a1b Merge pull request 'Update dependency node-gyp to v12.4.0' (#26) from renovate/node-gyp-12.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/26
2026-06-10 10:25:03 +02:00
88361a42bc Merge pull request 'Update dependency @types/node to v24.13.1' (#25) from renovate/node-24.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/25
2026-06-10 10:24:30 +02:00
4f12285615 Merge pull request 'Update dependency rollup to v4.61.1' (#24) from renovate/rollup-4.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/24
2026-06-10 10:24:08 +02:00
Renovate Bot
4ebf9d9cce Update dependency node-gyp to v12.4.0
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m44s
2026-06-10 00:28:42 +00:00
Renovate Bot
ceaf0ac151 Update dependency @types/node to v24.13.1
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m43s
2026-06-05 22:43:41 +00:00
Renovate Bot
f9b692bc8b Update dependency rollup to v4.61.1
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m50s
2026-06-04 05:28:58 +00:00
0610e9f881 Merge pull request 'Update dependency rollup to v4.61.0' (#23) from renovate/rollup-4.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/23
2026-06-02 22:14:08 +02:00
Renovate Bot
58100da0c1 Update dependency rollup to v4.61.0
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m32s
2026-06-01 05:48:52 +00:00
8083fac1a1 Merge pull request 'Update dependency @rollup/plugin-commonjs to v29.0.3' (#22) from renovate/rollup-plugin-commonjs-29.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/22
2026-05-29 16:26:42 +02:00
Renovate Bot
14077b39bd Update dependency @rollup/plugin-commonjs to v29.0.3
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m45s
2026-05-29 13:55:53 +00:00
4573fd03f2 Merge pull request 'Update dependency node-addon-api to v8.8.0' (#21) from renovate/node-addon-api-8.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/21
2026-05-23 12:22:26 +02:00
Renovate Bot
3646d17b8c Update dependency node-addon-api to v8.8.0
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m34s
2026-05-22 14:30:06 +00:00
a576e31be9 Merge pull request 'Update dependency ts-jest to v29.4.10' (#20) from renovate/ts-jest-29.x-lockfile into main 2026-05-21 20:15:29 +02:00
Renovate Bot
25e14d6fff Update dependency ts-jest to v29.4.11
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m38s
2026-05-21 13:56:16 +00:00
47fb60888d Merge pull request 'Update dependency rollup to v4.60.4' (#19) from renovate/rollup-4.x-lockfile into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/19
2026-05-14 22:16:20 +02:00
Renovate Bot
e347f641f5 Update dependency rollup to v4.60.4
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m43s
2026-05-14 18:00:49 +00:00
1e632eca11 Merge pull request 'chore(deps): update dependency @types/node to v24.12.4' (#17) from renovate/node-24.x-lockfile into main 2026-05-13 10:12:46 +02:00
9d180537ad Merge pull request '.forgejo/workflows/nyxscanner.yml hinzugefügt' (#18) from nyx into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/18
2026-05-13 10:12:40 +02:00
aebbe832c2 .forgejo/workflows/nyxscanner.yml aktualisiert
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 7m0s
2026-05-13 10:05:06 +02:00
af05a4772e .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 6m49s
test LOW for PR comments to work or not
2026-05-13 09:44:49 +02:00
6e2cab6143 .forgejo/workflows/nyxscanner.yml aktualisiert
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m38s
2026-05-13 09:35:40 +02:00
efd30207e2 .forgejo/workflows/nyxscanner.yml aktualisiert
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m44s
2026-05-13 08:36:18 +02:00
e04386f838 .forgejo/workflows/nyxscanner.yml aktualisiert
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m38s
2026-05-13 08:25:21 +02:00
8af8b079eb .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 1s
NYX Security Scan / permissions (pull_request) Has been cancelled
2026-05-13 08:23:41 +02:00
ea417b54f1 .forgejo/workflows/nyxscanner.yml aktualisiert
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 6m14s
2026-05-13 08:10:27 +02:00
7db4e8220f .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 6m34s
2026-05-13 07:58:15 +02:00
e7e93a3daa .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Has been cancelled
2026-05-13 07:56:10 +02:00
d5831dc358 .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 6m18s
2026-05-13 07:47:04 +02:00
8f33944a65 .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 6m56s
2026-05-13 07:36:50 +02:00
7d874842e1 .forgejo/workflows/nyxscanner.yml aktualisiert
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 41s
2026-05-13 07:28:55 +02:00
56ba11d717 .forgejo/workflows/nyxscanner.yml hinzugefügt
Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 37s
2026-05-13 07:22:39 +02:00
Renovate Bot
ced31e2713 chore(deps): update dependency @types/node to v24.12.4 2026-05-11 22:35:18 +00:00
057ff6c399 Merge pull request 'chore(deps): update jest monorepo to v30' (#16) from renovate/major-jest-monorepo into main
Reviewed-on: https://bitfreedom.net/code/code/nomyo-ai/nomyo-js/pulls/16
2026-05-10 21:36:44 +02:00