add messageValidationContext into CommonFactoryContext so xDS could u…#9621
add messageValidationContext into CommonFactoryContext so xDS could u…#9621stevenzzzz wants to merge 5 commits intoenvoyproxy:masterfrom
Conversation
…se dynamic validator Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
|
/assign htuch |
source/common/router/rds_impl.cc
Outdated
| RouteConfigProviderManagerImpl& route_config_provider_manager) | ||
| : config_(new ConfigImpl(config, factory_context.getServerFactoryContext(), | ||
| factory_context.messageValidationVisitor(), true)), | ||
| factory_context.messageValidationContext().staticValidationVisitor(), |
There was a problem hiding this comment.
I don't think this is right. You can have a static inline route in a dynamic Listener, for example, and we should be applying dynamic validation logic.
There was a problem hiding this comment.
revert it.
In the long run, I will probably make Listener validator passed down to RDS and its children object. (so that RDS doesn't depend on Listener).
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
…mote-validator Signed-off-by: Xin Zhuang <stevenzzz@google.com>
| envoy::config::core::v3alpha::TrafficDirection direction() const override; | ||
| TimeSource& timeSource() override; | ||
| ProtobufMessage::ValidationVisitor& messageValidationVisitor() override; | ||
| ProtobufMessage::ValidationContext& messageValidationContext() override; |
There was a problem hiding this comment.
Why do we have both validation visitor and context as peers?
There was a problem hiding this comment.
Why do we have both validation visitor and context as peers?
removing of validator() will be in another PR, lots of files will be modified as I plan to pass the signal "added_via_api" (or a vlidator parameter) down from Listener to everythin.
There was a problem hiding this comment.
Trying to figure out how this works.. do you have a draft PR to see the end results? As mentioned off-line, I'd like to:
- Thread validators around, vs. context+flag unless the flag is needed for some other purpose.
- Ensure that it's easy for consumers to automatically "do the right thing", without having to think too hard, otherwise we get folks picking random validators via copy+paste.
^^ guided the existing design. We need a bunch of comments to explain this interim solution in any case, as it's pretty confusing why both are there right now.
There was a problem hiding this comment.
#9779 I have it now.
That PR doesn't include the removal of FactoryContext::messageValidationVisitor() tho.
So if we want to remove that later, we will need to pipe a picked validator from listenerImpl down to HCM::Config.
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
still on my Radar.
WIP
…On Tue, Jan 21, 2020 at 4:55 PM stale[bot] ***@***.***> wrote:
This pull request has been automatically marked as stale because it has
not had activity in the last 7 days. It will be closed in 7 days if no
further activity occurs. Please feel free to give a status update now, ping
for review, or re-open when it's ready. Thank you for your contributions!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9621?email_source=notifications&email_token=AA2I6THIRIBGGQULLREM62TQ65VLLA5CNFSM4KESFJZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJRM5YA#issuecomment-576900832>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2I6TGKQRC5EUGOSTDEOV3Q65VLLANCNFSM4KESFJZQ>
.
--
Xin Zhuang
|
|
will review once merge conflicts updated. /wait |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Xin Zhuang stevenzzz@google.com
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Description: add messageValidationContext into CommonFactoryContext so xDS could use the correct messageValidator.
Risk Level: LOW, no behavior change.
Testing: unit test adjusted
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue] #9635