Skip to content

Pass plugin key from embedders to PluginBase. #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions include/proxy-wasm/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ class WasmVm;
* @param vm_id is a string used to differentiate VMs with the same code and VM configuration.
* @param plugin_configuration is configuration for this plugin.
* @param fail_open if true the plugin will pass traffic as opposed to close all streams.
* @param key is used for caching PluginHandleBase per thread and determining whether to create a
* new PluginHandleBase.
*/
struct PluginBase {
PluginBase(std::string_view name, std::string_view root_id, std::string_view vm_id,
std::string_view runtime, std::string_view plugin_configuration, bool fail_open)
std::string_view runtime, std::string_view plugin_configuration, bool fail_open,
std::string_view key)
: name_(std::string(name)), root_id_(std::string(root_id)), vm_id_(std::string(vm_id)),
runtime_(std::string(runtime)), plugin_configuration_(plugin_configuration),
fail_open_(fail_open), key_(root_id_ + "||" + plugin_configuration_),
log_prefix_(makeLogPrefix()) {}
fail_open_(fail_open), key_(key), log_prefix_(makeLogPrefix()) {}

const std::string name_;
const std::string root_id_;
Expand Down