Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
55ea9a2
Add 'age' and 'expires' inline headers to support HTTP caching (#868).
toddmgreer May 16, 2019
f1a89f4
Add an incomplete pluggable HTTP caching filter (CacheFilter). (#868)
toddmgreer Jun 6, 2019
d5bb1c5
Add cache/config to BUILD file.
toddmgreer Jun 7, 2019
72f3bea
Fix formatting.
toddmgreer Jun 7, 2019
0611bed
Fix spelling, and expand spellcheck's dictionary.
toddmgreer Jun 7, 2019
3123971
Rename config_lib to config.
toddmgreer Jun 8, 2019
424e5bc
Add some RFC terms to spelling_dictionary.txt.
toddmgreer Jun 8, 2019
d77ff8c
Address clang-tidy findings.
toddmgreer Jun 10, 2019
b144193
Remove cache_filter_test until it has actual tests to run.
toddmgreer Jun 11, 2019
ee2431a
Address first batch of comments. More to come.
toddmgreer Jun 19, 2019
f432612
Style cleanups requested in first review, and a few more unit tests.
toddmgreer Jun 21, 2019
1ac7e7a
Comment helper functions.
toddmgreer Jun 21, 2019
3bb2056
Use absl::flat_hash_map instead of std::unordered_map.
toddmgreer Jun 21, 2019
f490c86
Fix formatting and spelling.
toddmgreer Jun 21, 2019
bfdf8ee
Add scheme checks to isCacheableRequest; misc cleanup.
toddmgreer Jun 21, 2019
1442b8c
Add cache-control parsing TODO, and fix eatLeadingDuration's arg type.
toddmgreer Jun 21, 2019
ef53f4c
Fix SystemTime subtraction underflow, and improve tests.
toddmgreer Jun 25, 2019
b4ceab6
Add owners.
toddmgreer Jun 26, 2019
45a9f45
Merge remote-tracking branch 'upstream/master'
toddmgreer Jun 26, 2019
7bf20cd
Fix formatting.
toddmgreer Jun 26, 2019
963f433
Merge remote-tracking branch 'upstream/master'
toddmgreer Sep 6, 2019
d1b272d
Add an empty api_proto_package to please check_format.
toddmgreer Sep 6, 2019
9231814
Delete redundant absl deps.
toddmgreer Sep 6, 2019
a1fdd9b
Merge remote-tracking branch 'upstream/master'
toddmgreer Sep 6, 2019
4812257
Return '{}' instead of 'SystemTime()', per modernize-return-braced-in…
toddmgreer Sep 7, 2019
4ffced5
Prevent creation of an HttpCacheFilter that isn't owned by a shared_p…
toddmgreer Sep 17, 2019
6f3a221
Add CacheFilterFactory tests.
toddmgreer Sep 17, 2019
f2bf5cb
Fix formatting.
toddmgreer Sep 17, 2019
828331b
Fix formatting.
toddmgreer Sep 17, 2019
eda41c7
Fix formatting, this time with the right version of clang-format.
toddmgreer Sep 17, 2019
56f6434
Add tests for RawByteRange
capoferro Sep 23, 2019
8cc9562
Add tests for AdjustedByteRange.
capoferro Sep 23, 2019
3e16e8d
Label death tests appropriately
capoferro Sep 23, 2019
11e1520
Add assert tests for request headers in LookupRequest
capoferro Sep 23, 2019
d076283
Add tests for fallback header 'expired'
capoferro Sep 23, 2019
afc4523
Add CacheFilter test.
toddmgreer Sep 26, 2019
969ee2f
Fix incorrect naming style.
toddmgreer Sep 26, 2019
68995c3
Merge commit '81460d8482b73ba70ea15b76163a7c645e2a7b96'
toddmgreer Sep 26, 2019
d5edfae
Format fix.
toddmgreer Sep 26, 2019
f3161a2
Merge commit '51757dca1df458c78e63cccc6e7d0f357082bff0'
toddmgreer Oct 1, 2019
705c573
Remove death tests and unnecessary suite classes
capoferro Oct 2, 2019
80d3438
Merge pull request #1 from capoferro/raw_byte_range_test
toddmgreer Oct 17, 2019
024a072
Merge branch 'master' into master
toddmgreer Nov 13, 2019
7444101
Add cache filter to HttpFilterNameValues.
toddmgreer Nov 28, 2019
db1d528
Use HttpFilterNameValues::Cache in CacheFilterFactory
toddmgreer Nov 28, 2019
b72afdf
Make CacheFilter Loggable.
toddmgreer Nov 28, 2019
2697008
Use HeaderMap::ForwardedProto instead of Scheme in cache key, because…
toddmgreer Nov 28, 2019
a30a784
Add CacheFilter integration test.
toddmgreer Nov 28, 2019
c8dafa0
Fix formatting
toddmgreer Nov 28, 2019
8ff6ae4
Merge branch 'master' of github.com:toddmgreer/envoy
toddmgreer Nov 28, 2019
03e1908
buildozer and spelling fixes
toddmgreer Nov 28, 2019
8d44962
Adapted to upstream changes:
toddmgreer Nov 28, 2019
4d3d57e
Minor cleanups
toddmgreer Nov 28, 2019
84a8532
Change AdjustByteRange to use C++-style half-open intervals instead o…
toddmgreer Dec 11, 2019
463994a
Explain reason to use std::enable_shared_from_this.
toddmgreer Dec 11, 2019
48f046b
Clarify and comment out range handling code that can't yet be reached.
toddmgreer Dec 12, 2019
03d1156
Style fixes.
toddmgreer Dec 13, 2019
473e8fe
Make Cache.name required.
toddmgreer Dec 13, 2019
259b755
Handle unexpected onBody callbacks.
toddmgreer Dec 13, 2019
0097e24
Make adjustByteRangeSet public, with unit tests.
toddmgreer Dec 31, 2019
296a420
Use class instead of namespace in http_cache_utils, per reviewer requ…
toddmgreer Jan 3, 2020
e83d95a
Make CacheFilter's internal helper functions static members, per envo…
toddmgreer Jan 3, 2020
a0af25b
Add effectiveMaxAge tests.
toddmgreer Jan 3, 2020
e5c030e
Merge commit 'eb9e13626830ad46a9c754035db3fa81b32a8f82' into HEAD
toddmgreer Jan 3, 2020
a249ff6
Merge commit '2591deacb306ec665812b1cf18fcaee57247ffd1' into HEAD
toddmgreer Jan 6, 2020
3a9406a
Adapt to HeaderMap changes.
toddmgreer Jan 6, 2020
6f91e36
Adapt to proto rules changes.
toddmgreer Jan 6, 2020
c1bb3a3
Add security_posture and status.
toddmgreer Jan 7, 2020
aaf9ad9
Add placeholder .rst
toddmgreer Jan 7, 2020
2b33348
Move from v3alpha to v2, per htuch.
toddmgreer Jan 7, 2020
39064e8
Fix rst file
toddmgreer Jan 7, 2020
aebd8ca
Add to http_filter.rst
toddmgreer Jan 7, 2020
d24a316
Fix formatting
toddmgreer Jan 7, 2020
7a05205
Revert accidentally reformatted codec_impl.cc (partial revert of 84a8…
toddmgreer Jan 9, 2020
4d0209f
Merge branch 'master' into master
toddmgreer Jan 9, 2020
d50765c
Change query_strings whitelist/blacklist to use oneof, and rename for…
toddmgreer Jan 9, 2020
a82a214
Improve config docs.
toddmgreer Jan 10, 2020
34b14c2
Uncomment unimplemented fields in cache.proto, since the formatting t…
toddmgreer Jan 11, 2020
29d50d1
Fix wrong BUILD deps incantation
toddmgreer Jan 11, 2020
02c012f
Add proto migration annotations
toddmgreer Jan 15, 2020
8925c4f
Unify range TODO
toddmgreer Jan 15, 2020
eec7683
Add generated BUILD/proto files.
toddmgreer Jan 15, 2020
3bfe116
Fix TODO formatting
toddmgreer Jan 15, 2020
f209aef
Use FALLTHRU macro
toddmgreer Jan 15, 2020
12876b3
Simplified HttpTimeTest to make it clear that it checks the results o…
toddmgreer Jan 15, 2020
064e083
Added _ to struct member variable names.
toddmgreer Jan 15, 2020
1782f2c
Add integration test TODO to test unimplemented features.
toddmgreer Jan 15, 2020
9e5c10f
Remove unneeded dictionary addition
toddmgreer Jan 15, 2020
cffcc02
Rename envoy::config::filter::http::cache::v2::Cache to envoy::config…
toddmgreer Jan 15, 2020
9f4a1c6
Add overview doc.
toddmgreer Jan 16, 2020
c796d4d
Change v3alpha to v3
toddmgreer Jan 16, 2020
dc05534
Use api.v2.route.QueryParameterMatcher to specify query params for keys.
toddmgreer Jan 17, 2020
118191f
Use StringMatcher for allowed_vary_headers.
toddmgreer Jan 17, 2020
a2a9ae6
Add an overview of writing a cache storage implementation
toddmgreer Jan 17, 2020
0ce2a64
Highlight field names in comments
toddmgreer Jan 17, 2020
dd0703f
Comment out TODO comments.
toddmgreer Jan 17, 2020
4304cbc
Only create date format strings once.
toddmgreer Jan 17, 2020
05c0566
simplify decl w/ auto
toddmgreer Jan 17, 2020
1bc5928
Minor doc improvements; use reverse DNS for cache storage implementat…
toddmgreer Jan 21, 2020
6885b82
*-highlight "vary" in comments.
toddmgreer Jan 21, 2020
3f128e3
Correct missed SimpleHttpCache to envoy.extensions.http.cache.simple …
toddmgreer Jan 21, 2020
9b1c68a
Update source/extensions/filters/http/cache/http_cache.h
toddmgreer Jan 22, 2020
4585b14
Addressing review comments from mattklien123
toddmgreer Jan 22, 2020
f09822b
Add typed_config, and use getAndCheckFactory.
toddmgreer Jan 22, 2020
dbbcbd1
Pass config into cache storage implementations.
toddmgreer Jan 22, 2020
386c18b
Put CacheConfig in v3
toddmgreer Jan 23, 2020
adb947e
Elaborated on the effects of allowed_vary_headers.
toddmgreer Jan 23, 2020
1903ae0
Fix test error due to no longer requiring CacheConfig.name
toddmgreer Jan 23, 2020
4f26ac8
Reran tools/proto_format.sh fix
toddmgreer Jan 23, 2020
2028b99
Update v2->v3
toddmgreer Jan 23, 2020
56ebd02
Fix various v2->v3 issues
toddmgreer Jan 24, 2020
8e10a41
bazel build -c fastbuild @envoy_api_canonical//envoy/... now works
toddmgreer Jan 24, 2020
063ba6d
Revert v3 changes
toddmgreer Jan 24, 2020
50d20a6
Revert "Update v2->v3"
toddmgreer Jan 24, 2020
fdbc1c5
Revert "Reran tools/proto_format.sh fix"
toddmgreer Jan 24, 2020
353e8a8
Revert "Put CacheConfig in v3"
toddmgreer Jan 24, 2020
4027ab3
Got 'tools/proto_format.sh fix' to run successfully.
toddmgreer Jan 24, 2020
3ebf4f2
Merge remote-tracking branch 'upstream/master'
toddmgreer Jan 24, 2020
1b73cf0
tools/proto_format.sh fix
toddmgreer Jan 24, 2020
62d01c8
Adapt to upstream factory changes
toddmgreer Jan 24, 2020
c0223c3
Comment out rst docs about unenabled config fields, to avoid dangling…
toddmgreer Jan 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ proto_library(
"//envoy/config/filter/accesslog/v2:accesslog",
"//envoy/config/filter/dubbo/router/v2alpha1:router",
"//envoy/config/filter/http/buffer/v2:buffer",
"//envoy/config/filter/http/cache/v2alpha:cache",
"//envoy/config/filter/http/csrf/v2:csrf",
"//envoy/config/filter/http/ext_authz/v2:ext_authz",
"//envoy/config/filter/http/fault/v2:fault",
Expand Down
8 changes: 8 additions & 0 deletions api/envoy/config/filter/http/cache/v2alpha/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library_internal")

licenses(["notice"]) # Apache 2

api_proto_library_internal(
name = "cache",
srcs = ["cache.proto"],
)
47 changes: 47 additions & 0 deletions api/envoy/config/filter/http/cache/v2alpha/cache.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
syntax = "proto3";

package envoy.config.filter.http.cache.v2alpha;

option java_package = "io.envoyproxy.envoy.config.filter.http.cache.v2alpha";
option java_outer_classname = "CacheProto";
option java_multiple_files = true;
// [#protodoc-title: HTTP Cache Filter]
// `Design<https://docs.google.com/document/d/1WPuim_GzhfdsnIj_tf-fIeutK0jO4aVQfVrLJFoLN3g/view>`_
// [#proto-status: experimental]

message Cache {

// Name of cache implementation to use.
string name = 1;

// List of allowed Vary headers. These headers will be provided to caches in lookups, and the
// cache filter will only insert responses whose Vary headers (if any) are all in this list. For
// example, if an origin supplies "vary:user-agent" in a response, the response will only be
// inserted if "user-agent" is in this list.
repeated string allowed_vary_headers = 2;

message KeyCreatorParams {
// If true, exclude the URL scheme from the cache key.
bool exclude_scheme = 1;

// If true, exclude the host from the cache key.
bool exclude_host = 2;

// If true, treat query_string_keys as a whitelist.
// If false, treat query_string_keys as a blacklist.
bool query_string_keys_whitelist = 3;

// The list of query string keys, to be treated as a whitelist/blacklist
// depending on the value of query_string_keys_whitelist.
// If your origins ignore all but a few query params, list them here and set
// query_string_keys_whitelist to true.
// If your origins only pay attention to a few params, list them here and
// leave query_string_keys_whitelist as false.
// If your origins ignore the query string entirely, leave this empty and
// set query_string_keys_whitelist to true.
// If you don't know what query params your origins may pay attention to,
// leave both query_string fields at their false/empty defaults.
repeated string query_string_keys = 4;
}
KeyCreatorParams key_creator_params = 3;
}
1 change: 1 addition & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ PROTO_RST="
/envoy/config/filter/http/health_check/v2/health_check/envoy/config/filter/http/health_check/v2/health_check.proto.rst
/envoy/config/filter/http/header_to_metadata/v2/header_to_metadata/envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.proto.rst
/envoy/config/filter/http/ip_tagging/v2/ip_tagging/envoy/config/filter/http/ip_tagging/v2/ip_tagging.proto.rst
/envoy/config/filter/http/cache/v2alpha/cache/envoy/config/filter/http/cache/v2alpha/cache.proto.rst
/envoy/config/filter/http/jwt_authn/v2alpha/jwt_authn/envoy/config/filter/http/jwt_authn/v2alpha/config.proto.rst
/envoy/config/filter/http/lua/v2/lua/envoy/config/filter/http/lua/v2/lua.proto.rst
/envoy/config/filter/http/original_src/v2alpha1/original_src/envoy/config/filter/http/original_src/v2alpha1/original_src.proto.rst
Expand Down
2 changes: 2 additions & 0 deletions include/envoy/http/header_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class HeaderEntry {
HEADER_FUNC(AccessControlAllowCredentials) \
HEADER_FUNC(AccessControlExposeHeaders) \
HEADER_FUNC(AccessControlMaxAge) \
HEADER_FUNC(Age) \
HEADER_FUNC(Authorization) \
HEADER_FUNC(CacheControl) \
HEADER_FUNC(ClientTraceId) \
Expand Down Expand Up @@ -310,6 +311,7 @@ class HeaderEntry {
HEADER_FUNC(EnvoyUpstreamServiceTime) \
HEADER_FUNC(Etag) \
HEADER_FUNC(Expect) \
HEADER_FUNC(Expires) \
HEADER_FUNC(ForwardedClientCert) \
HEADER_FUNC(ForwardedFor) \
HEADER_FUNC(ForwardedProto) \
Expand Down
2 changes: 2 additions & 0 deletions source/common/http/headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class HeaderValues {
const LowerCaseString AccessControlExposeHeaders{"access-control-expose-headers"};
const LowerCaseString AccessControlMaxAge{"access-control-max-age"};
const LowerCaseString AccessControlAllowCredentials{"access-control-allow-credentials"};
const LowerCaseString Age{"age"};
const LowerCaseString Authorization{"authorization"};
const LowerCaseString ProxyAuthenticate{"proxy-authenticate"};
const LowerCaseString ProxyAuthorization{"proxy-authorization"};
Expand Down Expand Up @@ -72,6 +73,7 @@ class HeaderValues {
const LowerCaseString EnvoyDecoratorOperation{"x-envoy-decorator-operation"};
const LowerCaseString Etag{"etag"};
const LowerCaseString Expect{"expect"};
const LowerCaseString Expires{"expires"};
const LowerCaseString ForwardedClientCert{"x-forwarded-client-cert"};
const LowerCaseString ForwardedFor{"x-forwarded-for"};
const LowerCaseString ForwardedHost{"x-forwarded-host"};
Expand Down
1 change: 1 addition & 0 deletions source/extensions/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ EXTENSIONS = {
#

"envoy.filters.http.buffer": "//source/extensions/filters/http/buffer:config",
"envoy.filters.http.cache": "//source/extensions/filters/http/cache:config",
"envoy.filters.http.cors": "//source/extensions/filters/http/cors:config",
"envoy.filters.http.csrf": "//source/extensions/filters/http/csrf:config",
"envoy.filters.http.dynamo": "//source/extensions/filters/http/dynamo:config",
Expand Down
95 changes: 95 additions & 0 deletions source/extensions/filters/http/cache/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
licenses(["notice"]) # Apache 2

## Pluggable HTTP cache filter

load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_package",
"envoy_proto_library",
)

envoy_package()

envoy_cc_library(
name = "cache_filter_lib",
srcs = ["cache_filter.cc"],
hdrs = ["cache_filter.h"],
deps = [
":http_cache_lib",
"//include/envoy/registry",
"//source/common/common:macros",
"//source/common/http:header_map_lib",
"//source/common/http:headers_lib",
"//source/common/protobuf",
"//source/extensions/filters/http/common:pass_through_filter_lib",
"@envoy_api//envoy/config/filter/http/cache/v2alpha:cache_cc",
],
)

envoy_cc_library(
name = "config",
srcs = ["config.cc"],
hdrs = ["config.h"],
deps = [
":cache_filter_lib",
":key_cc",
"//include/envoy/common:time_interface",
"//include/envoy/registry",
"//include/envoy/stats:stats_interface",
"//source/extensions/filters/http/common:factory_base_lib",
],
)

envoy_proto_library(
name = "key",
srcs = ["key.proto"],
)

envoy_cc_library(
name = "http_cache_lib",
srcs = ["http_cache.cc"],
hdrs = ["http_cache.h"],
deps = [
":http_cache_utils_lib",
":key_cc",
"//include/envoy/buffer:buffer_interface",
"//include/envoy/common:time_interface",
"//include/envoy/http:header_map_interface",
"//source/common/common:assert_lib",
"//source/common/http:headers_lib",
"//source/common/protobuf:utility_lib",
],
)

envoy_cc_library(
name = "http_cache_utils_lib",
srcs = ["http_cache_utils.cc"],
hdrs = ["http_cache_utils.h"],
deps = [
"//include/envoy/http:header_map_interface",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
Comment thread
toddmgreer marked this conversation as resolved.
Outdated
],
)

envoy_cc_library(
name = "simple_http_cache_lib",
srcs = ["simple_http_cache.cc"],
hdrs = ["simple_http_cache.h"],
deps = [
":http_cache_lib",
"//include/envoy/registry",
"//include/envoy/runtime:runtime_interface",
"//source/common/buffer:buffer_lib",
"//source/common/common:macros",
"//source/common/common:thread_lib",
"//source/common/http:header_map_lib",
"//source/common/http:headers_lib",
"//source/common/protobuf",
"//source/extensions/filters/http/common:pass_through_filter_lib",
"@com_google_absl//absl/base:core_headers",
"@envoy_api//envoy/config/filter/http/cache/v2alpha:cache_cc",
],
)
Loading