Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
ldap: added timeout option
Browse files Browse the repository at this point in the history
With this option you can configure the amount of seconds for a
connection timeout with your LDAP server.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed May 15, 2018
1 parent 62aa222 commit 35ba42f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ delete:
ldap:
enabled: false

# Hostname and port of your LDAP server.
hostname: "ldap_hostname"
port: 389

# The connection timeout to be used for all LDAP requests measured in seconds.
timeout: 5

# Available options: "plain", "simple_tls" and "start_tls".
# TODO: deprecated in favor of `encryption.method`.
method: "plain"
Expand Down
8 changes: 4 additions & 4 deletions lib/portus/ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ def authentication?
end

def adapter_options
# TODO: add connect_timeout
cfg = APP_CONFIG["ldap"]
{
host: cfg["hostname"],
port: cfg["port"],
encryption: encryption(cfg)
host: cfg["hostname"],
port: cfg["port"],
connection_timeout: cfg["timeout"],
encryption: encryption(cfg)
}.tap do |options|
options.merge!(auth_options) if authentication?
end
Expand Down

0 comments on commit 35ba42f

Please sign in to comment.