-
Notifications
You must be signed in to change notification settings - Fork 9
/
regexes.config
39 lines (39 loc) · 1.68 KB
/
regexes.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%% This file is for configuring the approval or rejection
%% of new subscriptions in SubPub based on the hostname of
%% a subscription's callback url and that subscription's principal.
%%
%% Like prospero.config, if this config is changed, it will be
%% applied only to the local node in a cluster. Change this file
%% on all the nodes in a cluster unless you're sure you need to
%% change policies on this node only.
%%
%% There should be one or more 2-tuples, each ending with a period,
%% parseable by Erlang's proplists module as key-value pairs.
%%
%% The first value of a tuple is a key that subscription creation
%% logic will look up. It should be either a Principal ID, as a
%% string, or the atom 'default'. If a Principal ID is present,
%% that value will be used instead of the default if and when that
%% principal makes a subscription creation request.
%%
%% The value associated with a key should compile to a regular expression.
%% It will run against the hostname of the callback URL. If it *matches*,
%% the subscription request will be rejected, with a 400 response code.
{
%% The regex string below, "^localhost.*", means "match all
%% strings that begin with the letters 'localhost'".
%% A match means that the subscription will be rejected.
"ONE", "^localhost.*"
}.
{
%% The principal "TWO" is excluded from the general policy set
%% by 'default'. "(?!)" never matches any string, and as such will
%% never match any incoming subscription's hostname.
"TWO", "(?!)"
}.
{
%% This default will be used if and when a principal makes a subscription
%% request, and that principal's ID is not a key of another tuple in this
%% file.
default, "^localhost.*"
}.