Docs update.
4 Authorisation is effected by three configuration options:
7 * resource_access_query
10 Each defines a query that will determine whether a user has access to
11 a vhost, a resource (e.g. exchange, queue, binding) or is considered
14 The default values are {constant, true}, {constant, true} and
15 [{administrator, {constant, false}}] respectively, granting all users
16 access to all objects in all vhosts, but not making them
19 A query can be of one of several types:
26 This will always return either true or false, unconditionally granting
34 This will substitute variables into the pattern, and return true if
35 there exists an object with the resulting DN. Substitution occurs with
36 ${} syntax. The vhost_access_query in the example configuration below
37 therefore allows you to control access to vhosts by controlling the
38 existence of OUs in a vhosts OU.
40 Each of the three queries allow different substitutions:
47 resource_access_query:
51 ${resource} (one of exchange or queue)
53 ${permission} (one of configure, write or read)
55 The terms configure, write and read for resource access have the same
56 meanings that they do for the built-in RabbitMQ permissions system,
57 see http://www.rabbitmq.com/access-control.html
63 Note that tag_queries consists of a proplist, mapping the name of a
64 tag to a query to perform to determine whether or not the user has
65 that tag. You must list queries for all tags that you want your users
73 Like the Exists Query, substitutes arguments into a pattern to look
74 for an object. However, this query returns true if the logged in user
80 {match, StringSubQuery, RESubQuery}
82 Takes a string and a regular expression, and checks that the one
83 matches the other. Note that the string and the regular expression are
91 Just substitutes arguments into a string. As this returns a string
92 rather than a boolean it should be used within a match query.
97 {attribute, DNPattern, AttributeName}
99 Returns the value of an attribute of an object retrieved from LDAP. As
100 this returns a string rather than a boolean it should be used within a
106 {for, [{Name, Value, SubQuery}, ...]}
108 This allows you to split up a query and handle different cases with
109 different subqueries.
111 Options should be a list of three-tuples, with each tuple containing a
112 name, value and subquery. The name is the name of a variable
113 (i.e. something that would go into a ${} substitution). The value is a
114 possible value for that variable.
118 {resource_access_query,
119 {for, [{resource, exchange,
120 {for, [{permission, configure,
121 { in_group, "cn=wheel,ou=groups,dc=example,dc=com" }
123 {permission, write, {constant, true}},
124 {permission, read, {constant, true}}
126 {resource, queue, {constant, true}} ]}}
128 would allow members of the "wheel" group to declare and delete
129 exchanges, and allow all users to do everything else.
131 Example Configuration
132 =====================
134 TODO improve and explain this
137 {rabbit, [{auth_backends, [rabbit_auth_backend_ldap]}]},
138 {rabbitmq_auth_backend_ldap,
139 [ {servers, ["my-ldap-server"]},
140 {user_dn_pattern, "cn=${username},ou=People,dc=example,dc=com"},
141 {vhost_access_query, {exists,
142 "ou=${vhost},ou=vhosts,dc=example,dc=com"}},
143 {resource_access_query,
144 {for, [{resource, exchange,
145 {for, [{permission, configure,
146 { in_group, "cn=wheel,ou=groups,dc=example,dc=com" }
148 {permission, write, {constant, true}},
149 {permission, read, {constant, true}}
151 {resource, queue, {constant, true}} ]}},
152 {tag_queries, [{administrator, {constant, false}}]},