Skip to content

Commit

Permalink
Update README with instructions for HTTP based authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
lmsilva-wls committed May 25, 2021
1 parent 359478c commit 3df8de2
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@

An MQTT-based history handler for messages recorded by [mqttbot](https://github.com/topfreegames/mqttbot) in Cassandra


## Features

MqttHistory is an extensible

The bot is capable of:
- Listen to healthcheck requests
- Send history messages requested by users
- Retrieve message history from Cassandra when requested by users
- Authorization handling with support for MongoDB or an HTTP Authorization API

## Setup

Make sure you have go installed on your machine.
Make sure you have Go installed on your machine.

You also need to have access to running instances of Cassandra and Mongo.

Expand All @@ -42,3 +38,29 @@ If you are interested in running the tests yourself you will need docker (versio
and up) and docker-compose.

To run the tests simply run `make test`

## Authorization

The project supports checking whether a user is authorized to retrieve the message history for a given topic.
This can be done via either MongoDB- or HTTP-based authorization, depending on the configuration.

For MongoDB, which is the default method, the required settings are
```
mongo:
host: "mongodb://localhost:27017"
allow_anonymous: false # whether to make authorization checks or not
database: "mqtt"
```

For HTTP auth, the required settings are
```
httpAuth:
enabled: true # whether to use HTTP or MongoDB for authorization
requestURL: "http://localhost:8080/auth" # endpoint to make auth requests
timeout: 10 # request timeout in seconds
iam:
enabled: true # whether to use Basic Auth when accessing the Auth API
credentials: # credentials for Basic Auth
username: user
password: pass
```

0 comments on commit 3df8de2

Please sign in to comment.