Skip to content

Commit c9760d1

Browse files
authored
Pass plugin key from embedders to PluginBase. (#178)
Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 7b64da1 commit c9760d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/proxy-wasm/context.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ class WasmVm;
4545
* @param vm_id is a string used to differentiate VMs with the same code and VM configuration.
4646
* @param plugin_configuration is configuration for this plugin.
4747
* @param fail_open if true the plugin will pass traffic as opposed to close all streams.
48+
* @param key is used to uniquely identify this plugin instance.
4849
*/
4950
struct PluginBase {
5051
PluginBase(std::string_view name, std::string_view root_id, std::string_view vm_id,
51-
std::string_view runtime, std::string_view plugin_configuration, bool fail_open)
52+
std::string_view runtime, std::string_view plugin_configuration, bool fail_open,
53+
std::string_view key)
5254
: name_(std::string(name)), root_id_(std::string(root_id)), vm_id_(std::string(vm_id)),
5355
runtime_(std::string(runtime)), plugin_configuration_(plugin_configuration),
54-
fail_open_(fail_open), key_(root_id_ + "||" + plugin_configuration_),
56+
fail_open_(fail_open),
57+
key_(root_id_ + "||" + plugin_configuration_ + "||" + std::string(key)),
5558
log_prefix_(makeLogPrefix()) {}
5659

5760
const std::string name_;

0 commit comments

Comments
 (0)