yangjj-iso opened a new pull request, #7569:
URL: https://github.com/apache/shenyu/pull/7569
Closes #7561.
The default `AbstractShenyuWasmPlugin` now supplies a versioned UTF-8 JSON
bridge for real HTTP request metadata, cached plugin configuration, matched
selector/rule DTOs, and guest results. A subclass can use it by implementing
its name and order.
- Map `CONTINUE` results to chain continuation with optional
request/response header updates, and `REJECT` results to an HTTP 400–599
response with headers and a UTF-8 body.
- Negotiate complete input-buffer lengths without truncating JSON, cap
payloads at 1 MiB, and validate memory ranges, result schemas, UTF-8 and
headers. Invalid bridge calls or guest execution failures return HTTP 500
without continuing or applying guest changes.
- Serialize calls to an instance's guest memory, detach results before
continuing the reactive chain, expire invocation IDs in `finally`, and add
idempotent shutdown cleanup. Preserve the Consumer constructor and existing
custom-adapter invocation timing.
- Document the full input/result protocol, a Java/Rust example, and how the
normal configuration subscriber makes updates and deletions visible across
separately instantiated handlers/plugins. Add a reproducible WASM fixture that
changes its HTTP decision when the matched rule changes.
Validation: 105 tests passed across WASM API/base and
`CommonPluginDataSubscriberTest`, including 53 new tests. Checkstyle and Apache
RAT passed. Rebased onto the current upstream master.
```bash
./mvnw -pl shenyu-plugin/shenyu-plugin-wasm-base -am test \
'-Dtest=*Wasm*Test,Wasm*Test,CommonPluginDataSubscriberTest' \
-Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true
-Djacoco.skip=true
./mvnw -pl
shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-wasm-base
apache-rat:check
```
Make sure that:
- [x] You have read the [contribution
guidelines](https://shenyu.apache.org/community/contributor-guide).
- [x] You submit test cases (unit or integration tests) that back your
changes.
- [ ] Your local test passed `./mvnw clean install
-Dmaven.javadoc.skip=true` (targeted reactor tests above were run).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]