-
Notifications
You must be signed in to change notification settings - Fork 84
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
filters: add initial support for bridged filters #940
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, some comments (and it'd be great if we could add tests)
library/common/extensions/filters/http/platform_extension/bridging_filter.cc
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/bridging_filter.cc
Outdated
Show resolved
Hide resolved
library/common/config_template.cc
Outdated
- name: envoy.filters.http.platform_extension | ||
typed_config: | ||
"@type": type.googleapis.com/envoymobile.extensions.filters.http.platform_extension.Bridging | ||
name: PlatformStub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment from #883 (comment) applies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same as below)
This particular part won't ever really be publicly exposed/used. But I do intend to make a documentation PR that fully describes how to create and use platform extensions.
library/common/extensions/filters/http/platform_extension/bridging_filter.h
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/c_types.h
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/config.h
Outdated
Show resolved
Hide resolved
message Bridging { | ||
string name = 1 [(validate.rules).string.min_bytes = 1]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document how this works/is intended to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular part won't ever really be publicly exposed/used. But I do intend to make a documentation PR that fully describes how to create and use platform extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! Some comments
|
||
namespace Envoy { | ||
namespace Api { | ||
namespace External { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace External { | |
namespace PlatformExtension { |
I think this meshes well with the rest of the PR, because it tells us that these function signatures allow us to register any platform extension api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - it may be obvious that I waffled a bit on naming and "external" was just a possibility I considered, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I've updated everything else to standardize on PlatformBridge
, I actually think this should remain External
. Any API external to the library could be registered here, but everything labeled PlatformBridge
relates specifically to bridging up to a platform runtime environment.
library/common/extensions/filters/http/platform_extension/c_types.h
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/c_types.h
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/bridging_filter.cc
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/bridging_filter.cc
Outdated
Show resolved
Hide resolved
library/common/extensions/filters/http/platform_extension/bridging_filter.cc
Outdated
Show resolved
Hide resolved
This update adds an optimized path for no-op filter callbacks, as well as allowing calloc to trivially create a no-op filter - utilized here as a PlatformStub implementation. It also factors out common callback logic on the request and response path for headers. |
With this the PR should be functionally green, once upstream can be updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 2 small call outs, but feel free to merge so we can iterate on main!
library/common/extensions/filters/http/platform_bridge/c_types.h
Outdated
Show resolved
Hide resolved
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Finally rebased on upstream Envoy update. |
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
CI is green; proceeding with merge (with previous approvals). |
Description: Missed this request from @junr03 on #940. Risk Level: Low Testing: Local and CI Signed-off-by: Mike Schore <[email protected]>
Description: Adds support for platform-bridged filter implementations at the common and bridge layers of the library. Includes a stub implementation hardcoded into configuration. Dynamic configuration and data support, with platform-specific presentations, to come.
Risk Level: Moderate
Testing: Local end-to-end
Signed-off-by: Mike Schore [email protected]