forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_config_validators_impl.h
46 lines (38 loc) · 1.64 KB
/
custom_config_validators_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include "envoy/server/instance.h"
#include "source/common/config/custom_config_validators.h"
namespace Envoy {
namespace Config {
class CustomConfigValidatorsImpl : public CustomConfigValidators {
public:
CustomConfigValidatorsImpl(
ProtobufMessage::ValidationVisitor& validation_visitor, const Server::Instance& server,
const Protobuf::RepeatedPtrField<envoy::config::core::v3::TypedExtensionConfig>&
validators_configs);
/**
* Executes the validators that receive the State-of-the-World resources.
*
* @param resources the State-of-the-World resources from the new config
* update.
* @throw EnvoyException if the config is rejected by one of the validators.
*/
void executeValidators(absl::string_view type_url,
const std::vector<DecodedResourcePtr>& resources) override;
/**
* Executes the validators that receive the Incremental (delta-xDS) resources.
*
* @param added_resources the added/modified resources from the new config
* update.
* @param removed_resources the resources to remove according to the new
* config update.
* @throw EnvoyException if the config is rejected by one of the validators.
*/
void executeValidators(absl::string_view type_url,
const std::vector<DecodedResourcePtr>& added_resources,
const Protobuf::RepeatedPtrField<std::string>& removed_resources) override;
private:
absl::flat_hash_map<std::string, std::vector<Envoy::Config::ConfigValidatorPtr>> validators_map_;
const Server::Instance& server_;
};
} // namespace Config
} // namespace Envoy