cattle_grid.account.rabbit
cattle_grid.account.rabbit
Implementation of a HTTP auth backend for rabbitmq.
A possible configuration of RabbitMQ is
/etc/rabbitmq/conf.d/03_http_auth.conf
auth_backends.1 = internal
auth_backends.2 = http
auth_http.http_method = post
auth_http.user_path = http://cattle_grid_app/rabbitmq/user
auth_http.vhost_path = http://cattle_grid_app/rabbitmq/vhost
auth_http.resource_path = http://cattle_grid_app/rabbitmq/resource
auth_http.topic_path = http://cattle_grid_app/rabbitmq/topic
Here, we use auth_backend = internal
for the user
corresponding to the cattle_grid
processes. As cattle_grid
connects to RabbitMQ on startup, it cannot authenticate
itself.
resource_auth()
async
topic_auth(username, name, routing_key)
async
Checks if topic is allowed. Currently allowed are
and the routing keys send.username
and receive.username
Source code in cattle_grid/account/rabbit.py
user_auth(username, password)
async
Checks login with username/password
Source code in cattle_grid/account/rabbit.py
validate_routing_key(username, routing_key)
Rules for the routing key, e.g.
>>> validate_routing_key("alice", "send.alice.trigger")
True
>>> validate_routing_key("alice", "send.bob.trigger")
False
Source code in cattle_grid/account/rabbit.py
vhost_auth(username, vhost)
async
Authentication for vhosts, currently only “/” is allowed