telefonicaid/rabbit-acl-tool

Name: rabbit-acl-tool

Owner: Telefónica I+D

Description: RabbitMQ ACL Plugin administration tool

Created: 2017-01-13 06:51:15.0

Updated: 2017-11-07 10:34:23.0

Pushed: 2017-01-24 09:31:46.0

Homepage:

Size: 19

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rabbit MQ Topic ACL Administration

Index
Overview

This tool has been developed to ease the administration of ACL-based Topic Authorization with the MQ Topic ACL Plugin for RabbitMQ and to provide some testing tools for the development of that project. Most of the administrative tasks are performed using the AMQP Administration API defined in the former.

Usage
Deployment

This tool consists of a single Node.js project, and can be deployed by cloning its GitHub repository. To do so, execute the following command:

clone https://github.com/dmoranj/rabbit-acl-tool

Once copied in the target folder, the dependencies must be downloaded. You can do it executing the following command in the root of the project:

install
Execution

The tool consists of a single script, that can be found in the bin/ folder: acltool.js. This script is self-executable for bash shells. Execution of the script follows the pattern:

ool [options] [command] [parameters]

The following table shoes the list of allowed options:

| Option | Parameters | Description | | ————————— |:———————————– |:——————————————————– | | -h, –help | | Output usage information and ignore the rest of options | | -V, –version | | Output the version number | | -U, –username | | Connect to RabbitMQ with an alternate user name. I no user is specified, the connection will be anonymous | | -P, –password | | Password for connecting to RabbitMQ | | -H, –host | | Alternate host for the RabbitMQ server. Defaults to localhost|

Both credential options (username and password) must be given for the user to be changed in the operations. If just one of them is given, the connection will remain anonymous.

Next section describes the commands in detail with all its parameters.

The only requirement for the tool execution is: Node.js v4.7.0+.

Execution
add [user]

Adds a new permission for the selected user or a global permission if no user is given. Permissions must be one of the following: read, write or readwrite. The <topic> parameter indicates a topic pattern, as described in the MQ Topic ACL Plugin documentation.

refresh

Send a message to the RabbitMQ ACL service to refresh the ACL file for all the listeners and listen in the notifications queue to receive the refreshed ACL. If the notification is not received before the timeout is reached, the command will end.

save

Saves the current ACL Database to the given file. This command is mainly intended for the creation of backups and administrative copies for debugging. The <filename> parameter refers to a absolute path in the server hosting the target RabbitMQ. The RabbitMQ user must have write permission over the selected directory.

clear

Clear all the ACL Permissions from the database. Take into account that the Mnesia database is persistent, so this will also remove the stored permissions (they won't be reloaded after a restart).

publish

This command publish the selected message to the given AMQP exchange using the given topic as the routing key. All the operations are performed over the default VHost. If any credentials are given, they are used to publish the message. The publish will be anonymous otherwise.

listen

Wait for and display messages from the given exchange and topic. The application will listen forever, until a Control-C break sequence is issued. It will display the text of all the received messages.

 License

This tool is licensed under Affero General Public License (GPL) version 3. You can find a copy of the license in the repository root.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.