-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
repo reorg: move ext auth filters #2923
Changes from 4 commits
c2b9ff3
09bd787
eae210d
5a92d98
42149f5
ef216cb
ba3ea3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Repository layout overview | ||
|
||
This is a high level overview of how the repository is laid out to both aid in code investigation, | ||
as well as to clearly specify how extensions are added to the repository. The top level directories | ||
are: | ||
|
||
* [.circleci/](.circleci/): Configuration for [CircleCI](https://circleci.com/gh/envoyproxy). | ||
* [bazel/](bazel/): Configuration for Envoy's use of [Bazel](https://bazel.build/). | ||
* [ci/](ci/): Scripts used both during CI as well as to build Docker containers. | ||
* [configs/](configs/): Example Envoy configurations. | ||
* [docs/](docs/): Project level documentation is well as scripts for publishing final docs during | ||
releases. | ||
* [examples/](examples/): Larger Envoy examples using Docker and Docker Compose. | ||
* [include/](include/): "Public" interface headers for "core" Envoy (not extensions). In general, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a bit confusingly phrased, given it includes the interfaces for major extensions, i.e. tcp proxying, http stream etc. |
||
these are almost entirely 100% abstract classes. There are a few cases of not-abstract classes in | ||
the "public" headers, typically for performance reasons. | ||
* [restarter/](restarter/): Envoy's hot restart wrapper Python script. | ||
* [source/](source/): Source code for core Envoy as well as extensions. The layout of this directory | ||
is discussed in further detail below. | ||
* [support/](support/): Development support scripts (pre-commit Git hooks, etc.) | ||
* [test/](test/): Test code for core Envoy as well as extensions. The layout of this directory is | ||
discussed in further detail below. | ||
* [tools/](tools/): Miscellaneous tools that have not found a home somewhere else. | ||
|
||
## [source/](source/) | ||
|
||
* [common/](source/[common/): Core Envoy code (not specific to extensions) that is also not | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path typo? |
||
specific to a standalone server implementation. I.e., this is code that could be used if Envoy | ||
were eventually embedded as a library. | ||
* [docs/](source/docs/): Miscellaneous developer/design documentation that is not relevant for | ||
the public user documentation. | ||
* [exe/](source/exe/): Code specific to building the final production Envoy server binary. This is | ||
the only code that is not shared by integration and unit tests. | ||
* [extensions/](source/extensions/): Extensions to the core Envoy code. The layout of this | ||
directory is discussed in further detail below. | ||
* [server/](source/server/): Code specific to running Envoy as a standalone server. E.g, | ||
configuration, server startup, workers, etc. Overtime, the line between `common/` and `server/` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: "over time" |
||
has become somewhat blurred. Use best judgment as to where to place something. | ||
|
||
## [test/](test/) | ||
|
||
Not every directory within test is described below, but a few highlights: | ||
|
||
* Unit tests are found in directories matching their [source/](source/) equivalents. E.g., | ||
[common/](test/common/), [exe/](test/exe/), and [server/](test/server/). | ||
* Extension unit tests also match their source equivalents in [extensions/](test/extensions/). | ||
* [integration/](test/integration/) holds end-to-end integration tests using roughly the real | ||
Envoy server code, fake downstream clients, and fake upstream servers. Integration tests also | ||
test some of the extensions found in the repository. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem ideal, aren't we going to push these into the extension specific dirs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was my plan originally but @alyssawilk objected. Or maybe I misunderstood the objection @alyssawilk? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may - I'd asked we defer that until after the filter moves as I think there's a bunch of code which tests various filters, or tests core components (flow control) using extensions (various filters which buffer). It's pretty non-trivial to tease these out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, we've been organizing our HTTP tests around codec so you can "easily" add a cors test for HTTP/2, HTTP, HTTP/2 upstream etc. I think we need an integration test rewrite to make it easier to have "the cors filter test" which runs the test for the varions combinations and permutations, rather than having 3 integration tests per filter which would be really crummy from a scaling perspective. I think if we do that refactor we could encourage folks to add new integration tests under their filter directories, and move the easy-to-tease-apart tests to their directories for reference implementations. Still not sure how we want to handle testing core features which require filters without implementing a bunch of fake test filters (which we could totally do, but don't have yet) so I think this will be a series of TODOs and follow-up PRs. In the interim we could move the existing tests to http/common and network/common if we think it's worth an interim move. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I agree that more thinking is needed here. I would prefer that we not let "perfect be the enemy of the good" on this so I will add some aspirational text on where we would like this to go. |
||
* [mocks/](test/mocks/) contains mock implementations of all of the core Envoy interfaces found in | ||
[include/](include/). | ||
* Other directories include tooling used for configuration testing, coverage testing, fuzz testing, | ||
common test code, etc. | ||
|
||
## [source/extensions](source/extensions/) layout | ||
|
||
We maintain a very specific code and namespace layout for extensions. This aids in discovering | ||
code/extensions, and also will allow us in the future to more easily scale out our extension | ||
maintainers by having OWNERS files specific to certain extensions. (As of this writing, this is not | ||
currently implemented but that is the plan moving forward.) | ||
|
||
* All extensions are registered in [all_extensions.bzl](source/extensions/all_extensions.bzl). In | ||
the future this mechanism will easily allow us to compile out extensions based on build system | ||
configuration. This is not currently implemented but is the plan moving forward. | ||
* These are the top level extension directories and associated namespaces: | ||
* [access_loggers/](/source/extensions/access_loggers): Access log implementations which use | ||
the `Envoy::Extensions::AccessLoggers` namespace. | ||
* [http_tracers/](/source/extensions/http_tracers): HTTP tracers which use the | ||
`Envoy::Extensions::HttpTracers` namespace. | ||
* [filters/http/](/source/extensions/filters/http): HTTP L7 filters which use the | ||
`Envoy::Extensions::HttpFilters` namespace. | ||
* [filters/listener/](/source/extensions/filters/listener): Listener filters which use the | ||
`Envoy::Extensions::ListenerFilters` namespace. | ||
* [filters/network/](/source/extensions/filters/network): L4 network filters which use the | ||
`Envoy::Extensions::NetworkFilters` namespace. | ||
* [resolvers/](/source/extensions/resolvers): Network address resolvers which use the | ||
`Envoy::Extensions::Resolvers` namespace. | ||
* [stat_sinks/](/source/extensions/stat_sinks): Stat sink implementations which use the | ||
`Envoy::Extensions::StatSinks` namespace. | ||
* [transport_sockets/](/source/extensions/transport_sockets): Transport socket implementations | ||
which use the `Envoy::Extensions::TransportSockets` namespace. | ||
* Each extension is contained wholly in its own namespace. E.g., | ||
`Envoy::Extensions::NetworkFilters::Echo`. | ||
* Common code that is used by multiple extensions should be in a `common/` directory as close to | ||
the extensions as possible. E.g., [filters/common/](/source/extensions/filters/common) for common | ||
code that is used by both HTTP and network filters. Common code used only by two HTTP filters | ||
would be found in `filters/http/common/`. Common code should be placed in a common namespace. | ||
E.g., `Envoy::Extensions::Filters::Common`. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_cc_library", | ||
"envoy_package", | ||
) | ||
|
||
envoy_package() | ||
|
||
envoy_cc_library( | ||
name = "ext_authz", | ||
srcs = ["ext_authz.cc"], | ||
hdrs = ["ext_authz.h"], | ||
deps = [ | ||
"//include/envoy/http:codes_interface", | ||
"//source/common/common:assert_lib", | ||
"//source/common/common:empty_string", | ||
"//source/common/common:enum_to_int", | ||
"//source/common/http:codes_lib", | ||
"//source/common/router:config_lib", | ||
"//source/extensions/filters/common/ext_authz:ext_authz_lib", | ||
"@envoy_api//envoy/config/filter/http/ext_authz/v2:ext_authz_cc", | ||
], | ||
) | ||
|
||
envoy_cc_library( | ||
name = "config", | ||
srcs = ["config.cc"], | ||
hdrs = ["config.h"], | ||
deps = [ | ||
":ext_authz", | ||
"//include/envoy/registry", | ||
"//include/envoy/server:filter_config_interface", | ||
"//source/common/config:well_known_names", | ||
"//source/common/protobuf:utility_lib", | ||
], | ||
) |
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.
Nit: s/is well as/as well as/
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.
pinging this one. otherwise LGTM
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.
oops sorry missed it
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.
fixed