forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_config_validators.h
46 lines (39 loc) · 1.68 KB
/
custom_config_validators.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/config/config_validator.h"
namespace Envoy {
namespace Config {
// Represents a collection of config validators defined using Envoy extensions,
// for all xDS service types. This is different than running Envoy in
// "validation-mode", as these config validators will be executed whenever
// Envoy receives a new update.
class CustomConfigValidators {
public:
virtual ~CustomConfigValidators() = default;
/**
* Executes the validators that receive the State-of-the-World resources.
*
* @param type_url the xDS type url of the incoming 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.
*/
virtual void executeValidators(absl::string_view type_url,
const std::vector<DecodedResourcePtr>& resources) PURE;
/**
* Executes the validators that receive the Incremental (delta-xDS) resources.
*
* @param type_url the xDS type url of the incoming 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.
*/
virtual void
executeValidators(absl::string_view type_url,
const std::vector<DecodedResourcePtr>& added_resources,
const Protobuf::RepeatedPtrField<std::string>& removed_resources) PURE;
};
using CustomConfigValidatorsPtr = std::unique_ptr<CustomConfigValidators>;
} // namespace Config
} // namespace Envoy