fix(docs): add examples

This commit is contained in:
simon 2020-02-23 20:48:44 +01:00
parent cca4dce961
commit a3ed0be02d

View File

@ -99,6 +99,21 @@ interface IGoogleLDAPAuthOptions {
} }
``` ```
Example
```js
c = {
// GoogleLDAPAuth (optimized for google auth)
authentication: 'GoogleLDAPAuth',
authenticationOptions: {
base: 'dc=hokify,dc=com',
tlsOptions: {
key: fs.readFileSync('ldap.gsuite.hokify.com.40567.key'),
cert: fs.readFileSync('ldap.gsuite.hokify.com.40567.crt')
}
}
}
```
#### LDAP #### LDAP
ldap authentication ldap authentication
@ -126,6 +141,22 @@ interface ILDAPAuthOptions {
} }
``` ```
Example
```js
c = {
authentication: 'LDAPAuth',
authenticationOptions: {
url: 'ldaps://ldap.google.com',
base: 'dc=hokify,dc=com',
tlsOptions: {
key: fs.readFileSync('ldap.gsuite.hokify.com.40567.key'),
cert: fs.readFileSync('ldap.gsuite.hokify.com.40567.crt'),
servername: 'ldap.google.com'
}
}
}
```
#### IMAP #### IMAP
imap authenticiation imap authenticiation
@ -139,6 +170,19 @@ interface IIMAPAuthOptions {
} }
``` ```
Example
```js
c = {
authentication: 'IMAPAuth',
authenticationOptions: {
host: 'imap.gmail.com',
port: 993,
useSecureTransport: true,
validHosts: ['hokify.com']
}
}
```
#### SMTP #### SMTP
smtp authenticiation smtp authenticiation
@ -152,6 +196,19 @@ interface ISMTPAuthOptions {
} }
``` ```
Example
```js
c = {
authentication: 'IMAPAuth',
authenticationOptions: {
host: 'smtp.gmail.com',
port: 465,
useSecureTransport: true,
validHosts: ['gmail.com']
}
}
```
#### Static Auth #### Static Auth
static authenticiation static authenticiation
@ -165,8 +222,22 @@ interface IStaticAuthOtions {
} }
``` ```
Example
```js
c = {
authentication: 'StaticAuth',
authenticationOptions: {
validCredentials: [
{ username: 'test', password: 'pwd' },
{ username: 'user1', password: 'password' },
{ username: 'admin', password: 'cool' }
]
}
}
```
## Usage ## Usage
Ensure you have installed latest node version and run: Ensure you have installed latest nightly node version and run:
npm run start npm run start