xref: /unit/src/nxt_conf_validation.c (revision 2133:46433e3cef45)
1116Svbart@nginx.com 
2116Svbart@nginx.com /*
3116Svbart@nginx.com  * Copyright (C) Valentin V. Bartenev
4116Svbart@nginx.com  * Copyright (C) NGINX, Inc.
5116Svbart@nginx.com  */
6116Svbart@nginx.com 
7116Svbart@nginx.com #include <nxt_main.h>
8116Svbart@nginx.com #include <nxt_conf.h>
9774Svbart@nginx.com #include <nxt_cert.h>
10444Sigor@sysoev.ru #include <nxt_router.h>
111183Svbart@nginx.com #include <nxt_http.h>
121324Saxel.duch@nginx.com #include <nxt_sockaddr.h>
131324Saxel.duch@nginx.com #include <nxt_http_route_addr.h>
141721Saxel.duch@nginx.com #include <nxt_regex.h>
15116Svbart@nginx.com 
16116Svbart@nginx.com 
17487Svbart@nginx.com typedef enum {
18487Svbart@nginx.com     NXT_CONF_VLDT_NULL    = 1 << NXT_CONF_NULL,
19487Svbart@nginx.com     NXT_CONF_VLDT_BOOLEAN = 1 << NXT_CONF_BOOLEAN,
20487Svbart@nginx.com     NXT_CONF_VLDT_INTEGER = 1 << NXT_CONF_INTEGER,
211439Svbart@nginx.com     NXT_CONF_VLDT_NUMBER  = (1 << NXT_CONF_NUMBER) | NXT_CONF_VLDT_INTEGER,
22487Svbart@nginx.com     NXT_CONF_VLDT_STRING  = 1 << NXT_CONF_STRING,
23487Svbart@nginx.com     NXT_CONF_VLDT_ARRAY   = 1 << NXT_CONF_ARRAY,
24487Svbart@nginx.com     NXT_CONF_VLDT_OBJECT  = 1 << NXT_CONF_OBJECT,
25487Svbart@nginx.com } nxt_conf_vldt_type_t;
26487Svbart@nginx.com 
271473Svbart@nginx.com #define NXT_CONF_VLDT_ANY_TYPE  (NXT_CONF_VLDT_NULL                           \
281473Svbart@nginx.com                                  |NXT_CONF_VLDT_BOOLEAN                       \
291473Svbart@nginx.com                                  |NXT_CONF_VLDT_NUMBER                        \
301473Svbart@nginx.com                                  |NXT_CONF_VLDT_STRING                        \
311473Svbart@nginx.com                                  |NXT_CONF_VLDT_ARRAY                         \
321473Svbart@nginx.com                                  |NXT_CONF_VLDT_OBJECT)
331473Svbart@nginx.com 
341473Svbart@nginx.com 
351525Svbart@nginx.com typedef enum {
361959Sz.hong@f5.com     NXT_CONF_VLDT_REQUIRED  = 1 << 0,
371959Sz.hong@f5.com     NXT_CONF_VLDT_VAR       = 1 << 1,
381525Svbart@nginx.com } nxt_conf_vldt_flags_t;
391525Svbart@nginx.com 
401525Svbart@nginx.com 
411473Svbart@nginx.com typedef nxt_int_t (*nxt_conf_vldt_handler_t)(nxt_conf_validation_t *vldt,
421473Svbart@nginx.com                                              nxt_conf_value_t *value,
431473Svbart@nginx.com                                              void *data);
44357Svbart@nginx.com typedef nxt_int_t (*nxt_conf_vldt_member_t)(nxt_conf_validation_t *vldt,
45137Svbart@nginx.com                                             nxt_str_t *name,
46116Svbart@nginx.com                                             nxt_conf_value_t *value);
47685Svbart@nginx.com typedef nxt_int_t (*nxt_conf_vldt_element_t)(nxt_conf_validation_t *vldt,
48685Svbart@nginx.com                                              nxt_conf_value_t *value);
49276Sigor@sysoev.ru 
501651Sigor@sysoev.ru 
511651Sigor@sysoev.ru typedef struct nxt_conf_vldt_object_s  nxt_conf_vldt_object_t;
521651Sigor@sysoev.ru 
531651Sigor@sysoev.ru struct nxt_conf_vldt_object_s {
541651Sigor@sysoev.ru     nxt_str_t                     name;
551651Sigor@sysoev.ru     nxt_conf_vldt_type_t          type:32;
561651Sigor@sysoev.ru     nxt_conf_vldt_flags_t         flags:32;
571651Sigor@sysoev.ru     nxt_conf_vldt_handler_t       validator;
581651Sigor@sysoev.ru 
591651Sigor@sysoev.ru     union {
601651Sigor@sysoev.ru         nxt_conf_vldt_object_t    *members;
611651Sigor@sysoev.ru         nxt_conf_vldt_object_t    *next;
621651Sigor@sysoev.ru         nxt_conf_vldt_member_t    object;
631651Sigor@sysoev.ru         nxt_conf_vldt_element_t   array;
641651Sigor@sysoev.ru         const char                *string;
651651Sigor@sysoev.ru     } u;
661651Sigor@sysoev.ru };
671651Sigor@sysoev.ru 
681651Sigor@sysoev.ru 
691651Sigor@sysoev.ru #define NXT_CONF_VLDT_NEXT(next)  { .u.members = next }
701651Sigor@sysoev.ru #define NXT_CONF_VLDT_END         { .name = nxt_null_string }
711651Sigor@sysoev.ru 
721651Sigor@sysoev.ru 
73357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_type(nxt_conf_validation_t *vldt,
74487Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value, nxt_conf_vldt_type_t type);
75357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_error(nxt_conf_validation_t *vldt,
76357Svbart@nginx.com     const char *fmt, ...);
771959Sz.hong@f5.com static nxt_int_t nxt_conf_vldt_var(nxt_conf_validation_t *vldt, nxt_str_t *name,
781959Sz.hong@f5.com     nxt_str_t *value);
791855Sz.hong@f5.com nxt_inline nxt_int_t nxt_conf_vldt_unsupported(nxt_conf_validation_t *vldt,
802079Salx.manpages@gmail.com     nxt_conf_value_t *value, void *data)
812079Salx.manpages@gmail.com     NXT_MAYBE_UNUSED;
82357Svbart@nginx.com 
831183Svbart@nginx.com static nxt_int_t nxt_conf_vldt_mtypes(nxt_conf_validation_t *vldt,
841183Svbart@nginx.com     nxt_conf_value_t *value, void *data);
851183Svbart@nginx.com static nxt_int_t nxt_conf_vldt_mtypes_type(nxt_conf_validation_t *vldt,
861183Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value);
871183Svbart@nginx.com static nxt_int_t nxt_conf_vldt_mtypes_extension(nxt_conf_validation_t *vldt,
881183Svbart@nginx.com     nxt_conf_value_t *value);
89357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_listener(nxt_conf_validation_t *vldt,
90357Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value);
91774Svbart@nginx.com #if (NXT_TLS)
92774Svbart@nginx.com static nxt_int_t nxt_conf_vldt_certificate(nxt_conf_validation_t *vldt,
93774Svbart@nginx.com     nxt_conf_value_t *value, void *data);
941885Sa.suvorov@f5.com #if (NXT_HAVE_OPENSSL_CONF_CMD)
951885Sa.suvorov@f5.com static nxt_int_t nxt_conf_vldt_object_conf_commands(nxt_conf_validation_t *vldt,
961885Sa.suvorov@f5.com     nxt_conf_value_t *value, void *data);
971885Sa.suvorov@f5.com #endif
981828Sa.suvorov@f5.com static nxt_int_t nxt_conf_vldt_certificate_element(nxt_conf_validation_t *vldt,
991828Sa.suvorov@f5.com     nxt_conf_value_t *value);
1001920Sa.suvorov@f5.com static nxt_int_t nxt_conf_vldt_tls_cache_size(nxt_conf_validation_t *vldt,
1011920Sa.suvorov@f5.com     nxt_conf_value_t *value, void *data);
1021920Sa.suvorov@f5.com static nxt_int_t nxt_conf_vldt_tls_timeout(nxt_conf_validation_t *vldt,
1031920Sa.suvorov@f5.com     nxt_conf_value_t *value, void *data);
1041942Sa.suvorov@f5.com #if (NXT_HAVE_OPENSSL_TLSEXT)
1051942Sa.suvorov@f5.com static nxt_int_t nxt_conf_vldt_ticket_key(nxt_conf_validation_t *vldt,
1061942Sa.suvorov@f5.com     nxt_conf_value_t *value, void *data);
1071942Sa.suvorov@f5.com static nxt_int_t nxt_conf_vldt_ticket_key_element(nxt_conf_validation_t *vldt,
1081942Sa.suvorov@f5.com     nxt_conf_value_t *value);
1091942Sa.suvorov@f5.com #endif
110774Svbart@nginx.com #endif
1111233Svbart@nginx.com static nxt_int_t nxt_conf_vldt_action(nxt_conf_validation_t *vldt,
1121233Svbart@nginx.com     nxt_conf_value_t *value, void *data);
113965Svbart@nginx.com static nxt_int_t nxt_conf_vldt_pass(nxt_conf_validation_t *vldt,
114965Svbart@nginx.com     nxt_conf_value_t *value, void *data);
1151429Svbart@nginx.com static nxt_int_t nxt_conf_vldt_return(nxt_conf_validation_t *vldt,
1161429Svbart@nginx.com     nxt_conf_value_t *value, void *data);
1171961Sz.hong@f5.com static nxt_int_t nxt_conf_vldt_share(nxt_conf_validation_t *vldt,
1182078Salx.manpages@gmail.com     nxt_conf_value_t *value, void *data);
1191961Sz.hong@f5.com static nxt_int_t nxt_conf_vldt_share_element(nxt_conf_validation_t *vldt,
1201961Sz.hong@f5.com     nxt_conf_value_t *value);
1211270Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_proxy(nxt_conf_validation_t *vldt,
1221270Sigor@sysoev.ru     nxt_conf_value_t *value, void *data);
1231872So.canty@f5.com static nxt_int_t nxt_conf_vldt_python(nxt_conf_validation_t *vldt,
1241872So.canty@f5.com     nxt_conf_value_t *value, void *data);
1251759Svbart@nginx.com static nxt_int_t nxt_conf_vldt_python_path(nxt_conf_validation_t *vldt,
1261759Svbart@nginx.com     nxt_conf_value_t *value, void *data);
1271759Svbart@nginx.com static nxt_int_t nxt_conf_vldt_python_path_element(nxt_conf_validation_t *vldt,
1281759Svbart@nginx.com     nxt_conf_value_t *value);
1291697Smax.romanov@nginx.com static nxt_int_t nxt_conf_vldt_python_protocol(nxt_conf_validation_t *vldt,
1301697Smax.romanov@nginx.com     nxt_conf_value_t *value, void *data);
1311681Smax.romanov@nginx.com static nxt_int_t nxt_conf_vldt_threads(nxt_conf_validation_t *vldt,
1321681Smax.romanov@nginx.com     nxt_conf_value_t *value, void *data);
1331681Smax.romanov@nginx.com static nxt_int_t nxt_conf_vldt_thread_stack_size(nxt_conf_validation_t *vldt,
1341681Smax.romanov@nginx.com     nxt_conf_value_t *value, void *data);
135966Svbart@nginx.com static nxt_int_t nxt_conf_vldt_routes(nxt_conf_validation_t *vldt,
136966Svbart@nginx.com     nxt_conf_value_t *value, void *data);
137966Svbart@nginx.com static nxt_int_t nxt_conf_vldt_routes_member(nxt_conf_validation_t *vldt,
138966Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value);
139966Svbart@nginx.com static nxt_int_t nxt_conf_vldt_route(nxt_conf_validation_t *vldt,
140966Svbart@nginx.com     nxt_conf_value_t *value);
1411474Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_encoded_patterns_sets(
1421474Saxel.duch@nginx.com     nxt_conf_validation_t *vldt, nxt_conf_value_t *value, void *data);
1431474Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_encoded_patterns_set(
1441474Saxel.duch@nginx.com     nxt_conf_validation_t *vldt, nxt_conf_value_t *value);
1451474Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_encoded_patterns_set_member(
1461474Saxel.duch@nginx.com     nxt_conf_validation_t *vldt, nxt_str_t *name, nxt_conf_value_t *value);
1471474Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_encoded_patterns(
1481474Saxel.duch@nginx.com     nxt_conf_validation_t *vldt, nxt_conf_value_t *value, void *data);
1491474Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_encoded_pattern(
1501474Saxel.duch@nginx.com     nxt_conf_validation_t *vldt, nxt_conf_value_t *value);
151966Svbart@nginx.com static nxt_int_t nxt_conf_vldt_match_patterns(nxt_conf_validation_t *vldt,
152966Svbart@nginx.com     nxt_conf_value_t *value, void *data);
153966Svbart@nginx.com static nxt_int_t nxt_conf_vldt_match_pattern(nxt_conf_validation_t *vldt,
154966Svbart@nginx.com     nxt_conf_value_t *value);
1551059Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_match_patterns_sets(nxt_conf_validation_t *vldt,
1561059Sigor@sysoev.ru     nxt_conf_value_t *value, void *data);
1571059Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_match_patterns_set(nxt_conf_validation_t *vldt,
1581059Sigor@sysoev.ru     nxt_conf_value_t *value);
1591059Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_match_patterns_set_member(
1601059Sigor@sysoev.ru     nxt_conf_validation_t *vldt, nxt_str_t *name, nxt_conf_value_t *value);
1611110Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_scheme_pattern(nxt_conf_validation_t *vldt,
1621110Saxel.duch@nginx.com     nxt_conf_value_t *value, void *data);
1631324Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_addrs(nxt_conf_validation_t *vldt,
1641324Saxel.duch@nginx.com     nxt_conf_value_t *value, void *data);
1651324Saxel.duch@nginx.com static nxt_int_t nxt_conf_vldt_match_addr(nxt_conf_validation_t *vldt,
1661324Saxel.duch@nginx.com     nxt_conf_value_t *value);
167357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_app_name(nxt_conf_validation_t *vldt,
168137Svbart@nginx.com     nxt_conf_value_t *value, void *data);
169*2133Sz.hong@f5.com static nxt_int_t nxt_conf_vldt_forwarded(nxt_conf_validation_t *vldt,
170*2133Sz.hong@f5.com     nxt_conf_value_t *value, void *data);
171357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_app(nxt_conf_validation_t *vldt,
172357Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value);
173357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_object(nxt_conf_validation_t *vldt,
174137Svbart@nginx.com     nxt_conf_value_t *value, void *data);
175507Smax.romanov@nginx.com static nxt_int_t nxt_conf_vldt_processes(nxt_conf_validation_t *vldt,
176507Smax.romanov@nginx.com     nxt_conf_value_t *value, void *data);
177357Svbart@nginx.com static nxt_int_t nxt_conf_vldt_object_iterator(nxt_conf_validation_t *vldt,
178137Svbart@nginx.com     nxt_conf_value_t *value, void *data);
179685Svbart@nginx.com static nxt_int_t nxt_conf_vldt_array_iterator(nxt_conf_validation_t *vldt,
180685Svbart@nginx.com     nxt_conf_value_t *value, void *data);
181678Svbart@nginx.com static nxt_int_t nxt_conf_vldt_environment(nxt_conf_validation_t *vldt,
182678Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value);
1831879So.canty@f5.com static nxt_int_t nxt_conf_vldt_targets_exclusive(
1841879So.canty@f5.com     nxt_conf_validation_t *vldt, nxt_conf_value_t *value, void *data);
1851879So.canty@f5.com static nxt_int_t nxt_conf_vldt_targets(nxt_conf_validation_t *vldt,
1861879So.canty@f5.com     nxt_conf_value_t *value, void *data);
1871879So.canty@f5.com static nxt_int_t nxt_conf_vldt_target(nxt_conf_validation_t *vldt,
1881879So.canty@f5.com     nxt_str_t *name, nxt_conf_value_t *value);
189685Svbart@nginx.com static nxt_int_t nxt_conf_vldt_argument(nxt_conf_validation_t *vldt,
190685Svbart@nginx.com     nxt_conf_value_t *value);
1911473Svbart@nginx.com static nxt_int_t nxt_conf_vldt_php(nxt_conf_validation_t *vldt,
1921473Svbart@nginx.com     nxt_conf_value_t *value, void *data);
193688Svbart@nginx.com static nxt_int_t nxt_conf_vldt_php_option(nxt_conf_validation_t *vldt,
194688Svbart@nginx.com     nxt_str_t *name, nxt_conf_value_t *value);
195977Smax.romanov@gmail.com static nxt_int_t nxt_conf_vldt_java_classpath(nxt_conf_validation_t *vldt,
196977Smax.romanov@gmail.com     nxt_conf_value_t *value);
197977Smax.romanov@gmail.com static nxt_int_t nxt_conf_vldt_java_option(nxt_conf_validation_t *vldt,
198977Smax.romanov@gmail.com     nxt_conf_value_t *value);
1991394Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_upstream(nxt_conf_validation_t *vldt,
2002078Salx.manpages@gmail.com     nxt_str_t *name, nxt_conf_value_t *value);
2011394Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_server(nxt_conf_validation_t *vldt,
2021394Sigor@sysoev.ru     nxt_str_t *name, nxt_conf_value_t *value);
2031394Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_server_weight(nxt_conf_validation_t *vldt,
2041394Sigor@sysoev.ru     nxt_conf_value_t *value, void *data);
205116Svbart@nginx.com 
2061235Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_isolation(nxt_conf_validation_t *vldt,
2071235Sigor@sysoev.ru     nxt_conf_value_t *value, void *data);
2081235Sigor@sysoev.ru static nxt_int_t nxt_conf_vldt_clone_namespaces(nxt_conf_validation_t *vldt,
2091182St.nateldemoura@f5.com     nxt_conf_value_t *value, void *data);
2101182St.nateldemoura@f5.com 
2111182St.nateldemoura@f5.com #if (NXT_HAVE_CLONE_NEWUSER)
2121182St.nateldemoura@f5.com static nxt_int_t nxt_conf_vldt_clone_procmap(nxt_conf_validation_t *vldt,
2131182St.nateldemoura@f5.com     const char* mapfile, nxt_conf_value_t *value);
2141182St.nateldemoura@f5.com static nxt_int_t nxt_conf_vldt_clone_uidmap(nxt_conf_validation_t *vldt,
2151182St.nateldemoura@f5.com     nxt_conf_value_t *value);
2161182St.nateldemoura@f5.com static nxt_int_t nxt_conf_vldt_clone_gidmap(nxt_conf_validation_t *vldt,
2171182St.nateldemoura@f5.com     nxt_conf_value_t *value);
2181182St.nateldemoura@f5.com #endif
219116Svbart@nginx.com 
2201649Sigor@sysoev.ru 
2211649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_setting_members[];
2221649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_http_members[];
2231649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_websocket_members[];
2241649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_static_members[];
225*2133Sz.hong@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_forwarded_members[];
2261936So.canty@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_client_ip_members[];
2271649Sigor@sysoev.ru #if (NXT_TLS)
2281649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_tls_members[];
2291920Sa.suvorov@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_session_members[];
2301649Sigor@sysoev.ru #endif
2311649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_match_members[];
2321879So.canty@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_python_target_members[];
2331649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_php_common_members[];
2341649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_php_options_members[];
2351879So.canty@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_php_target_members[];
2361649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_common_members[];
2371649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_app_limits_members[];
2381649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_app_processes_members[];
2391649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_app_isolation_members[];
2401649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_app_namespaces_members[];
2411649Sigor@sysoev.ru #if (NXT_HAVE_ISOLATION_ROOTFS)
2421649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_app_automount_members[];
2431649Sigor@sysoev.ru #endif
2441649Sigor@sysoev.ru 
2451649Sigor@sysoev.ru 
2461649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_root_members[] = {
2471650Sigor@sysoev.ru     {
2481650Sigor@sysoev.ru         .name       = nxt_string("settings"),
2491650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
2501651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object,
2511651Sigor@sysoev.ru         .u.members  = nxt_conf_vldt_setting_members,
2521650Sigor@sysoev.ru     }, {
2531650Sigor@sysoev.ru         .name       = nxt_string("listeners"),
2541650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
2551651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object_iterator,
2561651Sigor@sysoev.ru         .u.object   = nxt_conf_vldt_listener,
2571650Sigor@sysoev.ru     }, {
2581650Sigor@sysoev.ru         .name       = nxt_string("routes"),
2591650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_ARRAY | NXT_CONF_VLDT_OBJECT,
2601651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_routes,
2611650Sigor@sysoev.ru     }, {
2621650Sigor@sysoev.ru         .name       = nxt_string("applications"),
2631650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
2641651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object_iterator,
2651651Sigor@sysoev.ru         .u.object   = nxt_conf_vldt_app,
2661650Sigor@sysoev.ru     }, {
2671650Sigor@sysoev.ru         .name       = nxt_string("upstreams"),
2681650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
2691651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object_iterator,
2701651Sigor@sysoev.ru         .u.object   = nxt_conf_vldt_upstream,
2711650Sigor@sysoev.ru     }, {
2721650Sigor@sysoev.ru         .name       = nxt_string("access_log"),
2731650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
2741650Sigor@sysoev.ru     },
2751131Smax.romanov@nginx.com 
2761131Smax.romanov@nginx.com     NXT_CONF_VLDT_END
2771131Smax.romanov@nginx.com };
2781131Smax.romanov@nginx.com 
2791131Smax.romanov@nginx.com 
2801649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_setting_members[] = {
2811650Sigor@sysoev.ru     {
2821650Sigor@sysoev.ru         .name       = nxt_string("http"),
2831650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
2841651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object,
2851651Sigor@sysoev.ru         .u.members  = nxt_conf_vldt_http_members,
2861650Sigor@sysoev.ru     },
2871183Svbart@nginx.com 
2881183Svbart@nginx.com     NXT_CONF_VLDT_END
2891183Svbart@nginx.com };
2901183Svbart@nginx.com 
2911183Svbart@nginx.com 
292716Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_http_members[] = {
2931650Sigor@sysoev.ru     {
2941650Sigor@sysoev.ru         .name       = nxt_string("header_read_timeout"),
2951650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
2961650Sigor@sysoev.ru     }, {
2971650Sigor@sysoev.ru         .name       = nxt_string("body_read_timeout"),
2981650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
2991650Sigor@sysoev.ru     }, {
3001650Sigor@sysoev.ru         .name       = nxt_string("send_timeout"),
3011650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3021650Sigor@sysoev.ru     }, {
3031650Sigor@sysoev.ru         .name       = nxt_string("idle_timeout"),
3041650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3051650Sigor@sysoev.ru     }, {
3061650Sigor@sysoev.ru         .name       = nxt_string("body_buffer_size"),
3071650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3081650Sigor@sysoev.ru     }, {
3091650Sigor@sysoev.ru         .name       = nxt_string("max_body_size"),
3101650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3111650Sigor@sysoev.ru     }, {
3121650Sigor@sysoev.ru         .name       = nxt_string("body_temp_path"),
3131650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
3141650Sigor@sysoev.ru     }, {
3151709Svbart@nginx.com         .name       = nxt_string("discard_unsafe_fields"),
3161709Svbart@nginx.com         .type       = NXT_CONF_VLDT_BOOLEAN,
3171709Svbart@nginx.com     }, {
3181650Sigor@sysoev.ru         .name       = nxt_string("websocket"),
3191650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
3201651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object,
3211651Sigor@sysoev.ru         .u.members  = nxt_conf_vldt_websocket_members,
3221650Sigor@sysoev.ru     }, {
3231650Sigor@sysoev.ru         .name       = nxt_string("static"),
3241650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
3251651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object,
3261651Sigor@sysoev.ru         .u.members  = nxt_conf_vldt_static_members,
3271650Sigor@sysoev.ru     },
3281183Svbart@nginx.com 
329716Svbart@nginx.com     NXT_CONF_VLDT_END
330716Svbart@nginx.com };
331716Svbart@nginx.com 
332716Svbart@nginx.com 
3331649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_websocket_members[] = {
3341650Sigor@sysoev.ru     {
3351650Sigor@sysoev.ru         .name       = nxt_string("read_timeout"),
3361650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3371650Sigor@sysoev.ru     }, {
3381650Sigor@sysoev.ru 
3391650Sigor@sysoev.ru         .name       = nxt_string("keepalive_interval"),
3401650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3411650Sigor@sysoev.ru     }, {
3421650Sigor@sysoev.ru         .name       = nxt_string("max_frame_size"),
3431650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
3441650Sigor@sysoev.ru     },
345630Svbart@nginx.com 
346485Smax.romanov@nginx.com     NXT_CONF_VLDT_END
347116Svbart@nginx.com };
348116Svbart@nginx.com 
349116Svbart@nginx.com 
3501649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_static_members[] = {
3511650Sigor@sysoev.ru     {
3521650Sigor@sysoev.ru         .name       = nxt_string("mime_types"),
3531650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
3541651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_mtypes,
3551650Sigor@sysoev.ru     },
356774Svbart@nginx.com 
357774Svbart@nginx.com     NXT_CONF_VLDT_END
358774Svbart@nginx.com };
359774Svbart@nginx.com 
360774Svbart@nginx.com 
361132Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_listener_members[] = {
3621650Sigor@sysoev.ru     {
3631650Sigor@sysoev.ru         .name       = nxt_string("pass"),
3641650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
3651651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_pass,
3661959Sz.hong@f5.com         .flags      = NXT_CONF_VLDT_VAR,
3671650Sigor@sysoev.ru     }, {
3681650Sigor@sysoev.ru         .name       = nxt_string("application"),
3691650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
3701651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_app_name,
3711936So.canty@f5.com     }, {
372*2133Sz.hong@f5.com         .name       = nxt_string("forwarded"),
373*2133Sz.hong@f5.com         .type       = NXT_CONF_VLDT_OBJECT,
374*2133Sz.hong@f5.com         .validator  = nxt_conf_vldt_forwarded,
375*2133Sz.hong@f5.com     }, {
3761936So.canty@f5.com         .name       = nxt_string("client_ip"),
3771936So.canty@f5.com         .type       = NXT_CONF_VLDT_OBJECT,
3781936So.canty@f5.com         .validator  = nxt_conf_vldt_object,
3791936So.canty@f5.com         .u.members  = nxt_conf_vldt_client_ip_members
3801650Sigor@sysoev.ru     },
381116Svbart@nginx.com 
382774Svbart@nginx.com #if (NXT_TLS)
3831650Sigor@sysoev.ru     {
3841650Sigor@sysoev.ru         .name       = nxt_string("tls"),
3851650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
3861651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object,
3871651Sigor@sysoev.ru         .u.members  = nxt_conf_vldt_tls_members,
3881650Sigor@sysoev.ru     },
389774Svbart@nginx.com #endif
390774Svbart@nginx.com 
391485Smax.romanov@nginx.com     NXT_CONF_VLDT_END
392116Svbart@nginx.com };
393116Svbart@nginx.com 
394116Svbart@nginx.com 
395*2133Sz.hong@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_forwarded_members[] = {
396*2133Sz.hong@f5.com     {
397*2133Sz.hong@f5.com         .name       = nxt_string("client_ip"),
398*2133Sz.hong@f5.com         .type       = NXT_CONF_VLDT_STRING,
399*2133Sz.hong@f5.com     }, {
400*2133Sz.hong@f5.com         .name       = nxt_string("protocol"),
401*2133Sz.hong@f5.com         .type       = NXT_CONF_VLDT_STRING,
402*2133Sz.hong@f5.com     }, {
403*2133Sz.hong@f5.com         .name       = nxt_string("source"),
404*2133Sz.hong@f5.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
405*2133Sz.hong@f5.com         .validator  = nxt_conf_vldt_match_addrs,
406*2133Sz.hong@f5.com         .flags      = NXT_CONF_VLDT_REQUIRED
407*2133Sz.hong@f5.com     }, {
408*2133Sz.hong@f5.com         .name       = nxt_string("recursive"),
409*2133Sz.hong@f5.com         .type       = NXT_CONF_VLDT_BOOLEAN,
410*2133Sz.hong@f5.com     },
411*2133Sz.hong@f5.com 
412*2133Sz.hong@f5.com     NXT_CONF_VLDT_END
413*2133Sz.hong@f5.com };
414*2133Sz.hong@f5.com 
415*2133Sz.hong@f5.com 
4161936So.canty@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_client_ip_members[] = {
4171936So.canty@f5.com     {
4181936So.canty@f5.com         .name       = nxt_string("source"),
4191936So.canty@f5.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
4201936So.canty@f5.com         .validator  = nxt_conf_vldt_match_addrs,
4211936So.canty@f5.com         .flags      = NXT_CONF_VLDT_REQUIRED
4221936So.canty@f5.com     }, {
4231936So.canty@f5.com         .name       = nxt_string("header"),
4241936So.canty@f5.com         .type       = NXT_CONF_VLDT_STRING,
4251936So.canty@f5.com         .flags      = NXT_CONF_VLDT_REQUIRED
4261936So.canty@f5.com     }, {
4271936So.canty@f5.com         .name       = nxt_string("recursive"),
4281936So.canty@f5.com         .type       = NXT_CONF_VLDT_BOOLEAN,
4291936So.canty@f5.com     },
4301936So.canty@f5.com 
4311936So.canty@f5.com     NXT_CONF_VLDT_END
4321936So.canty@f5.com };
4331936So.canty@f5.com 
4341936So.canty@f5.com 
4351649Sigor@sysoev.ru #if (NXT_TLS)
4361649Sigor@sysoev.ru 
4371649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_tls_members[] = {
4381650Sigor@sysoev.ru     {
4391650Sigor@sysoev.ru         .name       = nxt_string("certificate"),
4401828Sa.suvorov@f5.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
4411885Sa.suvorov@f5.com         .flags      = NXT_CONF_VLDT_REQUIRED,
4421651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_certificate,
4431885Sa.suvorov@f5.com     }, {
4441885Sa.suvorov@f5.com         .name       = nxt_string("conf_commands"),
4451885Sa.suvorov@f5.com         .type       = NXT_CONF_VLDT_OBJECT,
4461885Sa.suvorov@f5.com #if (NXT_HAVE_OPENSSL_CONF_CMD)
4471885Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_object_conf_commands,
4481885Sa.suvorov@f5.com #else
4491885Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_unsupported,
4501885Sa.suvorov@f5.com         .u.string   = "conf_commands",
4511885Sa.suvorov@f5.com #endif
4521920Sa.suvorov@f5.com     }, {
4531920Sa.suvorov@f5.com         .name       = nxt_string("session"),
4541920Sa.suvorov@f5.com         .type       = NXT_CONF_VLDT_OBJECT,
4551920Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_object,
4561920Sa.suvorov@f5.com         .u.members  = nxt_conf_vldt_session_members,
4571920Sa.suvorov@f5.com     },
4581920Sa.suvorov@f5.com 
4591920Sa.suvorov@f5.com     NXT_CONF_VLDT_END
4601920Sa.suvorov@f5.com };
4611920Sa.suvorov@f5.com 
4621920Sa.suvorov@f5.com 
4631920Sa.suvorov@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_session_members[] = {
4641920Sa.suvorov@f5.com     {
4651920Sa.suvorov@f5.com         .name       = nxt_string("cache_size"),
4661920Sa.suvorov@f5.com         .type       = NXT_CONF_VLDT_INTEGER,
4671920Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_tls_cache_size,
4681920Sa.suvorov@f5.com     }, {
4691920Sa.suvorov@f5.com         .name       = nxt_string("timeout"),
4701920Sa.suvorov@f5.com         .type       = NXT_CONF_VLDT_INTEGER,
4711920Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_tls_timeout,
4721942Sa.suvorov@f5.com     }, {
4731942Sa.suvorov@f5.com         .name       = nxt_string("tickets"),
4741942Sa.suvorov@f5.com         .type       = NXT_CONF_VLDT_STRING
4751942Sa.suvorov@f5.com                      | NXT_CONF_VLDT_ARRAY
4761942Sa.suvorov@f5.com                      | NXT_CONF_VLDT_BOOLEAN,
4771942Sa.suvorov@f5.com #if (NXT_HAVE_OPENSSL_TLSEXT)
4781942Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_ticket_key,
4791942Sa.suvorov@f5.com #else
4801942Sa.suvorov@f5.com         .validator  = nxt_conf_vldt_unsupported,
4811942Sa.suvorov@f5.com         .u.string   = "tickets",
4821942Sa.suvorov@f5.com #endif
4831650Sigor@sysoev.ru     },
4841649Sigor@sysoev.ru 
4851649Sigor@sysoev.ru     NXT_CONF_VLDT_END
4861649Sigor@sysoev.ru };
4871649Sigor@sysoev.ru 
4881920Sa.suvorov@f5.com 
4891920Sa.suvorov@f5.com static nxt_int_t
nxt_conf_vldt_tls_cache_size(nxt_conf_validation_t * vldt,nxt_conf_value_t * value,void * data)4901920Sa.suvorov@f5.com nxt_conf_vldt_tls_cache_size(nxt_conf_validation_t *vldt,
4911920Sa.suvorov@f5.com     nxt_conf_value_t *value, void *data)
4921920Sa.suvorov@f5.com {
4931920Sa.suvorov@f5.com     int64_t  cache_size;
4941920Sa.suvorov@f5.com 
4951920Sa.suvorov@f5.com     cache_size = nxt_conf_get_number(value);
4961920Sa.suvorov@f5.com 
4971920Sa.suvorov@f5.com     if (cache_size < 0) {
4981920Sa.suvorov@f5.com         return nxt_conf_vldt_error(vldt, "The \"cache_size\" number must not "
4991920Sa.suvorov@f5.com                                          "be negative.");
5001920Sa.suvorov@f5.com     }
5011920Sa.suvorov@f5.com 
5021920Sa.suvorov@f5.com     return NXT_OK;
5031920Sa.suvorov@f5.com }
5041920Sa.suvorov@f5.com 
5051920Sa.suvorov@f5.com 
5061920Sa.suvorov@f5.com static nxt_int_t
nxt_conf_vldt_tls_timeout(nxt_conf_validation_t * vldt,nxt_conf_value_t * value,void * data)5071920Sa.suvorov@f5.com nxt_conf_vldt_tls_timeout(nxt_conf_validation_t *vldt, nxt_conf_value_t *value,
5081920Sa.suvorov@f5.com     void *data)
5091920Sa.suvorov@f5.com {
5101920Sa.suvorov@f5.com     int64_t  timeout;
5111920Sa.suvorov@f5.com 
5121920Sa.suvorov@f5.com     timeout = nxt_conf_get_number(value);
5131920Sa.suvorov@f5.com 
5141920Sa.suvorov@f5.com     if (timeout <= 0) {
5151920Sa.suvorov@f5.com         return nxt_conf_vldt_error(vldt, "The \"timeout\" number must be "
5161920Sa.suvorov@f5.com                                          "greater than zero.");
5171920Sa.suvorov@f5.com     }
5181920Sa.suvorov@f5.com 
5191920Sa.suvorov@f5.com     return NXT_OK;
5201920Sa.suvorov@f5.com }
5211920Sa.suvorov@f5.com 
5221649Sigor@sysoev.ru #endif
5231649Sigor@sysoev.ru 
5241942Sa.suvorov@f5.com #if (NXT_HAVE_OPENSSL_TLSEXT)
5251942Sa.suvorov@f5.com 
5261942Sa.suvorov@f5.com static nxt_int_t
nxt_conf_vldt_ticket_key(nxt_conf_validation_t * vldt,nxt_conf_value_t * value,void * data)5271942Sa.suvorov@f5.com nxt_conf_vldt_ticket_key(nxt_conf_validation_t *vldt, nxt_conf_value_t *value,
5281942Sa.suvorov@f5.com     void *data)
5291942Sa.suvorov@f5.com {
5301942Sa.suvorov@f5.com     if (nxt_conf_type(value) == NXT_CONF_BOOLEAN) {
5311942Sa.suvorov@f5.com         return NXT_OK;
5321942Sa.suvorov@f5.com     }
5331942Sa.suvorov@f5.com 
5341942Sa.suvorov@f5.com     if (nxt_conf_type(value) == NXT_CONF_ARRAY) {
5351942Sa.suvorov@f5.com         return nxt_conf_vldt_array_iterator(vldt, value,
5361942Sa.suvorov@f5.com                                             &nxt_conf_vldt_ticket_key_element);
5371942Sa.suvorov@f5.com     }
5381942Sa.suvorov@f5.com 
5391942Sa.suvorov@f5.com     /* NXT_CONF_STRING */
5401942Sa.suvorov@f5.com 
5411942Sa.suvorov@f5.com     return nxt_conf_vldt_ticket_key_element(vldt, value);
5421942Sa.suvorov@f5.com }
5431942Sa.suvorov@f5.com 
5441942Sa.suvorov@f5.com 
5451942Sa.suvorov@f5.com static nxt_int_t
nxt_conf_vldt_ticket_key_element(nxt_conf_validation_t * vldt,nxt_conf_value_t * value)5461942Sa.suvorov@f5.com nxt_conf_vldt_ticket_key_element(nxt_conf_validation_t *vldt,
5471942Sa.suvorov@f5.com     nxt_conf_value_t *value)
5481942Sa.suvorov@f5.com {
5491975Svbart@nginx.com     ssize_t    ret;
5501942Sa.suvorov@f5.com     nxt_str_t  key;
5511942Sa.suvorov@f5.com 
5521942Sa.suvorov@f5.com     if (nxt_conf_type(value) != NXT_CONF_STRING) {
5531942Sa.suvorov@f5.com         return nxt_conf_vldt_error(vldt, "The \"key\" array must "
5541942Sa.suvorov@f5.com                                    "contain only string values.");
5551942Sa.suvorov@f5.com     }
5561942Sa.suvorov@f5.com 
5571942Sa.suvorov@f5.com     nxt_conf_get_string(value, &key);
5581942Sa.suvorov@f5.com 
5591975Svbart@nginx.com     ret = nxt_base64_decode(NULL, key.start, key.length);
5601975Svbart@nginx.com     if (ret == NXT_ERROR) {
5611942Sa.suvorov@f5.com         return nxt_conf_vldt_error(vldt, "Invalid Base64 format for the ticket "
5621942Sa.suvorov@f5.com                                    "key \"%V\".", &key);
5631942Sa.suvorov@f5.com     }
5641942Sa.suvorov@f5.com 
5651942Sa.suvorov@f5.com     if (ret != 48 && ret != 80) {
5661942Sa.suvorov@f5.com         return nxt_conf_vldt_error(vldt, "Invalid length %d of the ticket "
5671942Sa.suvorov@f5.com                                    "key \"%V\".  Must be 48 or 80 bytes.",
5681942Sa.suvorov@f5.com                                    ret, &key);
5691942Sa.suvorov@f5.com     }
5701942Sa.suvorov@f5.com 
5711942Sa.suvorov@f5.com     return NXT_OK;
5721942Sa.suvorov@f5.com }
5731942Sa.suvorov@f5.com 
5741942Sa.suvorov@f5.com #endif
5751942Sa.suvorov@f5.com 
5761649Sigor@sysoev.ru 
5771649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_route_members[] = {
5781650Sigor@sysoev.ru     {
5791650Sigor@sysoev.ru         .name       = nxt_string("match"),
5801650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
5811651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_object,
5821651Sigor@sysoev.ru         .u.members  = nxt_conf_vldt_match_members,
5831650Sigor@sysoev.ru     }, {
5841650Sigor@sysoev.ru         .name       = nxt_string("action"),
5851650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
5861651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_action,
5871650Sigor@sysoev.ru     },
5881649Sigor@sysoev.ru 
5891649Sigor@sysoev.ru     NXT_CONF_VLDT_END
5901649Sigor@sysoev.ru };
5911649Sigor@sysoev.ru 
5921649Sigor@sysoev.ru 
593966Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_match_members[] = {
5941650Sigor@sysoev.ru     {
5951650Sigor@sysoev.ru         .name       = nxt_string("method"),
5961650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
5971651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_patterns,
5981988Sz.hong@f5.com         .u.string   = "method",
5991650Sigor@sysoev.ru     }, {
6001650Sigor@sysoev.ru         .name       = nxt_string("scheme"),
6011650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
6021651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_scheme_pattern,
6031650Sigor@sysoev.ru     }, {
6041650Sigor@sysoev.ru         .name       = nxt_string("host"),
6051650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6061651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_patterns,
6071988Sz.hong@f5.com         .u.string   = "host",
6081650Sigor@sysoev.ru     }, {
6091650Sigor@sysoev.ru         .name       = nxt_string("source"),
6101650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6111651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_addrs,
6121650Sigor@sysoev.ru     }, {
6131650Sigor@sysoev.ru         .name       = nxt_string("destination"),
6141650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6151651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_addrs,
6161650Sigor@sysoev.ru     }, {
6171650Sigor@sysoev.ru         .name       = nxt_string("uri"),
6181650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6191651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_encoded_patterns,
6201988Sz.hong@f5.com         .u.string   = "uri"
6211650Sigor@sysoev.ru     }, {
6221991Sz.hong@f5.com         .name       = nxt_string("query"),
6231991Sz.hong@f5.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6241991Sz.hong@f5.com         .validator  = nxt_conf_vldt_match_encoded_patterns,
6251991Sz.hong@f5.com         .u.string   = "query"
6261991Sz.hong@f5.com     }, {
6271650Sigor@sysoev.ru         .name       = nxt_string("arguments"),
6281650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT | NXT_CONF_VLDT_ARRAY,
6291651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_encoded_patterns_sets,
6301650Sigor@sysoev.ru     }, {
6311650Sigor@sysoev.ru         .name       = nxt_string("headers"),
6321650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT | NXT_CONF_VLDT_ARRAY,
6331651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_patterns_sets,
6341988Sz.hong@f5.com         .u.string   = "headers"
6351650Sigor@sysoev.ru     }, {
6361650Sigor@sysoev.ru         .name       = nxt_string("cookies"),
6371650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT | NXT_CONF_VLDT_ARRAY,
6381651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_match_patterns_sets,
6391988Sz.hong@f5.com         .u.string   = "cookies"
6401650Sigor@sysoev.ru     },
6411059Sigor@sysoev.ru 
642966Svbart@nginx.com     NXT_CONF_VLDT_END
643966Svbart@nginx.com };
644966Svbart@nginx.com 
645966Svbart@nginx.com 
6461377Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_pass_action_members[] = {
6471650Sigor@sysoev.ru     {
6481650Sigor@sysoev.ru         .name       = nxt_string("pass"),
6491650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
6501651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_pass,
6511959Sz.hong@f5.com         .flags      = NXT_CONF_VLDT_VAR,
6521650Sigor@sysoev.ru     },
653966Svbart@nginx.com 
6541377Svbart@nginx.com     NXT_CONF_VLDT_END
6551377Svbart@nginx.com };
6561377Svbart@nginx.com 
6571377Svbart@nginx.com 
6581429Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_return_action_members[] = {
6591650Sigor@sysoev.ru     {
6601650Sigor@sysoev.ru         .name       = nxt_string("return"),
6611650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_INTEGER,
6621651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_return,
6631650Sigor@sysoev.ru     }, {
6641650Sigor@sysoev.ru         .name       = nxt_string("location"),
6651650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
6662081Salx.manpages@gmail.com         .flags      = NXT_CONF_VLDT_VAR,
6671650Sigor@sysoev.ru     },
6681432Svbart@nginx.com 
6691429Svbart@nginx.com     NXT_CONF_VLDT_END
6701429Svbart@nginx.com };
6711429Svbart@nginx.com 
6721429Svbart@nginx.com 
6731377Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_share_action_members[] = {
6741650Sigor@sysoev.ru     {
6751650Sigor@sysoev.ru         .name       = nxt_string("share"),
6761961Sz.hong@f5.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6771961Sz.hong@f5.com         .validator  = nxt_conf_vldt_share,
6781650Sigor@sysoev.ru     }, {
6792108Salx.manpages@gmail.com         .name       = nxt_string("index"),
6802108Salx.manpages@gmail.com         .type       = NXT_CONF_VLDT_STRING,
6812108Salx.manpages@gmail.com     }, {
6821859So.canty@f5.com         .name       = nxt_string("types"),
6831859So.canty@f5.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
6841859So.canty@f5.com         .validator  = nxt_conf_vldt_match_patterns,
6851859So.canty@f5.com     }, {
6861650Sigor@sysoev.ru         .name       = nxt_string("fallback"),
6871650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_OBJECT,
6881651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_action,
6891855Sz.hong@f5.com     }, {
6901855Sz.hong@f5.com         .name       = nxt_string("chroot"),
6911855Sz.hong@f5.com         .type       = NXT_CONF_VLDT_STRING,
6921855Sz.hong@f5.com #if !(NXT_HAVE_OPENAT2)
6931855Sz.hong@f5.com         .validator  = nxt_conf_vldt_unsupported,
6941855Sz.hong@f5.com         .u.string   = "chroot",
6951855Sz.hong@f5.com #endif
6961959Sz.hong@f5.com         .flags      = NXT_CONF_VLDT_VAR,
6971855Sz.hong@f5.com     }, {
6981855Sz.hong@f5.com         .name       = nxt_string("follow_symlinks"),
6991855Sz.hong@f5.com         .type       = NXT_CONF_VLDT_BOOLEAN,
7001855Sz.hong@f5.com #if !(NXT_HAVE_OPENAT2)
7011855Sz.hong@f5.com         .validator  = nxt_conf_vldt_unsupported,
7021855Sz.hong@f5.com         .u.string   = "follow_symlinks",
7031855Sz.hong@f5.com #endif
7041855Sz.hong@f5.com     }, {
7051855Sz.hong@f5.com         .name       = nxt_string("traverse_mounts"),
7061855Sz.hong@f5.com         .type       = NXT_CONF_VLDT_BOOLEAN,
7071855Sz.hong@f5.com #if !(NXT_HAVE_OPENAT2)
7081855Sz.hong@f5.com         .validator  = nxt_conf_vldt_unsupported,
7091855Sz.hong@f5.com         .u.string   = "traverse_mounts",
7101855Sz.hong@f5.com #endif
7111650Sigor@sysoev.ru     },
7121378Svbart@nginx.com 
7131377Svbart@nginx.com     NXT_CONF_VLDT_END
7141377Svbart@nginx.com };
7151377Svbart@nginx.com 
7161377Svbart@nginx.com 
7171377Svbart@nginx.com static nxt_conf_vldt_object_t  nxt_conf_vldt_proxy_action_members[] = {
7181650Sigor@sysoev.ru     {
7191650Sigor@sysoev.ru         .name       = nxt_string("proxy"),
7201650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
7211651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_proxy,
7221650Sigor@sysoev.ru     },
7231270Sigor@sysoev.ru 
724966Svbart@nginx.com     NXT_CONF_VLDT_END
725966Svbart@nginx.com };
726966Svbart@nginx.com 
727966Svbart@nginx.com 
7281649Sigor@sysoev.ru static nxt_conf_vldt_object_t  nxt_conf_vldt_external_members[] = {
7291650Sigor@sysoev.ru     {
7301650Sigor@sysoev.ru         .name       = nxt_string("executable"),
7311650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
7321650Sigor@sysoev.ru         .flags      = NXT_CONF_VLDT_REQUIRED,
7331650Sigor@sysoev.ru     }, {
7341650Sigor@sysoev.ru         .name       = nxt_string("arguments"),
7351650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_ARRAY,
7361651Sigor@sysoev.ru         .validator  = nxt_conf_vldt_array_iterator,
7371651Sigor@sysoev.ru         .u.array    = nxt_conf_vldt_argument,
7381650Sigor@sysoev.ru     },
7391649Sigor@sysoev.ru 
7401651Sigor@sysoev.ru     NXT_CONF_VLDT_NEXT(nxt_conf_vldt_common_members)
7411649Sigor@sysoev.ru };
7421649Sigor@sysoev.ru 
7431649Sigor@sysoev.ru 
7441872So.canty@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_python_common_members[] = {
7451650Sigor@sysoev.ru     {
7461650Sigor@sysoev.ru         .name       = nxt_string("home"),
7471650Sigor@sysoev.ru         .type       = NXT_CONF_VLDT_STRING,
7481650Sigor@sysoev.ru     }, {
7491650Sigor@sysoev.ru         .name       = nxt_string("path"),
7501759Svbart@nginx.com         .type       = NXT_CONF_VLDT_STRING | NXT_CONF_VLDT_ARRAY,
7511759Svbart@nginx.com         .validator  = nxt_conf_vldt_python_path,
7521650Sigor@sysoev.ru     }, {
7531697Smax.romanov@nginx.com         .name       = nxt_string("protocol"),
7541697Smax.romanov@nginx.com         .type       = NXT_CONF_VLDT_STRING,
7551697Smax.romanov@nginx.com         .validator  = nxt_conf_vldt_python_protocol,
7561697Smax.romanov@nginx.com     }, {
7571681Smax.romanov@nginx.com         .name       = nxt_string("threads"),
7581681Smax.romanov@nginx.com         .type       = NXT_CONF_VLDT_INTEGER,
7591681Smax.romanov@nginx.com         .validator  = nxt_conf_vldt_threads,
7601681Smax.romanov@nginx.com     }, {
7611681Smax.romanov@nginx.com         .name       = nxt_string("thread_stack_size"),
7621681Smax.romanov@nginx.com         .type       = NXT_CONF_VLDT_INTEGER,
7631681Smax.romanov@nginx.com         .validator  = nxt_conf_vldt_thread_stack_size,
7641650Sigor@sysoev.ru     },
7651649Sigor@sysoev.ru 
7661651Sigor@sysoev.ru     NXT_CONF_VLDT_NEXT(nxt_conf_vldt_common_members)
7671649Sigor@sysoev.ru };
7681649Sigor@sysoev.ru 
7691872So.canty@f5.com static nxt_conf_vldt_object_t  nxt_conf_vldt_python_members[] = {
7701872So.canty@f5.com     {
7711872So.canty@f5.com         .name       = nxt_string("module"),
7721872So.canty@f5.com         .type       = NXT_CONF_VLDT_STRING,
773