Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

implement declare_property #482

Merged
merged 6 commits into from
Apr 17, 2020
Merged

Conversation

kyessenov
Copy link
Contributor

@kyessenov kyessenov commented Apr 13, 2020

Signed-off-by: Kuat Yessenov kuat@google.com

Implements declare_property FFI.
Fixes #479

The following is a canonical example:

  1. root context: declare_property(x, { serialized schema })
  2. request context: set_property({"x"}, { serialized content })
  3. request context: get_property({"x", "y"}, &value)

Changes:
Getting a filter state property requires using the same path used in set_property. This is simpler, and cleaner.

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov
Copy link
Contributor Author

Will need to cherry pick on istio/envoy after merge.

@@ -266,6 +269,14 @@ class Context : public proxy_wasm::ContextBase,
absl::optional<google::api::expr::runtime::CelValue>
FindValue(absl::string_view name, Protobuf::Arena* arena) const override;
bool IsPathUnknown(absl::string_view) const override { return false; }
const std::vector<google::api::expr::runtime::CelAttributePattern>&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a using declaration for CellAttributePattern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go away once I get cel-cpp updated. I had difficulty merging the base class definitions.

if (initialized_) {
switch (type_) {
case WasmType::String:
return google::api::expr::runtime::CelValue::CreateString(&value_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a using declaration.

@kyessenov
Copy link
Contributor Author

@PiotrSikora do you have any comments?

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
@jplevyak jplevyak merged commit 594926b into envoyproxy:master Apr 17, 2020
kyessenov added a commit to istio/envoy that referenced this pull request Apr 17, 2020
Signed-off-by: Kuat Yessenov <kuat@google.com>
howardjohn pushed a commit to istio/envoy that referenced this pull request Apr 17, 2020
Signed-off-by: Kuat Yessenov <kuat@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ABI extension: declare_property
2 participants