Repository navigation
ask_unlisted gates the check once per virtual host instead of copying every route - #79
Merged
Merged
Conversation
…d of copying every route (Part of #78) v2.3.0 rendered the unlisted-origin ask as a copy of every route in each virtual host, each copy carrying one negated Origin matcher per listed origin. On a file with 242 routes in each of three hosts and 20 listed origins the render grew by 2.67 MB, and Envoy's heap at idle rose from 66.7 to 222.0 MiB with a start-up peak of 236.5 MiB. The ask is now one ExtensionWithMatcher around ext_authz per environment. It skips any request the environment's hosts and lists already admit, is turned on by the virtual host and off by its refused route, and the virtual host's RBAC reads the check's answer. The virtual host's CORS policy admits an origin the check admitted with one RE2 matcher that never matches "*" or "null". The key now adds a constant 28,611 bytes at any route count; at 242 routes Envoy's heap at idle is 24.0 MiB and the container peaks at 35.7 MiB. With the key, only the exact own origin (https, default port) is admitted unasked and gets its own allow-origin header; the same host on another scheme or port is asked like any other unlisted origin. An admitted "null" origin gets no allow-origin header. A file without the key renders byte for byte as v2.3.0. The conformance scenario counts the questions the check receives, so every row asserts whether its request was asked: 20 rows on Envoy 1.40.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #78
ask_unlisted(v2.3.0) rendered the unlisted-origin ask as a copy of every route in each virtual host. This renders it as oneExtensionWithMatcheraround ext_authz per environment, so the render no longer grows with the routes.Measured on a file with 242 routes in each of three hosts and 20 listed origins:
Behaviour:
Originare never asked.nullorigin gets no allow-origin header.Review focus:
internal/renderagainst Envoy 1.40'sExtensionWithMatcher,HttpFilter.disabledandFilterConfig(links indocs/origins.md).*ornull(TestAskUnlistedCORSMatchers).Tests:
go test ./...: 210 tests and 1,736 subtests, 0 failures. Conformance on Envoy 1.40: 20 of 20 rows. One review before this pull request; its findings are fixed here.After the merge,
v2.3.1is tagged on the merged commit.