Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Ldap dependency #2336

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ gem 'marc', '~> 1.0'
gem 'marc_cleanup', github: "pulibrary/marc_cleanup", tag: 'v0.9.1'
gem 'multi_json'
gem 'net-imap', require: false
gem 'net-ldap'
gem 'net-pop', require: false
gem 'net-sftp'
gem 'net-smtp', require: false
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ GEM
net-imap (0.3.7)
date
net-protocol
net-ldap (0.17.1)
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
Expand Down Expand Up @@ -684,7 +683,6 @@ DEPENDENCIES
marc_cleanup!
multi_json
net-imap
net-ldap
net-pop
net-sftp
net-smtp
Expand Down
1 change: 0 additions & 1 deletion app/controllers/patron_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def patron_info
patron_access = CampusAccess.where(uid: patron_id).first || CampusAccess.new(uid: patron_id, category: "none")
info[:campus_authorized] = patron_access.access?
info[:campus_authorized_category] = patron_access.category
info[:ldap] = Ldap.find_by_netid(patron_id) if params[:ldap].present? && sanitize(params[:ldap]) == "true"
respond_to do |wants|
wants.json { render json: MultiJson.dump(info) }
end
Expand Down
38 changes: 0 additions & 38 deletions app/models/ldap.rb

This file was deleted.

23 changes: 1 addition & 22 deletions spec/controllers/patron_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,8 @@
expect(JSON.parse(response.body)["patron_group"]).to eq "staff"
end

it "allows authenticated users to access patron info and ldap data when desired" do
expect(Ldap).to receive(:find_by_netid).with(patron_identifier).and_return(ldap_data: "is here")
get :patron_info, params: { patron_id: patron_identifier, ldap: true, format: :json }
expect(response).to have_http_status(200)
expect(JSON.parse(response.body)).to eq(
"netid" => "bbird",
"first_name" => "Big",
"last_name" => "Bird",
"barcode" => "00000000000000",
"university_id" => "100000000",
"patron_id" => "100000000",
"patron_group" => "staff",
"patron_group_desc" => "P Faculty & Professional",
"campus_authorized" => false,
"campus_authorized_category" => "none",
"ldap" => { "ldap_data" => "is here" },
"active_email" => "bbird@SCRUBBED_princeton.edu"
)
end

it "allows authenticated users to access just patron info when desired" do
expect(Ldap).not_to receive(:find_by_netid)
get :patron_info, params: { patron_id: patron_identifier, ldap: 'other', format: :json }
get :patron_info, params: { patron_id: patron_identifier, format: :json }
expect(response).to have_http_status(200)
expect(JSON.parse(response.body)).to eq(
"netid" => "bbird",
Expand Down
36 changes: 0 additions & 36 deletions spec/models/ldap_spec.rb

This file was deleted.

Loading