-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mobile: starting the repo merge with the assertion filter (#23761)
This PR sets up the directory structure, visibility rules, codeowners, adds E-M C++ tests to Envoy CI, and moves one extension over as a proof of concept. Risk Level: low Testing: ported test to Envoy CI. did not turn up platform CI yet Release Notes: inline Part of #23758 Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
- Loading branch information
1 parent
158a28b
commit f5b42d7
Showing
17 changed files
with
1,029 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
mobile/library/common/extensions/filters/http/assertion/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_cc_library", | ||
"envoy_mobile_package", | ||
"envoy_proto_library", | ||
) | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
envoy_mobile_package() | ||
|
||
envoy_proto_library( | ||
name = "filter", | ||
srcs = ["filter.proto"], | ||
deps = [ | ||
"@envoy_api//envoy/config/common/matcher/v3:pkg", | ||
], | ||
) | ||
|
||
envoy_cc_library( | ||
name = "assertion_filter_lib", | ||
srcs = ["filter.cc"], | ||
hdrs = ["filter.h"], | ||
repository = "@envoy", | ||
deps = [ | ||
"filter_cc_proto", | ||
"//envoy/http:codes_interface", | ||
"//envoy/http:filter_interface", | ||
"//source/common/http:header_map_lib", | ||
"//source/extensions/common/matcher:matcher_lib", | ||
"//source/extensions/filters/http/common:pass_through_filter_lib", | ||
], | ||
) | ||
|
||
envoy_cc_library( | ||
name = "config", | ||
srcs = ["config.cc"], | ||
hdrs = ["config.h"], | ||
repository = "@envoy", | ||
deps = [ | ||
":assertion_filter_lib", | ||
"//source/extensions/filters/http/common:factory_base_lib", | ||
], | ||
) |
29 changes: 29 additions & 0 deletions
29
mobile/library/common/extensions/filters/http/assertion/config.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "mobile/library/common/extensions/filters/http/assertion/config.h" | ||
|
||
#include "mobile/library/common/extensions/filters/http/assertion/filter.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace HttpFilters { | ||
namespace Assertion { | ||
|
||
Http::FilterFactoryCb AssertionFilterFactory::createFilterFactoryFromProtoTyped( | ||
const envoymobile::extensions::filters::http::assertion::Assertion& proto_config, | ||
const std::string&, Server::Configuration::FactoryContext&) { | ||
|
||
AssertionFilterConfigSharedPtr filter_config = | ||
std::make_shared<AssertionFilterConfig>(proto_config); | ||
return [filter_config](Http::FilterChainFactoryCallbacks& callbacks) -> void { | ||
callbacks.addStreamFilter(std::make_shared<AssertionFilter>(filter_config)); | ||
}; | ||
} | ||
|
||
/** | ||
* Static registration for the Assertion filter. @see NamedHttpFilterConfigFactory. | ||
*/ | ||
REGISTER_FACTORY(AssertionFilterFactory, Server::Configuration::NamedHttpFilterConfigFactory); | ||
|
||
} // namespace Assertion | ||
} // namespace HttpFilters | ||
} // namespace Extensions | ||
} // namespace Envoy |
34 changes: 34 additions & 0 deletions
34
mobile/library/common/extensions/filters/http/assertion/config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "source/extensions/filters/http/common/factory_base.h" | ||
|
||
#include "mobile/library/common/extensions/filters/http/assertion/filter.pb.h" | ||
#include "mobile/library/common/extensions/filters/http/assertion/filter.pb.validate.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace HttpFilters { | ||
namespace Assertion { | ||
|
||
/** | ||
* Config registration for the assertion filter. @see NamedHttpFilterConfigFactory. | ||
*/ | ||
class AssertionFilterFactory | ||
: public Common::FactoryBase<envoymobile::extensions::filters::http::assertion::Assertion> { | ||
public: | ||
AssertionFilterFactory() : FactoryBase("assertion") {} | ||
|
||
private: | ||
::Envoy::Http::FilterFactoryCb createFilterFactoryFromProtoTyped( | ||
const envoymobile::extensions::filters::http::assertion::Assertion& config, | ||
const std::string& stats_prefix, Server::Configuration::FactoryContext& context) override; | ||
}; | ||
|
||
DECLARE_FACTORY(AssertionFilterFactory); | ||
|
||
} // namespace Assertion | ||
} // namespace HttpFilters | ||
} // namespace Extensions | ||
} // namespace Envoy |
Oops, something went wrong.