Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ldap_lookup

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap_lookup

  • 0.1.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

LdapLookup for Ruby Gem Version

Description

This module is to be used for anonymous lookup of user attributes in the MCommunity service provide at the University of Michigan. It can be easily modifed to use other LDAP server configurations.


Try it out

Requirements:

  • Ruby at least 2.0.0
  • Gem 'net-ldap' ~> '0.17.0'

The Net::LDAP (aka net-ldap) gem before 0.16.0 for Ruby has a Missing SSL Certificate Validation.

To try the module out:

  1. Clone the repo
  2. Edit the configurations by opening ldaptest.rb and set the CONFIGURATION BLOCK to your environment.
LdapLookup.configuration do |config|
      config.host = < your host > # "ldap.umich.edu"
      config.port = < your port > # "986" the default is set to "389" so this optional
      config.base = < your LDAP base > # "dc=umich,dc=edu"
      config.dept_attribute = < your dept attribute > # "umichPostalAddressData"
      config.group_attribute = < your group email attribute > # "umichGroupEmail"
end
  1. run the ldaptest.rb script
ruby ./ldaptest.rb

Installation

Add this line to your application's Gemfile:

gem 'ldap_lookup'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ldap_lookup

In your application create a file config/initializers/ldap_lookup.rb

LdapLookup.configuration do |config|
    config.host = < your host > # "ldap.umich.edu"
    config.port = < your port > # "954" port 389 is set by default
    config.base = < your LDAP base > # "dc=umich,dc=edu"
    config.dept_attribute = < your dept attribute > # "umichPostalAddressData"
    config.group_attribute = < your group email attribute > # "umichGroupEmail"
end

Methods available

uid_exist?: returns true if uid is in LDAP

LdapLookup.uid_exist?(uniqname)

get_simple_name: returns the Display Name

LdapLookup.get_simple_name(uniqname = nil)

get_dept: returns the users Department_name

LdapLookup.get_dept(uniqname = nil)

get_email: returns the users email address

LdapLookup.get_email(uniqname = nil)

is_member_of_group?: returns true/false if uniqname is a member of the specified group

LdapLookup.is_member_of_group?(uid = nil, group_name = nil)

get_email_distribution_list: Returns the list of emails that are associated to a group.

LdapLookup.get_email_distribution_list(group_name = nil)

all_groups_for_user: Returns the list of groups that a user is a member of.

LdapLookup.all_groups_for_user(uniqname = nil)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rsmoke/ldap_lookup. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the LdapLookup project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 12 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc