-
Notifications
You must be signed in to change notification settings - Fork 22
filters
an object containing any whitelist/blacklist filters used by postal.federation to determine which messages should be allowed in or out. The filters object contains in and an out members - in part because I <3 In-N-Out Burgers - but also because it made sense to organize inbound and outbound filters that way.
Filters are used to check inbound (i.e. - coming from remote instances) and outbound (i.e. - potentially headed to remote instances) messages, to determine if they should be received (for inbound) or sent (for outbound).
postal.federation's filter mode can be set to whitelist or blacklist (whitelist is the default). whitelist mode means that only messages matching a filter will be sent or received. It's the most restrictive setting, and by default it will not send/receive any messages to/from remote instances of postal until you add 1 or more filters. blacklist mode means that messages matching a filter will not be sent or received, while any other message will be allowed in or out.
Filters are an object literal, describing three things: the channel and topic binding to match against, and the direction to which to apply the filter. The direction defaults to both (if not provided), and can also be in (affecting only inbound messages) or out (affecting only outbound messages). It's important to note that the filters' channel/topic values work just like normal postal subscribers - meaning you can match on topic wildcards. Filtering this way allows you to fine-tune the communications between various federated postal instances, so that none of them receive or expose messages that should not leave the local instance, etc.
See the sections on addFilter and removeFilter for more info on managing filters. See the section on configure() to see how to set the filter mode.