candlepin/candlepin — pull request #653 by mstead (2014-07-24 15:47:52+00:00)
Title: Add basic auth support for mongodb in gutterball

Working on a doc to set up mongodb in auth mode this AM. Here's a rundown:

Setup mongodb so that it runs in auth mode.
```
$ sudo vim /etc/mongod.conf

# Uncomment the following line
auth=true
```

Restart mongodb
```
$ sudo systemctl restart mongod
```

Create an admin user in mongodb.
```
$ mongo

> use admin
> db.addUser("admin", "admin")
```

Create a user for the gutterball db.
```
$ mongo

> use admin
> db.auth("admin", "admin")
> use gutterball
> db.addUser("gutterball", "password")
```

Edit gutterball's default.properties file so that it reflects your gutterball db user's credentials.
```
gutterball.mongodb.username = gutterball
gutterball.mongodb.password = password
```

Redeploy gutterball so that the config changes are moved over and test via the temporary EventResource.
Event list will be empty, but if you do not get an auth exception thrown, you are good.
```
$ ./gutterball/bin/deploy
$ curl -k https://localhost:8443/gutterball/status
$ curl -k https://localhost:8443/gutterball/events
[]
```