Skip to main content

Module vars

Module vars 

Source
Expand description

Request/response variable resolution and condition expressions.

The featherbit analogue of APISIX’s ctx.var + lua-resty-expr: plugins resolve named variables against the Context (uri, arg_<name>, http_<header>, …), interpolate $var / ${var} templates, and evaluate condition expressions written in APISIX’s triple-array form:

vars:
  - ["arg_name", "==", "jack"]
  - ["http_user_agent", "~~", "Mozilla.+"]

Rules in a top-level list are ANDed. A rule is [var, op, value] or the negated [var, "!", op, value]; nested logic uses ["AND", rule...] / ["OR", rule...]. Supported operators: ==, ~=, >, >=, <, <=, ~~ (regex), ~* (case-insensitive regex), in (value array), has (var array contains value), ipmatch (value is a list of IPs/CIDRs).

Structs§

Expr
A compiled condition expression in APISIX’s triple-array form.

Enums§

Node 🔒
Op 🔒

Functions§

cookie_value 🔒
eval_node 🔒
eval_op 🔒
hex_val 🔒
interpolate
Interpolates $var and ${var} references in a template.
message_str 🔒
parse_node 🔒
post_arg 🔒
query_string 🔒
resolve
Resolves a variable name against the context.
split_remote_addr 🔒
Splits ip:port, tolerating bare IPs and bracketed IPv6.
urldecode 🔒