comparison mod_firewall/definitions.lib.lua @ 5233:7eec2bc67c26

mod_firewall: Warn about invalid pubsubitemid list specification
author Matthew Wild <mwild1@gmail.com>
date Sat, 11 Mar 2023 16:40:24 +0000
parents 0f943619e01a
children
comparison
equal deleted inserted replaced
5232:0f943619e01a 5233:7eec2bc67c26
196 -- We'll start by using only the item id. 196 -- We'll start by using only the item id.
197 -- TODO Invent some custom schema for this? Needed for just a set of strings? 197 -- TODO Invent some custom schema for this? Needed for just a set of strings?
198 pubsubitemid = { 198 pubsubitemid = {
199 init = function(self, pubsub_spec, opts) 199 init = function(self, pubsub_spec, opts)
200 local service_addr, node = pubsub_spec:match("^pubsubitemid:([^/]*)/(.*)"); 200 local service_addr, node = pubsub_spec:match("^pubsubitemid:([^/]*)/(.*)");
201 if not service_addr then
202 module:log("warn", "Invalid list specification (expected 'pubsubitemid:<service>/<node>', got: '%s')", pubsub_spec);
203 return;
204 end
201 module:depends("pubsub_subscription"); 205 module:depends("pubsub_subscription");
202 module:add_item("pubsub-subscription", { 206 module:add_item("pubsub-subscription", {
203 service = service_addr; 207 service = service_addr;
204 node = node; 208 node = node;
205 on_subscribed = function () 209 on_subscribed = function ()