Module: Telemetry::Snmp::AuthDefaults

Included in:
Auth
Defined in:
lib/telemetry/snmp/auth/defaults.rb

Instance Method Summary collapse

Instance Method Details

#admin_groupObject



32
33
34
# File 'lib/telemetry/snmp/auth/defaults.rb', line 32

def admin_group
  opts[:admin_group] || ENV['ldap_admin_group']
end

#attrsObject



8
9
10
# File 'lib/telemetry/snmp/auth/defaults.rb', line 8

def attrs
  %w[mail cn sn objectclass givenName sAMAccountName MemberOf]
end

#filter(username = @username) ⇒ Object



28
29
30
# File 'lib/telemetry/snmp/auth/defaults.rb', line 28

def filter(username = @username)
  "(sAMAccountName=#{username})"
end

#ldap_hostObject



16
17
18
# File 'lib/telemetry/snmp/auth/defaults.rb', line 16

def ldap_host
  opts[:ldap_host] || ENV['ldap_host'] || 'localhost'
end

#ldap_portObject



20
21
22
# File 'lib/telemetry/snmp/auth/defaults.rb', line 20

def ldap_port
  opts[:ldap_port] || ENV['ldap_host'] || '389'
end

#optsObject



4
5
6
# File 'lib/telemetry/snmp/auth/defaults.rb', line 4

def opts
  @opts ||= {}
end

#providerObject



24
25
26
# File 'lib/telemetry/snmp/auth/defaults.rb', line 24

def provider
  Net::LDAP
end

#treebaseObject



12
13
14
# File 'lib/telemetry/snmp/auth/defaults.rb', line 12

def treebase
  opts[:treebase] || ENV['treebase'] || 'CN=Users,DC=com'
end

#users_groupObject



36
37
38
# File 'lib/telemetry/snmp/auth/defaults.rb', line 36

def users_group
  opts[:users_group] || ENV['ldap_users_group']
end