REST Configuration

Configuration File

$ cat /etc/commissaire/commissaire.conf
{
  "listen-interface": "127.0.0.1",
  "listen-port": 8000,
  "tls-pemfile": "/path/to/server.pem",
  "bus-uri": "redis://127.0.0.1:6379/",
  "authentication-plugins": [{
    "name": "commissaire_http.authentication.httpbasicauth",
    "filepath": "conf/users.json"
  }],
 "self-auths": ["/api/v0/secrets"]
}

Via CLI

usage: cli.py [-h] [--debug] [--config-file CONFIG_FILE] [--no-config-file]
              [--listen-interface LISTEN_INTERFACE]
              [--listen-port LISTEN_PORT] [--tls-pemfile TLS_PEMFILE]
              [--tls-clientverifyfile TLS_CLIENTVERIFYFILE]
              [--authentication-plugin MODULE_NAME:key=value,..]
              [--self-auth SELF_AUTHS] [--bus-exchange BUS_EXCHANGE]
              [--bus-uri BUS_URI]

optional arguments:
  -h, --help            show this help message and exit
  --debug               Turn on debug logging to stdout
  --config-file CONFIG_FILE, -c CONFIG_FILE
                        Full path to a JSON configuration file (command-line
                        arguments override)
  --no-config-file      Disregard default configuration file, if it exists
  --listen-interface LISTEN_INTERFACE, -i LISTEN_INTERFACE
                        Interface to listen on
  --listen-port LISTEN_PORT, -p LISTEN_PORT
                        Port to listen on
  --tls-pemfile TLS_PEMFILE
                        Full path to the TLS PEM for the commissaire server
  --tls-clientverifyfile TLS_CLIENTVERIFYFILE
                        Full path to the TLS file containing the certificate
                        authorities that client certificates should be
                        verified against
  --authentication-plugin MODULE_NAME:key=value,..
                        Authentication Plugin module and configuration.
  --self-auth SELF_AUTHS
                        URI paths which provide their own authentication.
  --bus-exchange BUS_EXCHANGE
                        Message bus exchange name.
  --bus-uri BUS_URI     Message bus connection URI. See:http://kombu.readthedo
                        cs.io/en/latest/userguide/connections.html

Example: commissaire -c conf/myconfig.json

Example

The following will run the same server as the above configuration file examples.

Note

--no-config is required when bypassing the configuration file!

$ commissaire-server --no-config \
    --bus-uri redis://127.0.0.1:6379/ \
    --bus-exchange commissaire \
    --tls-pemfile /path/to/server.pem \
    --listen-interface 8000 \
    --authentication-plugin commissaire_http.authentication.httpbasicauth:filepath=conf/users.json \
    --self-auth /api/v0/secrets

Authentication

Multiple authentication plugins can be configured via the CLI. To do this use the --authentication-plugin switch multiple times.

...
--authentication-plugin commissaire_http.authentication.httbasicauth:filepath=conf/users.json \
--authentication-plugin commissaire_http.authentication.keystonetokenauth:url=https://example.com