(DNM) update WASM plugin to support http calls and return value of TSHttpTxnIsInternal() calls - #10359
(DNM) update WASM plugin to support http calls and return value of TSHttpTxnIsInternal() calls#10359thebadpete wants to merge 8 commits into
Conversation
shukitchan
left a comment
There was a problem hiding this comment.
Please take a look at my comments. Thanks.
| path = value; | ||
| } else if (key == ":authority") { | ||
| authority = value; | ||
| } else if (key == ":protocol") { |
There was a problem hiding this comment.
It should be ":scheme" instead according to
https://portswigger.net/burp/documentation/desktop/http2/http2-basics-for-burp-users
Please check out the section in pseudo-headers.
| } else if (path.substr(0, p_txn_is_internal.size()) == p_txn_is_internal) { | ||
| int internal = TSHttpTxnIsInternal(txnp_); | ||
| result->assign(reinterpret_cast<const char *>(&internal), sizeof(int)); | ||
| return WasmResult::Ok; |
There was a problem hiding this comment.
I am actually thinking of using foreign function instead for this. e.g. in envoy it has "compress and "uncompress" foreign function exposed to wasm modules.
This is how it is defined -
https://github.com/envoyproxy/envoy/blob/d12d47b05a832ce04d9130a869fa72f7ddbcef28/source/extensions/common/wasm/foreign.cc#L43
This is how it is used -
https://github.com/envoyproxy/envoy/blob/d12d47b05a832ce04d9130a869fa72f7ddbcef28/test/extensions/common/wasm/test_data/test_cpp.cc#L158
Please take a look and see if we can implement this using foreign function
|
And let's move this PR to draft for now till it is ready. |
|
closing this pr for now, will refile after addressing the feeedback |
No description provided.