mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
net/haproxy: support mapfiles in hdr/path ACLs
Previously a path or header had to be specified. But with the extended mapfile support, these are no longer required values. A mapfile may be used instead.
This commit is contained in:
parent
646f886f3b
commit
b9dcae8a9c
1 changed files with 44 additions and 77 deletions
|
|
@ -171,59 +171,44 @@
|
|||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'hdr' %}
|
||||
{% do acl_options.append('hdr(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.hdr|default("") != "" %}
|
||||
{% do acl_options.append('hdr(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.hdr) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'hdr_beg' %}
|
||||
{% do acl_options.append('hdr_beg(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.hdr_beg|default("") != "" %}
|
||||
{% do acl_options.append('hdr_beg(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.hdr_beg) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'hdr_end' %}
|
||||
{% do acl_options.append('hdr_end(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.hdr_end|default("") != "" %}
|
||||
{% do acl_options.append('hdr_end(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.hdr_end) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'hdr_reg' %}
|
||||
{% do acl_options.append('hdr_reg(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.hdr_reg|default("") != "" %}
|
||||
{% do acl_options.append('hdr_reg(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.hdr_reg) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'hdr_sub' %}
|
||||
{% do acl_options.append('hdr_sub(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.hdr_sub|default("") != "" %}
|
||||
{% do acl_options.append('hdr_sub(host)') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.hdr_sub) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'http_auth' %}
|
||||
{% if acl_data.allowedUsers|default("") != "" or acl_data.allowedGroups|default("") != "" %}
|
||||
|
|
@ -253,70 +238,52 @@
|
|||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'path' %}
|
||||
{% do acl_options.append('path') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.path|default("") != "" %}
|
||||
{% do acl_options.append('path') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.path) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'path_beg' %}
|
||||
{% do acl_options.append('path_beg') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.path_beg|default("") != "" %}
|
||||
{% do acl_options.append('path_beg') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.path_beg) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'path_dir' %}
|
||||
{% do acl_options.append('path_dir') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.path_dur|default("") != "" %}
|
||||
{% do acl_options.append('path_dir') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.path_dir) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'path_end' %}
|
||||
{% do acl_options.append('path_end') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.path_end|default("") != "" %}
|
||||
{% do acl_options.append('path_end') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.path_end) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'path_reg' %}
|
||||
{% do acl_options.append('path_reg') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.path_reg|default("") != "" %}
|
||||
{% do acl_options.append('path_reg') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.path_reg) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'path_sub' %}
|
||||
{% do acl_options.append('path_sub') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% if acl_data.path_sub|default("") != "" %}
|
||||
{% do acl_options.append('path_sub') %}
|
||||
{% if acl_data.caseSensitive|default('0') == '0' %}
|
||||
{% do acl_options.append('-i') %}
|
||||
{% endif %}
|
||||
{% do acl_options.append(acl_data.path_sub) %}
|
||||
{% else %}
|
||||
{% set acl_enabled = '0' %}
|
||||
# ERROR: missing parameters
|
||||
{% endif %}
|
||||
{% elif acl_data.expression == 'sc_bytes_in_rate' %}
|
||||
{% if acl_data.sc_number|default("") != "" and acl_data.sc_bytes_in_rate|default("") != "" %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue