Module: Telemetry::Snmp::AuthDefaults
- Included in:
- Auth
- Defined in:
- lib/telemetry/snmp/auth/defaults.rb
Instance Method Summary collapse
- #admin_group ⇒ Object
- #attrs ⇒ Object
- #filter(username = @username) ⇒ Object
- #ldap_host ⇒ Object
- #ldap_port ⇒ Object
- #opts ⇒ Object
- #provider ⇒ Object
- #treebase ⇒ Object
- #users_group ⇒ Object
Instance Method Details
#admin_group ⇒ Object
32 33 34 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 32 def admin_group opts[:admin_group] || ENV['ldap_admin_group'] end |
#attrs ⇒ Object
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_host ⇒ Object
16 17 18 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 16 def ldap_host opts[:ldap_host] || ENV['ldap_host'] || 'localhost' end |
#ldap_port ⇒ Object
20 21 22 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 20 def ldap_port opts[:ldap_port] || ENV['ldap_host'] || '389' end |
#opts ⇒ Object
4 5 6 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 4 def opts @opts ||= {} end |
#provider ⇒ Object
24 25 26 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 24 def provider Net::LDAP end |
#treebase ⇒ Object
12 13 14 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 12 def treebase opts[:treebase] || ENV['treebase'] || 'CN=Users,DC=com' end |
#users_group ⇒ Object
36 37 38 |
# File 'lib/telemetry/snmp/auth/defaults.rb', line 36 def users_group opts[:users_group] || ENV['ldap_users_group'] end |