Skip to content

Commit

Permalink
⏰ Add optional LDAP connection timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pemontto committed Oct 13, 2023
1 parent f560a5e commit 3c61445
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nodes-base/credentials/Ldap.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,12 @@ export class Ldap implements ICredentialType {
type: 'string',
default: '',
},
{
displayName: 'Timeout',
description: 'Optional connection timeout in seconds',
name: 'timeout',
type: 'number',
default: 300,
},
];
}
5 changes: 5 additions & 0 deletions packages/nodes-base/nodes/Ldap/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export async function createLdapClient(
}
}

if (credentials.timeout) {
// Convert seconds to milliseconds
ldapOptions.timeout = (credentials.timeout as number) * 1000;
}

if (nodeDebug) {
Logger.info(
`[${nodeType} | ${nodeName}] - LDAP Options: ${JSON.stringify(ldapOptions, null, 2)}`,
Expand Down

0 comments on commit 3c61445

Please sign in to comment.