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

pulibrary / orangelight / 00dbc10b-d747-4ad7-b211-7b26d753abbb

14 Aug 2025 01:25PM UTC coverage: 0.483% (-94.9%) from 95.343%
00dbc10b-d747-4ad7-b211-7b26d753abbb

push

circleci

web-flow
Merge pull request #5181 from pulibrary/dependabot/bundler/activestorage-7.2.2.2

Bump activestorage from 7.2.2.1 to 7.2.2.2

47 of 9721 relevant lines covered (0.48%)

0.01 hits per line

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

0.0
/lib/orangelight/illiad_account.rb
1
# frozen_string_literal: true
2

3
require 'faraday'
×
4
require 'faraday-cookie_jar'
×
5
module Orangelight
×
6
  class IlliadAccount
×
7
    def initialize(patron)
×
8
      @patron = patron
×
9
      @barcode = patron['barcode']
×
10
      @last_name = patron['last_name']
×
11
      @patron_id = patron['patron_id']
×
12
      @netid = patron['netid']
×
13
      @illiad_api_key = Requests.config["illiad_api_key"]
×
14
      @illiad_api_base = Requests.config["illiad_api_base"]
×
15
    end
×
16

17
    def verify_user?
×
18
      return false if illiad_patron_response == false
×
19

20
      illiad_patron_response&.success?
×
21
    end
×
22

23
    def illiad_patron_response
×
24
      @illiad_patron_response ||= begin
×
25
        url = "/ILLiadWebPlatform/Users/#{netid}"
×
26
        Rails.logger.debug { "Illiad Get #{@illiad_api_base}/#{url}" }
×
27
        response = conn.get do |req|
×
28
          req.url url
×
29
          req.headers['Accept'] = 'application/json'
×
30
          req.headers['ApiKey'] = @illiad_api_key
×
31
        end
×
32
        Rails.logger.debug { "Illiad Get Response #{@illiad_api_base}/#{url} #{response.status} #{response.body}" }
×
33
        response
×
34
      end
×
35
    rescue Faraday::ConnectionFailed
×
36
      Rails.logger.warn("Unable to Connect to #{@illiad_api_base}")
×
37
      false
×
38
    end
×
39

40
    private
×
41

42
      attr_reader :patron, :netid
×
43

44
      def conn
×
45
        @conn ||= IlliadPatronClient.new(patron).conn
×
46
      end
×
47
  end
×
48
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