mongodb secret backend: Improve and correct errors in documentation; improve "parameter is required" error response messages

This commit is contained in:
Matt Hurne 2016-07-07 23:09:45 -04:00
parent 1d5133b8c0
commit 8d5a7992c1
3 changed files with 9 additions and 5 deletions

View file

@ -54,7 +54,7 @@ func (b *backend) pathConnectionRead(req *logical.Request, data *framework.Field
func (b *backend) pathConnectionWrite(req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
uri := data.Get("uri").(string)
if uri == "" {
return logical.ErrorResponse("uri parameter must be supplied"), nil
return logical.ErrorResponse("uri parameter is required"), nil
}
dialInfo, err := parseMongoURI(uri)

View file

@ -119,7 +119,7 @@ func (b *backend) pathRoleCreate(
roleDB := data.Get("db").(string)
if roleDB == "" {
return logical.ErrorResponse("Missing db"), nil
return logical.ErrorResponse("db parameter is required"), nil
}
// Example roles JSON: [ "readWrite", { "role": "readWrite", "db": "test" } ]

View file

@ -42,7 +42,11 @@ a standard connection string (URI):
```
$ vault write mongodb/config/connection uri="mongodb://admin:Password!@mongodb.acme.com:27017/admin?ssl=true"
Success! Data written to: mongodb/config/connection
Key Value
--- -----
The following warnings were returned from the Vault server:
* Read access to this endpoint should be controlled via ACLs as it will return the connection URI as it is, including passwords, if any.
```
In this case, we've configured Vault with the username `admin` and password
@ -103,7 +107,7 @@ lease_duration 3600
lease_renewable true
db foo
password c3faa86d-0f93-9649-de91-c431765e62dd
username token-48729def-b0ca-2b17-d7b9-3ca7cb86f0ae
username vault-token-48729def-b0ca-2b17-d7b9-3ca7cb86f0ae
```
By reading from the `creds/readonly` path, Vault has generated a new set of
@ -281,7 +285,7 @@ applications are restricted in the credentials they are allowed to read.
</li>
<li>
<span class="param">roles</span>
<span class="param-flags">required</span>
<span class="param-flags">optional</span>
MongoDB roles to assign to the users generated for this role.
</li>
</ul>