feat: add JavaScript implementation of ngwaf-compute-interface#32
Open
feat: add JavaScript implementation of ngwaf-compute-interface#32
Conversation
Agent-Logs-Url: https://github.com/fastly/security-use-cases/sessions/731a42dd-116b-4854-87b1-a5a15b0963fd Co-authored-by: BrooksCunningham <22921241+BrooksCunningham@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
BrooksCunningham
April 2, 2026 16:27
View session
Collaborator
|
@rabdelazim Can you review this implementation? |
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.
Summary
Creates a JavaScript Fastly Compute implementation of the existing Rust
ngwaf-compute-interfaceservice in a newngwaf-compute-interface-javascript/directory, using version3.40.1of the@fastly/js-computeSDK.Changes
src/index.js– Main entry point implementing the same logic as the Rust service:cdn-secretheader (returns 403 if missing/wrong)corpandworkspacefrom thengwafConfig Storex-source-ipheaderinspect()fromfastly:securitywaf-infoheader with decision time, request ID, agent response, tags, and verdictpackage.json– Declares@fastly/js-compute@3.40.1as a dev dependency withbuildanddeployscriptsfastly.toml– JavaScript compute manifest with the samengwafconfig store setup (including local server defaults) as the Rust versionREADME.md– Full documentation mirroring the Rust README.gitignore– Ignoresbin/andnode_modules/Testing
The project builds successfully with
npm run build(compiles to WASM viajs-compute-runtime).