Repository navigation
feat(node-sensor): add Node.js --require and ESM live sensor with #73 conformance (#56) - #236
Open
SriRamkunamsetty wants to merge 1 commit into
Open
SriRamkunamsetty wants to merge 1 commit into
SriRamkunamsetty wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
|
||
| let doc; | ||
| try { | ||
| doc = JSON.parse(fs.readFileSync(this.filePath, "utf-8")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #56
Summary
npm/secfoo-sensor/(@rakfortltd/secfoo-sensor) into a full Node.js live sensor supporting both CommonJS (node --require @rakfortltd/secfoo-sensor/NODE_OPTIONS=--require) and ESM (node --import @rakfortltd/secfoo-sensor/register/module.registeron Node >= 20.6).SECFOO_SENSOR=1. Wraps watched#52exports (Module._load+ ESM loader wrapper) via transparentProxypreservingthis, arguments, return values, thrown errors,instanceof, static properties, and hot-reloading cached modules whenSECFOO_WATCHLISTupdates.#68npmloadinventory frompackage.json, reads#69request/auth context viaAsyncLocalStorage(getContext()), samples first-hit trimmedfile:lineapp stack frames, and collects optional V8 coverage vianode:inspector(Profiler.startPreciseCoverage,callCount: false, detailed: false).#73transports: Supportstcp://(loopback-only + optionalSECFOO_SENSOR_KEYauth),unix://,npipe://, direct gzippedhttps://,file://, andSECFOO_EVENTS_OUTfallback, with bounded queue +.unref()timers/sockets and a bounded 200ms drain on exit.Overhead Benchmark
node npm/secfoo-sensor/test/benchmark.js(node v24.16.0, 200k vs 1M calls):0.0009 us1.8847 us1.8838 us/call(budget:50 us/call)Verification
pytest -p no:langsmith -p no:hypothesis tests/test_sensor/test_node_probe.py tests/test_sensor/test_route_auth_attribution.py -q-> 9 passed (coversnode --testCJS + ESM + middleware suites and 6/6#73conformance kit checks for both CJS and ESM).ruff check .&bandit -c .bandit -ll -r src/secfoo -q-> passed.git merge-tree --write-tree HEAD upstream/main-> zero conflicts.