• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Kong / ngx_wasm_module
91%
main: 95%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/acifani/setup-tinygo-2.0.1
DEFAULT BRANCH: main
Repo Added 31 Jan 2023 11:06PM UTC
Files 53
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH feat/ffi-properties-2
branch: feat/ffi-properties-2
CHANGE BRANCH
x
Reset
  • feat/ffi-properties-2
  • bazel-cargo
  • chore/cargo-updates
  • chore/ci-lcov-ignore
  • chore/codeql-fix
  • chore/dependabot-ignore-wasi
  • chore/dependabot-updates
  • chore/nginx-bump
  • dependabot/cargo/t/lib/blake3-1.5.5
  • dependabot/cargo/t/lib/proxy-wasm-tests/hostcalls/production-dependencies-2c08c6e7c0
  • dependabot/cargo/t/lib/proxy-wasm-tests/rust-sdk-ver-zero-one/production-dependencies-2c08c6e7c0
  • dependabot/github_actions/codecov/codecov-action-5
  • dependabot/github_actions/codecov/codecov-action-5.3.1
  • dependabot/github_actions/codecov/codecov-action-5.4.0
  • dependabot/github_actions/codecov/codecov-action-5.4.2
  • dependabot/github_actions/coverallsapp/github-action-2.3.6
  • feat/request.is_subrequest-merge
  • feat/wasi-stubs
  • feat/wasm-foreign-function
  • feat/wasm-foreign-function-merge
  • fix/free-plan-struct
  • fix/on-vm-start-args
  • fix/plugin-name-property
  • fix/scoped-properties
  • main
  • pin_actions
  • tests/investigate-proxy-failures

17 Nov 2023 08:27PM UTC coverage: 90.964%. First build
6934996957

Pull #431

github

hishamhm
feat(proxy-wasm) host-managed property getters and setters

This feature adds support for host-managed property getter and
setter functions.

These feature is implemented in three stages:

* `ngx_proxy_wasm_properties.c`: in our implementation for
  proxy-wasm properties, we now allow the host to specify a
  function which gets called whenever proxy-wasm receives a
  `set_property` or `get_property` call matching the host-defined
  namespace. Those getter and setter functions are then responsible
  to return and store the values, and are able to produce any
  desired side-effects in the host.

* `ngx_wasm_lua_ffi.c`: We then expose this functionality in our
  Lua FFI interface. This is a lightweight wrapper, which accepts
  a C function pointer directly, and associates this function
  to the request context object.

* `lib/resty/wasmx/proxy_wasm.lua`: Finally, we expose a Lua API
  for setting a Lua functions as setters and getters. The interface
  is such that the host Lua program should set one setter function
  and/or getter function, and then within that function properly
  dispatch the behavior based on the received key. Internally, these
  functions use the fact that LuaJIT is able to convert a Lua
  function into a C function pointer. Due to lifetime management,
  those generated C callbacks are a limited resource in the LuaJIT
  VM, so we produce a single pair of these and then have them
  call the user-defined Lua function, which remains as a normal
  Lua closure. (See http://luajit.org/ext_ffi_semantics.html for
  more details on LuaJIT FFI C callback managment.)

To ensure that the lifetime of strings produced by the host continue
valid by the time the getter callback finished running and the Wasm
engine reads the properties, getter/setter-produced values continue
to be stored in the rbtree for host properties that we already had
for plain `get_property`/`set_property`, introduced in da820875ed7.

Since we need to store this data on the C s... (continued)
Pull Request #431: feat(proxy-wasm) host-managed property getters and setters

74 of 82 new or added lines in 2 files covered. (90.24%)

7671 of 8433 relevant lines covered (90.96%)

18097.35 hits per line

Relevant lines Covered
Build:
Build:
8433 RELEVANT LINES 7671 COVERED LINES
18097.35 HITS PER LINE
Source Files on feat/ffi-properties-2
  • Tree
  • List 46
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
6934996957 feat/ffi-properties-2 feat(proxy-wasm) host-managed property getters and setters This feature adds support for host-managed property getter and setter functions. These feature is implemented in three stages: * `ngx_proxy_wasm_properties.c`: in our implementation for... Pull #431 20 Nov 2023 07:51PM UTC hishamhm github
90.96
See All Builds (1355)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc