Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Current »

To automate the subscription approval you will need a rule that selects on wrangler inbound_pending_subscription_added event which raises a wrangler pending_subscription_approval event with channel_name attribute set to the channel_name of the inbound_pending_subscription_added event, this can be done by passing the attributes along.

  rule autoAccept {
    select when wrangler inbound_pending_subscription_added 
    pre{
      attributes = event:attrs().klog("subcription :");
      }
      noop();
    always{
      raise wrangler event "pending_subscription_approval"
          attributes attributes;        
          log("auto accepted subcription.");
    }
  }

Security Issues

 The preceding code shows a simple example of approving subscriptions automatically. This code, installed in a pico, would automatically subscribe to every pico that requests it.

Production code should be more circumspect about what subscriptions it accepts. For example, a pico might automatically accept any subscription request from its parent. Or any subscription request that contains a specific password.

  • No labels