authpds 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ module Authpds
20
20
  # GET /logout
21
21
  def destroy
22
22
  user_session = UserSession.find
23
- logout_url = user_session.logout_url(params)
23
+ logout_url = user_session.logout_url(params) unless user_session.nil?
24
24
  user_session.destroy unless user_session.nil?
25
25
  redirect_to user_session_redirect_url(logout_url)
26
26
  end
@@ -1,5 +1,5 @@
1
1
  class Institution < Struct.new(:display_name, :name, :default,
2
- :layouts, :ip_addresses, :parent_institution, :view_attributes, :login_attributes)
2
+ :layouts, :ip_addresses, :parent_institution, :views, :login)
3
3
  require 'ipaddr'
4
4
 
5
5
  # Better initializer than Struct gives us, take a hash instead
@@ -152,7 +152,7 @@ module Authpds
152
152
 
153
153
  # URL to redirect to after logout.
154
154
  def logout_url(params={})
155
- return "#{self.class.pds_url}/pds?func=logout&url=#{CGI::escape(CGI::escape(self.class.redirect_logout_url))}"
155
+ return "#{self.class.pds_url}/pds?func=logout&url=#{CGI::escape(controller.user_session_redirect_url(self.class.redirect_logout_url))}"
156
156
  end
157
157
 
158
158
  # URL to redirect to in the case of establishing a SSO session.
@@ -241,8 +241,8 @@ module Authpds
241
241
 
242
242
  def institution_attributes
243
243
  @institution_attributes =
244
- (controller.current_primary_institution.nil? or controller.current_primary_institution.login_attributes.nil?) ?
245
- {} : controller.current_primary_institution.login_attributes
244
+ (controller.current_primary_institution.nil? or controller.current_primary_institution.login.nil?) ?
245
+ {} : controller.current_primary_institution.login
246
246
  end
247
247
 
248
248
  def pds_attributes
@@ -1,3 +1,3 @@
1
1
  module Authpds
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
@@ -1,10 +1,10 @@
1
1
  NYU:
2
- login_attributes:
2
+ login:
3
3
  link_code: NYU
4
4
  logout_url: 'http://bobcat.library.nyu.edu'
5
5
  default: false
6
6
  display_name: NYU Libraries
7
- view_attributes:
7
+ views:
8
8
  test_view_attribute1: test_attribute1_nyu
9
9
  test_view_attribute2: test_attribute2_nyu
10
10
  ip_addresses:
@@ -18,41 +18,41 @@ NYU:
18
18
  NYUAD:
19
19
  default: true
20
20
  display_name: NYUAD Library
21
- view_attributes:
21
+ views:
22
22
  test_view_attribute1: test_attribute1_nyuad
23
23
  test_view_attribute2: test_attribute2_nyuad
24
24
  ip_addresses:
25
25
  - 128.122.0.1
26
26
 
27
27
  NYSID:
28
- login_attributes:
28
+ login:
29
29
  link_code: NYSID
30
30
  logout_url: 'http://bobcat.library.nyu.edu/nysid'
31
31
  default: false
32
32
  display_name: New York School of Interior Design Library
33
- view_attributes:
33
+ views:
34
34
  test_view_attribute1: test_attribute1_nysid
35
35
  test_view_attribute2: test_attribute2_nysid
36
36
  ip_addresses:
37
37
  - 128.122.0.1
38
38
 
39
39
  CU:
40
- login_attributes:
40
+ login:
41
41
  link_code: CU
42
42
  logout_url: 'http://bobcat.library.nyu.edu/cooper'
43
43
  display_name: Cooper Union Library
44
- view_attributes:
44
+ views:
45
45
  test_view_attribute1: test_attribute1_cu
46
46
  test_view_attribute2: test_attribute2_cu
47
47
  ip_addresses:
48
48
  - 199.98.16.0-199.98.31.255
49
49
 
50
50
  NS:
51
- login_attributes:
51
+ login:
52
52
  link_code: NS
53
53
  logout_url: 'http://bobcat.library.nyu.edu/newschool'
54
54
  display_name: New School Libraries
55
- view_attributes:
55
+ views:
56
56
  test_view_attribute1: test_attribute1_ns
57
57
  test_view_attribute2: test_attribute2_ns
58
58
  ip_addresses:
@@ -12,9 +12,9 @@ default:
12
12
  layouts:
13
13
  resolve: layouts/nyu/resolve
14
14
  search: layouts/nyu/search
15
- login_attributes:
15
+ login:
16
16
  link_code: NYU
17
- view_attributes:
17
+ views:
18
18
  tabs_partial: search/nyu/tabs
19
19
  tip1_partial: search/nyu/tip1
20
20
  tip2_partial: search/nyu/tip2
@@ -250,7 +250,7 @@ NYUAD:
250
250
  parent_institution: NYU
251
251
  resolve_layout: layouts/nyuad/resolve
252
252
  search_layout: layouts/nyuad/search
253
- view_attributes:
253
+ views:
254
254
  tabs_partial: search/nyuad/tabs
255
255
  tip1_partial: search/nyuad/tip1
256
256
  tip2_partial: search/nyu/tip2
@@ -286,9 +286,9 @@ CU:
286
286
  display_name: The Cooper Union Library
287
287
  resolve_layout: layouts/cu/resolve
288
288
  search_layout: layouts/cu/search
289
- login_attributes:
289
+ login:
290
290
  link_code: CU
291
- view_attributes:
291
+ views:
292
292
  tabs_partial: search/cu/tabs
293
293
  sfx_base_url: http://sfx.library.nyu.edu/sfxcooper?
294
294
  ip_addresses:
@@ -312,9 +312,9 @@ NS:
312
312
  display_name: New School Libraries
313
313
  resolve_layout: layouts/cu/resolve
314
314
  search_layout: layouts/cu/search
315
- login_attributes:
315
+ login:
316
316
  link_code: NS
317
- view_attributes:
317
+ views:
318
318
  tabs_partial: search/ns/tabs
319
319
  sfx_base_url: http://sfx4.library.newschool.edu/ns?
320
320
  ip_addresses:
@@ -343,7 +343,7 @@ NS:
343
343
  COMMENTS_ABOUT_BOBCAT_LCL: help
344
344
 
345
345
  NYSID:
346
- login_attributes:
346
+ login:
347
347
  link_code: NYSID
348
348
  resolve_layout: layouts/nysid/resolve
349
349
  search_layout: layouts/nysid/search
@@ -1,6 +1,6 @@
1
1
  class UserSession < Authlogic::Session::Base
2
2
  pds_url "https://logindev.library.nyu.edu"
3
- redirect_logout_url "https://logindev.library.nyu.edu/logout"
3
+ redirect_logout_url "http://bobcatdev.library.nyu.edu"
4
4
  calling_system "authpds"
5
5
  remember_me true
6
6
  remember_me_for 300
@@ -41,7 +41,7 @@ require File.dirname(__FILE__) + '/../lib/authpds'
41
41
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
42
42
 
43
43
  class ActiveSupport::TestCase
44
- VALID_PDS_HANDLE_FOR_NYU = '83201295456116368349190324314'
44
+ VALID_PDS_HANDLE_FOR_NYU = '293201211510129623735547952389'
45
45
  VALID_PDS_HANDLE_FOR_NEWSCHOOL = '272201212284614806184193096120278'
46
46
  VALID_PDS_HANDLE_FOR_COOPER = '272201212284614806184193096120278'
47
47
  INVALID_PDS_HANDLE = "Invalid"
@@ -26,10 +26,10 @@ class PdsTest < ActiveSupport::TestCase
26
26
  assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
27
27
  get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "bor_verification")
28
28
  assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
29
- get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "authenticate")
30
- assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
31
29
  get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "bor_id")
32
30
  assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
31
+ get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "authenticate")
32
+ assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
33
33
  end
34
34
 
35
35
  test "get_attribute_invalid" do
@@ -17,7 +17,7 @@ class UserSessionTest < ActiveSupport::TestCase
17
17
  test "logout_url" do
18
18
  user_session = UserSession.new
19
19
  assert_equal(
20
- "https://logindev.library.nyu.edu/pds?func=logout&url=https%253A%252F%252Flogindev.library.nyu.edu%252Flogout",
20
+ "https://logindev.library.nyu.edu/pds?func=logout&url=http%3A%2F%2Fbobcatdev.library.nyu.edu",
21
21
  user_session.logout_url)
22
22
  end
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authpds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-23 00:00:00.000000000 Z
12
+ date: 2012-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &2151877980 !ruby/object:Gem::Requirement
16
+ requirement: &2151877380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151877980
24
+ version_requirements: *2151877380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: authlogic
27
- requirement: &2151875960 !ruby/object:Gem::Requirement
27
+ requirement: &2151874980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2151875960
35
+ version_requirements: *2151874980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nokogiri
38
- requirement: &2151869700 !ruby/object:Gem::Requirement
38
+ requirement: &2151868120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2151869700
46
+ version_requirements: *2151868120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sqlite3
49
- requirement: &2151865680 !ruby/object:Gem::Requirement
49
+ requirement: &2151864560 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2151865680
57
+ version_requirements: *2151864560
58
58
  description: Libraries that use Ex Libris products, can integrate Rails application
59
59
  with PDS to provide single sign-on across systems.
60
60
  email: