Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connectAsync(callback) {
logger.connection.info('Init setup');
let replied = false;
const connectionOptions = {
url: `${ this.options.host }:${ this.options.port }`,
timeout: this.options.timeout,
connectTimeout: this.options.connect_timeout,
idleTimeout: this.options.idle_timeout,
reconnect: this.options.Reconnect,
};
if (this.options.Internal_Log_Level !== 'disabled') {
connectionOptions.log = new Bunyan({
name: 'ldapjs',
component: 'client',
stream: process.stderr,
level: this.options.Internal_Log_Level,
});
}
const tlsOptions = {
rejectUnauthorized: this.options.reject_unauthorized,
};
if (this.options.ca_cert && this.options.ca_cert !== '') {
// Split CA cert into array of strings
const chainLines = settings.get('LDAP_CA_Cert').split('\n');
let cert = [];
const ca = [];
connectAsync(callback) {
log_info('Init setup');
let replied = false;
const connectionOptions = {
url : `${this.options.host}:${this.options.port}`,
timeout : this.options.timeout,
connectTimeout: this.options.connect_timeout,
idleTimeout : this.options.idle_timeout,
reconnect : this.options.Reconnect,
};
if (this.options.Internal_Log_Level !== 'disabled') {
connectionOptions.log = new Bunyan({
name : 'ldapjs',
component: 'client',
stream : process.stderr,
level : this.options.Internal_Log_Level,
});
}
const tlsOptions = {
rejectUnauthorized: this.options.reject_unauthorized,
};
if (this.options.ca_cert && this.options.ca_cert !== '') {
// Split CA cert into array of strings
const chainLines = this.constructor.settings_get('LDAP_CA_CERT').split('\n');
let cert = [];
const ca = [];
connectAsync(callback) {
logger.connection.info('Init setup');
let replied = false;
const connectionOptions = {
url: `${ this.options.host }:${ this.options.port }`,
timeout: this.options.timeout,
connectTimeout: this.options.connect_timeout,
idleTimeout: this.options.idle_timeout,
reconnect: this.options.Reconnect
};
if (this.options.Internal_Log_Level !== 'disabled') {
connectionOptions.log = new Bunyan({
name: 'ldapjs',
component: 'client',
stream: process.stderr,
level: this.options.Internal_Log_Level
});
}
const tlsOptions = {
rejectUnauthorized: this.options.reject_unauthorized
};
if (this.options.ca_cert && this.options.ca_cert !== '') {
// Split CA cert into array of strings
const chainLines = RocketChat.settings.get('LDAP_CA_Cert').split('\n');
let cert = [];
const ca = [];
function toBunyanFormat (format: string) {
switch (format) {
case 'short':
case 'long':
case 'simple':
case 'json':
case 'bunyan':
case undefined:
return format
default:
throw new Error('Invalid log format')
}
}
export const logger = new Logger({
level: toBunyanLogLevel(process.env.LOG_LEVEL || 'info'),
name: 'probot',
serializers,
stream: new bunyanFormat({
color: supportsColor.stdout,
levelInString: !!process.env.LOG_LEVEL_IN_STRING,
outputMode: toBunyanFormat(process.env.LOG_FORMAT || 'short')
})
})