Skip to content

Releases: gatewayd-io/gatewayd-plugin-js

v0.2.0

Choose a tag to compare

@mostafa mostafa released this 21 Feb 21:56
73b850d

What's Changed

Bug Fixes

  • Fix OnNewPool dispatching to wrong JS function -- OnNewPool was calling "onConfigLoaded" instead of "onNewPool" due to a copy-paste bug, causing pool-related JS hooks to silently run the wrong handler.
  • Fix OnTraffic swallowing errors -- OnTraffic was returning nil instead of the error from RunFunction, 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.Mutex to 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 JS TypeError.
  • Handle errors in atob and parseSQL -- Invalid base64 input and SQL parse failures were silently swallowed. Now throw JS TypeError with descriptive messages.
  • Switch btoa/atob to standard base64 encoding -- Changed from RawStdEncoding (no padding) to StdEncoding (with padding) for browser-compatible behavior.

Cleanup

  • Fix metrics socket path -- Default was gatewayd-plugin-cache.sock (copy-paste from cache plugin), now correctly gatewayd-plugin-js.sock.
  • Update plugin description -- Changed from stale "Template plugin" to actual description.
  • Replace deprecated golang.org/x/exp/maps -- Switched to stdlib maps/slices packages (Go 1.24).

CI/CD & Infrastructure

  • Add CI workflow -- New test.yaml with golangci-lint, govulncheck, go test with coverage, and Coveralls reporting.
  • Add .golangci.yaml -- Linter configuration with enable-all and depguard rules.
  • Update GitHub Actions -- actions/checkout v3->v4, actions/setup-go v3->v5, softprops/action-gh-release v1->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

Choose a tag to compare

@github-actions github-actions released this 07 Aug 15:48
9ed4826

What's Changed

Full Changelog: v0.1.8...v0.1.9

v0.1.8

Choose a tag to compare

@github-actions github-actions released this 18 May 12:52
984b672

Full Changelog: v0.1.7...v0.1.8

v0.1.7

Choose a tag to compare

@github-actions github-actions released this 09 Nov 12:31
07676bc

What's Changed

Full Changelog: v0.1.6...v0.1.7

v0.1.6

Choose a tag to compare

@github-actions github-actions released this 17 May 11:33
2dfc993

What's Changed

Full Changelog: v0.1.5...v0.1.6

v0.1.5

Choose a tag to compare

@github-actions github-actions released this 08 Apr 20:33
0407d48

What's Changed

Full Changelog: v0.1.4...v0.1.5

v0.1.4

Choose a tag to compare

@github-actions github-actions released this 05 Apr 21:49
c6084b4

What's Changed

Full Changelog: v0.1.3...v0.1.4

v0.1.3

Choose a tag to compare

@github-actions github-actions released this 15 Mar 10:05
95135f0

What's Changed

Full Changelog: v0.1.2...v0.1.3

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 05 Mar 16:52
1059901

What's Changed

Full Changelog: v0.1.1...v0.1.2

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 03 Mar 15:41
43242c1

This release is only forward-compatible with GatewayD v0.9.0.

What's Changed

Full Changelog: v0.1.0...v0.1.1