• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 373ad6ff-fad2-405a-ab26-3d30fb5ceecf

24 Dec 2024 08:24PM UTC coverage: 91.938% (+0.08%) from 91.859%
373ad6ff-fad2-405a-ab26-3d30fb5ceecf

Pull #2563

circleci

maxkadel
Put attaching xml files in their own batch
Pull Request #2563: I2321 Shift SCSB full index tasks into separate background jobs

152 of 156 new or added lines in 10 files covered. (97.44%)

65 existing lines in 17 files now uncovered.

3478 of 3783 relevant lines covered (91.94%)

366.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.31
/app/models/ldap.rb
1
require 'net/ldap'
1✔
2

3
class Ldap
1✔
4
  class << self
1✔
5
    def find_by_netid(net_id, ldap_connection: default_connection)
1✔
6
      filter = Net::LDAP::Filter.eq("uid", net_id)
2✔
7
      result = ldap_connection.search(filter:).first
2✔
8
      return {} if result.blank?
2✔
9
      attributes(result)
1✔
10
    end
11

12
    private
1✔
13

14
      def attributes(result)
1✔
15
        {
16
          netid: result[:uid]&.first,
1✔
17
          department: result[:purescollege]&.first || result[:ou]&.first,
18
          address: result[:puinterofficeaddress]&.first,
19
          telephone: result[:telephonenumber]&.first,
20
          givenname: result[:givenname]&.first,
21
          surname: result[:sn]&.first,
22
          email: result[:mail]&.first,
23
          status: result[:edupersonprimaryaffiliation]&.first,
24
          pustatus: result[:pustatus]&.first,
25
          universityid: result[:universityid]&.first,
26
          title: result[:title]&.first
27
        }
28
      end
29

30
      def default_connection
1✔
UNCOV
31
        @default_connection ||= Net::LDAP.new host: "ldap.princeton.edu", base: "o=Princeton University,c=US", port: 636,
×
32
                                              encryption: {
33
                                                method: :simple_tls,
34
                                                tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS
35
                                              }
36
      end
37
  end
38
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc