@itentialopensource/adapter-db_mongo
Version:
Itential adapter to connect to mongo
112 lines (98 loc) • 4.38 kB
Markdown
## Configuration
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or IAP are provided in the sampleProperties.
```json
{
"id": "ALL ADAPTER PROPERTIES!!!",
"properties": {
"database": "test",
"host": "system.access.resolved",
"port": 443,
"encrypt": false,
"authentication": {
"dbAuth": true,
"username": "username",
"password": "password",
"domain": "domain"
},
"ssl": {
"enabled": false,
"accept_invalid_cert": false,
"ca_file": ""
}
},
"type": "YOUR ADAPTER CLASS"
}
```
### Connection Properties
These base properties are used to connect to Mongo upon the adapter initially coming up. It is important to set these properties appropriately.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
</tr>
<tr>
<td style="padding:15px">database</td>
<td style="padding:15px">Required. The name of the database.</td>
</tr>
<tr>
<td style="padding:15px">host</td>
<td style="padding:15px">Required. A fully qualified domain name or IP address.</td>
</tr>
<tr>
<td style="padding:15px">port</td>
<td style="padding:15px">Required. Used to connect to the server.</td>
</tr>
<tr>
<td style="padding:15px">encrypt</td>
<td style="padding:15px">Optional. Used to tell the adapter to encrypt the data. The default behavior is to encrypt.</td>
</tr>
</table>
<br>
A connectivity check tells IAP the adapter has loaded successfully.
### Authentication Properties
The following properties are used to define the authentication process to Mongo.
>**Note**: Depending on the method that is used to authenticate with Mongo, you may not need to set all of the authentication properties.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
</tr>
<tr>
<td style="padding:15px">dbAuth</td>
<td style="padding:15px">Optional. Used to tell the adapter to authenticate. The default behavior is unauthenticated.</td>
</tr>
<tr>
<td style="padding:15px">username</td>
<td style="padding:15px">Used to authenticate with Mongo on every request or when pulling a token that will be used in subsequent requests.</td>
</tr>
<tr>
<td style="padding:15px">password</td>
<td style="padding:15px">Used to authenticate with Mongo on every request or when pulling a token that will be used in subsequent requests.</td>
</tr>
<tr>
<td style="padding:15px">domain</td>
<td style="padding:15px">Domain of the user used when authentication is enabled.</td>
</tr>
</table>
<br>
### SSL Properties
The SSL section defines the properties utilized for ssl authentication with Mongo. SSL can work two different ways: set the `accept\_invalid\_certs` flag to true (only recommended for lab environments), or provide a `ca\_file`.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
</tr>
<tr>
<td style="padding:15px">enabled</td>
<td style="padding:15px">If SSL is required, set to true.</td>
</tr>
<tr>
<td style="padding:15px">accept_invalid_certs</td>
<td style="padding:15px">Defines if the adapter should accept invalid certificates (only recommended for lab environments). Required if SSL is enabled. Default is false.</td>
</tr>
<tr>
<td style="padding:15px">ca_file</td>
<td style="padding:15px">Defines the path name to the CA file used for SSL. If SSL is enabled and the accept invalid certifications is false, then ca_file is required.</td>
</tr>
</table>
<br>