You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow http route and cluster metadata to contain typed metadata in Any in addition to Struct format #13986
Title: Allow route and cluster metadata to contain typed metadata in Any in addition to Struct format
Description:
Currently http route and cluster xds elements can have a metadata attached, which is nice. Unfortunately it is currently serialized using key-value format, for example:
filter_metadata {
key: "foo"
value {
fields {
key: "bar"
value {
string_value: "baz"
}
}
fields {
key: "field2"
value {
string_value: "val2"
}
}
It is inefficient from the point of view of serialization / deserialization, as well as visual representation.
It would be useful to be able to serialize metadata in 'Any' format like this:
typed_per_filter_config {
key: "com.example.foo"
value {
[type.example.com/foo] {
bar: "baz"
field2: "val2"
}
}
}
Yes, Struct-in-Any is the flexible arrangement here, and the ask makes sense, but I'd like to better understand what is proposed. For Envoy extensions, it makes sense to have Any as the baseline as the extensions necessarily have the proto descriptors linked in for configuration. How would we provide descriptors to Envoy in this use case? Would there be some explicit mechanism for supply descriptors? Would we expect that any extensions that consume the metadata have the descriptors available at link time?
We should also be cognizant of any JSON-implied interop with things like Wasm and where a dynamic JSON structure is expected in filters like RBAC (CC @PiotrSikora@kyessenov). This depends on how far we want to go with making Metadata Any, but I think we killed moving dynamic metadata to typed filter state in #4100.
I would proposed to put an Any alongside the Struct, and reusing the existing typedMetadata trick for structured config data stored in Route/Cluster metadata.
With Any we saved the deserialization from struct to protobuf, but we need some factories to validate the protobuf is correct during config loading, plus users could add more semantics to the data structure returned from the factory.
SG. I think the descriptors just need to be linked in somehow, but they don't need to be registered, protobuf takes care of static initialization of all linked descriptors.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
Activity
stevenzzzz commentedon Nov 11, 2020
to be exact, we want to make Metadata support protobuf.Any and possibly sunset use of Struct, in route and cluster metadata.
mattklein123 commentedon Nov 13, 2020
I think this is reasonable. In the past we have done this by allowing a struct to be contained within an Any. cc @envoyproxy/api-shepherds
htuch commentedon Nov 15, 2020
Yes, Struct-in-Any is the flexible arrangement here, and the ask makes sense, but I'd like to better understand what is proposed. For Envoy extensions, it makes sense to have Any as the baseline as the extensions necessarily have the proto descriptors linked in for configuration. How would we provide descriptors to Envoy in this use case? Would there be some explicit mechanism for supply descriptors? Would we expect that any extensions that consume the metadata have the descriptors available at link time?
We should also be cognizant of any JSON-implied interop with things like Wasm and where a dynamic JSON structure is expected in filters like RBAC (CC @PiotrSikora @kyessenov). This depends on how far we want to go with making Metadata Any, but I think we killed moving dynamic metadata to typed filter state in #4100.
efimki commentedon Nov 17, 2020
@htuch thanks for the great questions.
I'm not really sure about a proper way to implement this, so will appreciate any guidance.
Here are some ideas:
Can they be derived from
RouteSpecificFilterConfigand registered similarly?Yes, I think that would make sense.
stevenzzzz commentedon Nov 17, 2020
I would proposed to put an Any alongside the Struct, and reusing the existing typedMetadata trick for structured config data stored in Route/Cluster metadata.
With Any we saved the deserialization from struct to protobuf, but we need some factories to validate the protobuf is correct during config loading, plus users could add more semantics to the data structure returned from the factory.
htuch commentedon Nov 17, 2020
SG. I think the descriptors just need to be linked in somehow, but they don't need to be registered, protobuf takes care of static initialization of all linked descriptors.
github-actions commentedon Dec 18, 2020
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
stevenzzzz commentedon Dec 20, 2020
/nostale
nostale
stevenzzzz commentedon Dec 20, 2020
@htuch could you mark this as nonstale, we want this to show on our radar.
Allow http route and cluster metadata to contain typed metadata in An…
Allow http route and cluster metadata to contain typed metadata in Any (
Allow http route and cluster metadata to contain typed metadata in Any (
Allow http route and cluster metadata to contain typed metadata in Any (