Releases: gatewayd-io/gatewayd-plugin-js
Releases · gatewayd-io/gatewayd-plugin-js
Release list
v0.2.0
What's Changed
Bug Fixes
- Fix
OnNewPooldispatching to wrong JS function --OnNewPoolwas calling"onConfigLoaded"instead of"onNewPool"due to a copy-paste bug, causing pool-related JS hooks to silently run the wrong handler. - Fix
OnTrafficswallowing errors --OnTrafficwas returningnilinstead of the error fromRunFunction, hiding JS runtime errors from GatewayD. - Fix unsafe type assertion in
RunFunction-- A bare type assertion (.*v1.Struct) would panic if a JS function returned an unexpected type. Now uses a checked assertion with a descriptive error. - Fix hardcoded log message in
RunFunction-- Error logs always said"OnTrafficFromClient"regardless of which function was actually called.
Safety & Robustness
- Add mutex for Goja VM concurrency safety -- The Goja runtime is not goroutine-safe. Added
sync.Mutexto protect all VM calls from concurrent gRPC hook invocations. - Add argument bounds checking to
btoa,atob,parseSQL-- Calling these helpers with no arguments from JS would panic with an index out of range. Now throws a JSTypeError. - Handle errors in
atobandparseSQL-- Invalid base64 input and SQL parse failures were silently swallowed. Now throw JSTypeErrorwith descriptive messages. - Switch
btoa/atobto standard base64 encoding -- Changed fromRawStdEncoding(no padding) toStdEncoding(with padding) for browser-compatible behavior.
Cleanup
- Fix metrics socket path -- Default was
gatewayd-plugin-cache.sock(copy-paste from cache plugin), now correctlygatewayd-plugin-js.sock. - Update plugin description -- Changed from stale "Template plugin" to actual description.
- Replace deprecated
golang.org/x/exp/maps-- Switched to stdlibmaps/slicespackages (Go 1.24).
CI/CD & Infrastructure
- Add CI workflow -- New
test.yamlwith golangci-lint, govulncheck, go test with coverage, and Coveralls reporting. - Add
.golangci.yaml-- Linter configuration withenable-alland depguard rules. - Update GitHub Actions --
actions/checkoutv3->v4,actions/setup-gov3->v5,softprops/action-gh-releasev1->v2.
Tests
- Add 32 unit tests -- Covers function registration,
RunFunction(success, not-found, JS error, wrong return type),GetHooks,GetPluginConfig, all 21 hook methods for passthrough and correct dispatch.
Full Changelog: v0.1.9...v0.2.0
v0.1.9
v0.1.8
v0.1.7
v0.1.6
v0.1.5
v0.1.4
v0.1.3
What's Changed
Full Changelog: v0.1.2...v0.1.3
v0.1.2
v0.1.1
This release is only forward-compatible with GatewayD v0.9.0.
What's Changed
Full Changelog: v0.1.0...v0.1.1