
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Offers the most common Yale LDAP search queries, returning a convenient ruby hash with names you can understand. Makes it easy to conserve your Yale users' time and energy, saving them from typing again and again that basic information they know mother Yale already has on record.
The LDAP server behaves differently depending on whether you are on Yale's network (on campus/VPN) or not. Some information (like name, upi) are available from anywhere, while other information (like netid, office phone number) are only available on Yale's network.
Add this line to your application's Gemfile:
gem 'yaleldap'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yaleldap
To play with it, open irb
and try these:
require 'yaleldap'
attributes = YaleLDAP.lookup(netid: "csw3")
attributes = YaleLDAP.lookup(email: "casey.watts@yale.edu")
attributes = YaleLDAP.lookup(upi: "12714662")
###NetID
YaleLDAP.lookup(netid: "csw3")
=> {:first_name=>"Casey", :nickname=>"", :last_name=>"Watts", :upi=>"12714662", :netid=>"csw3", :email=>"casey.watts@yale.edu", :title=>"Assistant Manager", :division=>"Information Technology Services", :school=>"Information Technology Services", :school_abbreviation=>"", :organization=>"ITSCCT Web Technologies", :major=>"", :curriculum=>"", :college_name=>"", :college_abbreviation=>"", :class_year=>"", :telephone=>"203-436-5986", :address=>"ITS Student Technology Collaborative\nPO BOX 208300\nNew Haven, CT 06520-8300"}
YaleLDAP.lookup(email: "casey.watts@yale.edu")
=> {:first_name=>"Casey", :nickname=>"", :last_name=>"Watts", :upi=>"12714662", :netid=>"csw3", :email=>"casey.watts@yale.edu", :title=>"Assistant Manager", :division=>"Information Technology Services", :school=>"Information Technology Services", :school_abbreviation=>"", :organization=>"ITSCCT Web Technologies", :major=>"", :curriculum=>"", :college_name=>"", :college_abbreviation=>"", :class_year=>"", :telephone=>"203-436-5986", :address=>"ITS Student Technology Collaborative\nPO BOX 208300\nNew Haven, CT 06520-8300"}
###UPI
YaleLDAP.lookup(upi: "12714662")
=> {:first_name=>"Casey", :nickname=>"", :last_name=>"Watts", :upi=>"12714662", :netid=>"csw3", :email=>"casey.watts@yale.edu", :title=>"Assistant Manager", :division=>"Information Technology Services", :school=>"Information Technology Services", :school_abbreviation=>"", :organization=>"ITSCCT Web Technologies", :major=>"", :curriculum=>"", :college_name=>"", :college_abbreviation=>"", :class_year=>"", :telephone=>"203-436-5986", :address=>"ITS Student Technology Collaborative\nPO BOX 208300\nNew Haven, CT 06520-8300"}
###What data is returned?
"What does the returned data look like? Where does it come from?"
We map a memorable nickname to each of the less memorable formal LDAP names.
lib/yaleldap.rb
under self.nicknames
Division [listed as division, school] - general category, most people have this. For students, this is their school)
Yale College
Graduate School of Arts & Sci
Architecture School
Pharmacology
MYSM School Of Medicine
Information Technology Services
Curriculum Code [listed as school_abbreviation] - seems to be abbreviation of division if they are a school?)
YC
GS
AC
Organization [listed as organization] - more specific, staff tend to have these
MPHARM Administration
ITSCCT Web Technologies
Curriculum/Major [listed as curriculum, major] - more specific, students tend to have these
Pharmacology
Architecture School
Physics
"I want some data that's in the Yale Phonebook but it's not in the
YaleLDAP
gem."
You can use an "after_create" filter to have these attributes filled out after the user is created (maybe after first login if that's how your app works). .slice(:first_name, :last_name, :netid)
will extract only the attributes you want to save to ActiveRecord. If your database uses diferent names you will have to rename the appropriate attributes manually using your own ruby code.
class User < ActiveRecord::Base
after_create :get_ldap_attributes
def get_ldap_attributes
attributes = YaleLDAP.lookup(netid: netid)
.slice(:first_name, :last_name, :netid)
self.update_attributes(attributes)
rescue
false # don't actually save it if LDAP lookup fails
end
end
The source code is documented thoroughly, view it on rdoc.info
For more background on how the net-ldap
gem works with specific Yale examples, check out this Yale net-ldap gist.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)load "./lib/yaleldap.rb"
(from the directory this repo is in).bundle exec guard
, which uses guard-rspec to run our testing suite.yard
then open docs/index.html
to view them.FAQs
Unknown package
We found that yaleldap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.