comparison mod_firewall/definitions.lib.lua @ 5650:0eb2d5ea2428

merge
author Stephen Paul Weber <singpolyma@singpolyma.net>
date Sat, 06 May 2023 19:40:23 -0500
parents 7eec2bc67c26
children 0002c727e918
comparison
equal deleted inserted replaced
5649:2c69577b28c2 5650:0eb2d5ea2428
195 -- Step 1: Receiving pubsub events and storing them in the list 195 -- Step 1: Receiving pubsub events and storing them in the list
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("^([^/]*)/(.*)"); 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 ()