Subsequent requests to the client endpoint return the client_id but not the secret.
### Testing
Current coverage:
- API: yes
- Pika RabbitMQ implementation: no
```
pytest
```
### Running via docker-compose
Using `docker-compose` will mean that everything is setup automatically, this includes the `rabbitmq` container, the backbone API, and the backbone bus. The `run-compose.sh` script has been provided to simplify this even further - all you have to do is set whatever env vars you need in the `.env` file and then run `./run-compose.sh` (the defaults in `.env` are fine for local dev work, but ones not labelled `optional` will need setting in a production setting). The env vars are:
...
...
@@ -35,8 +46,10 @@ Using `docker-compose` will mean that everything is setup automatically, this in
#### Setup
In a virtual environment
```
pipenv install
pip install -r requirements-dev.txt
```
#### RabbitMQ
...
...
@@ -46,29 +59,38 @@ pipenv install
#### API
```
pipenv run python api.py
python api.py
```
#### Create some clients
`POST` to `http://localhost:3000/clients`
#### Event bus
```
pipenv run python soar_bus.py
python soar_bus.py
```
### Usage
To use the backbone you have to create a client.
The client id and name should be unique but human
readable. A client secret is returned by the API
and client credential grants using this client_id
and secret are used to authenticate client
application connections.
#### Create some clients
`POST` to `http://localhost:3000/clients`
#### Send / Receive directly
```
# Send a message
pipenv run python client_send.py noc-c2-outbox 'soar.noc.slocum.something' from noc-c2
python client_send.py noc-c2-outbox 'soar.noc.slocum.something' from noc-c2
```
```
# Receive messages
pipenv run python client_read.py noc-sfmc-inbox
python client_read.py noc-sfmc-inbox
```
#### Receive via API
...
...
@@ -80,14 +102,3 @@ secret matches before allowing the request.