authpds 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -3
- data/Rakefile +1 -2
- data/lib/authpds.rb +4 -14
- data/lib/authpds/acts_as_authentic.rb +3 -60
- data/lib/authpds/acts_as_authentic/core_attributes.rb +24 -0
- data/lib/authpds/acts_as_authentic/expiration.rb +19 -0
- data/lib/authpds/acts_as_authentic/institutions_attributes.rb +34 -0
- data/lib/authpds/controllers/authpds_controller.rb +3 -61
- data/lib/authpds/controllers/authpds_controller/core_attributes.rb +24 -0
- data/lib/authpds/controllers/authpds_controller/institution_attributes.rb +54 -0
- data/lib/authpds/controllers/authpds_controller/url_handling.rb +18 -0
- data/lib/authpds/controllers/authpds_sessions_controller.rb +0 -1
- data/lib/authpds/session.rb +15 -247
- data/lib/authpds/session/authentication.rb +24 -0
- data/lib/authpds/session/authlogic_callbacks.rb +12 -0
- data/lib/authpds/session/authorization.rb +16 -0
- data/lib/authpds/session/callbacks.rb +30 -0
- data/lib/authpds/session/config.rb +60 -0
- data/lib/authpds/session/core_attributes.rb +45 -0
- data/lib/authpds/session/exception_handling.rb +22 -0
- data/lib/authpds/session/institution_attributes.rb +15 -0
- data/lib/authpds/session/pds_user.rb +17 -0
- data/lib/authpds/session/record.rb +32 -0
- data/lib/authpds/session/url_handling.rb +55 -0
- data/lib/authpds/version.rb +1 -1
- data/test/{unit/authpds_controller_test.rb → authpds_controller_test.rb} +19 -11
- data/test/{unit/authpds_user_sessions_controller_test.rb → authpds_user_sessions_controller_test.rb} +3 -1
- data/test/fixtures/users.yml +2 -2
- data/test/pds_test.rb +83 -0
- data/test/support/config/institutions.yml +4 -4
- data/test/test_helper.rb +10 -4
- data/test/{unit/user_session_test.rb → user_session_test.rb} +34 -28
- data/test/{unit/user_test.rb → user_test.rb} +2 -2
- data/test/vcr_cassettes/bor_info_valid_newschool.yml +35 -0
- data/test/vcr_cassettes/bor_info_valid_nyu.yml +40 -0
- data/test/vcr_cassettes/get_attribute_authenticate.yml +36 -0
- data/test/vcr_cassettes/get_attribute_bor_id.yml +32 -0
- data/test/vcr_cassettes/get_attribute_bor_info.yml +40 -0
- data/test/vcr_cassettes/get_attribute_bor_verification.yml +32 -0
- data/test/vcr_cassettes/get_attribute_invalid_bor_info.yml +33 -0
- data/test/vcr_cassettes/invalid_bor_info.yml +33 -0
- data/test/vcr_cassettes/nyu.yml +40 -0
- metadata +104 -21
- data/test/unit/pds_test.rb +0 -62
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://logindev.library.nyu.edu/pds
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: func=get-attribute&attribute=bor_info&calling_system=authpds&pds_handle=12112012141859298424685706599355
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Mon, 12 Nov 2012 19:21:03 GMT
|
21
|
+
Server:
|
22
|
+
- Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8n mod_perl/2.0.4 Perl/v5.8.9
|
23
|
+
Transfer-Encoding:
|
24
|
+
- chunked
|
25
|
+
Content-Type:
|
26
|
+
- text/html; charset=UTF-8
|
27
|
+
body:
|
28
|
+
encoding: US-ASCII
|
29
|
+
string: ! '<?xml version = "1.0" encoding = "UTF-8"?><bor-info><id>N12162279</id><expiry-date>20121031</expiry-date><alpha>L</alpha><birth-date>00000000</birth-date><con-lng>ENG</con-lng><delinq-1>00</delinq-1><delinq-1-update-date>00000000</delinq-1-update-date><delinq-2>03</delinq-2><delinq-2-cat-name>CROWEC</delinq-2-cat-name><delinq-2-update-date>20120619</delinq-2-update-date><delinq-3>00</delinq-3><delinq-3-update-date>00000000</delinq-3-update-date><delinq-n-2>Added
|
30
|
+
to arrears</delinq-n-2><field-2>Added to Arrears 6/19/12 CTC</field-2><home-library>BOBST</home-library><id>N12162279</id><name>DALTON,SCOT
|
31
|
+
THOMAS</name><name-key>dalton scot thomas N12162279</name-key><open-date>20041119</open-date><update-date>20120728</update-date><address-0>DALTON,SCOT
|
32
|
+
THOMAS</address-0><address-1>274 PROSPECT PARK WEST, #2L</address-1><address-2>BROOKLYN</address-2><address-3>NY</address-3><zip>11215</zip><bor-status>51</bor-status><expiry-date>20121031</expiry-date><barcode>21142224061247</barcode><bor-status>51</bor-status><bor-type>CB</bor-type><name>SCOT
|
33
|
+
THOMAS</name><email>std5@nyu.edu</email><cn>DALTON,SCOT THOMAS</cn><givenname>SCOT
|
34
|
+
THOMAS</givenname><sn>DALTON</sn><verification>DALT</verification><nyuidn>N12162279</nyuidn><ill-permission>Y</ill-permission><college_code>GA</college_code><college_name>Graduate
|
35
|
+
School of Arts and Science</college_name><dept_code>CSCI</dept_code><dept_name>DIVISION
|
36
|
+
OF LIBRARIES</dept_name><major_code>GAINFOMS</major_code><major>Information
|
37
|
+
Systems</major><email_address>std5@nyu.edu</email_address><institute>NYU</institute></bor-info>'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Mon, 12 Nov 2012 19:21:03 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: require_all
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.2.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.2.1
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: rails
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +66,7 @@ dependencies:
|
|
50
66
|
requirements:
|
51
67
|
- - ~>
|
52
68
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.5.
|
69
|
+
version: 1.5.0
|
54
70
|
type: :runtime
|
55
71
|
prerelease: false
|
56
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +74,7 @@ dependencies:
|
|
58
74
|
requirements:
|
59
75
|
- - ~>
|
60
76
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.5.
|
77
|
+
version: 1.5.0
|
62
78
|
- !ruby/object:Gem::Dependency
|
63
79
|
name: institutions
|
64
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,21 +92,53 @@ dependencies:
|
|
76
92
|
- !ruby/object:Gem::Version
|
77
93
|
version: '0'
|
78
94
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
95
|
+
name: rake
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
81
97
|
none: false
|
82
98
|
requirements:
|
83
|
-
- -
|
99
|
+
- - ~>
|
84
100
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
101
|
+
version: 0.9.2.2
|
86
102
|
type: :development
|
87
103
|
prerelease: false
|
88
104
|
version_requirements: !ruby/object:Gem::Requirement
|
89
105
|
none: false
|
90
106
|
requirements:
|
91
|
-
- -
|
107
|
+
- - ~>
|
92
108
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
109
|
+
version: 0.9.2.2
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: vcr
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.3.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 2.3.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: webmock
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 1.9.0
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 1.9.0
|
94
142
|
description: Libraries that use Ex Libris products, can integrate Rails application
|
95
143
|
with PDS to provide single sign-on across systems.
|
96
144
|
email:
|
@@ -99,10 +147,27 @@ executables: []
|
|
99
147
|
extensions: []
|
100
148
|
extra_rdoc_files: []
|
101
149
|
files:
|
150
|
+
- lib/authpds/acts_as_authentic/core_attributes.rb
|
151
|
+
- lib/authpds/acts_as_authentic/expiration.rb
|
152
|
+
- lib/authpds/acts_as_authentic/institutions_attributes.rb
|
102
153
|
- lib/authpds/acts_as_authentic.rb
|
154
|
+
- lib/authpds/controllers/authpds_controller/core_attributes.rb
|
155
|
+
- lib/authpds/controllers/authpds_controller/institution_attributes.rb
|
156
|
+
- lib/authpds/controllers/authpds_controller/url_handling.rb
|
103
157
|
- lib/authpds/controllers/authpds_controller.rb
|
104
158
|
- lib/authpds/controllers/authpds_sessions_controller.rb
|
105
159
|
- lib/authpds/exlibris/pds.rb
|
160
|
+
- lib/authpds/session/authentication.rb
|
161
|
+
- lib/authpds/session/authlogic_callbacks.rb
|
162
|
+
- lib/authpds/session/authorization.rb
|
163
|
+
- lib/authpds/session/callbacks.rb
|
164
|
+
- lib/authpds/session/config.rb
|
165
|
+
- lib/authpds/session/core_attributes.rb
|
166
|
+
- lib/authpds/session/exception_handling.rb
|
167
|
+
- lib/authpds/session/institution_attributes.rb
|
168
|
+
- lib/authpds/session/pds_user.rb
|
169
|
+
- lib/authpds/session/record.rb
|
170
|
+
- lib/authpds/session/url_handling.rb
|
106
171
|
- lib/authpds/session.rb
|
107
172
|
- lib/authpds/version.rb
|
108
173
|
- lib/authpds.rb
|
@@ -110,17 +175,26 @@ files:
|
|
110
175
|
- MIT-LICENSE
|
111
176
|
- Rakefile
|
112
177
|
- README.rdoc
|
178
|
+
- test/authpds_controller_test.rb
|
113
179
|
- test/authpds_test.rb
|
180
|
+
- test/authpds_user_sessions_controller_test.rb
|
114
181
|
- test/fixtures/users.yml
|
182
|
+
- test/pds_test.rb
|
115
183
|
- test/support/config/institutions.yml
|
116
184
|
- test/support/user.rb
|
117
185
|
- test/support/user_session.rb
|
118
186
|
- test/test_helper.rb
|
119
|
-
- test/
|
120
|
-
- test/
|
121
|
-
- test/
|
122
|
-
- test/
|
123
|
-
- test/
|
187
|
+
- test/user_session_test.rb
|
188
|
+
- test/user_test.rb
|
189
|
+
- test/vcr_cassettes/bor_info_valid_newschool.yml
|
190
|
+
- test/vcr_cassettes/bor_info_valid_nyu.yml
|
191
|
+
- test/vcr_cassettes/get_attribute_authenticate.yml
|
192
|
+
- test/vcr_cassettes/get_attribute_bor_id.yml
|
193
|
+
- test/vcr_cassettes/get_attribute_bor_info.yml
|
194
|
+
- test/vcr_cassettes/get_attribute_bor_verification.yml
|
195
|
+
- test/vcr_cassettes/get_attribute_invalid_bor_info.yml
|
196
|
+
- test/vcr_cassettes/invalid_bor_info.yml
|
197
|
+
- test/vcr_cassettes/nyu.yml
|
124
198
|
homepage: http://github.com/scotdalton/authpds
|
125
199
|
licenses: []
|
126
200
|
post_install_message:
|
@@ -135,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
209
|
version: '0'
|
136
210
|
segments:
|
137
211
|
- 0
|
138
|
-
hash:
|
212
|
+
hash: 890743191205962912
|
139
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
214
|
none: false
|
141
215
|
requirements:
|
@@ -144,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
218
|
version: '0'
|
145
219
|
segments:
|
146
220
|
- 0
|
147
|
-
hash:
|
221
|
+
hash: 890743191205962912
|
148
222
|
requirements: []
|
149
223
|
rubyforge_project:
|
150
224
|
rubygems_version: 1.8.24
|
@@ -153,14 +227,23 @@ specification_version: 3
|
|
153
227
|
summary: Allows applications to use Ex Libris' Patron Directory Service (PDS) for
|
154
228
|
authentication.
|
155
229
|
test_files:
|
230
|
+
- test/authpds_controller_test.rb
|
156
231
|
- test/authpds_test.rb
|
232
|
+
- test/authpds_user_sessions_controller_test.rb
|
157
233
|
- test/fixtures/users.yml
|
234
|
+
- test/pds_test.rb
|
158
235
|
- test/support/config/institutions.yml
|
159
236
|
- test/support/user.rb
|
160
237
|
- test/support/user_session.rb
|
161
238
|
- test/test_helper.rb
|
162
|
-
- test/
|
163
|
-
- test/
|
164
|
-
- test/
|
165
|
-
- test/
|
166
|
-
- test/
|
239
|
+
- test/user_session_test.rb
|
240
|
+
- test/user_test.rb
|
241
|
+
- test/vcr_cassettes/bor_info_valid_newschool.yml
|
242
|
+
- test/vcr_cassettes/bor_info_valid_nyu.yml
|
243
|
+
- test/vcr_cassettes/get_attribute_authenticate.yml
|
244
|
+
- test/vcr_cassettes/get_attribute_bor_id.yml
|
245
|
+
- test/vcr_cassettes/get_attribute_bor_info.yml
|
246
|
+
- test/vcr_cassettes/get_attribute_bor_verification.yml
|
247
|
+
- test/vcr_cassettes/get_attribute_invalid_bor_info.yml
|
248
|
+
- test/vcr_cassettes/invalid_bor_info.yml
|
249
|
+
- test/vcr_cassettes/nyu.yml
|
data/test/unit/pds_test.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PdsTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@pds_url = "https://logindev.library.nyu.edu"
|
7
|
-
@calling_system = "authpds"
|
8
|
-
@valid_pds_handle_for_nyu = VALID_PDS_HANDLE_FOR_NYU
|
9
|
-
@valid_pds_handle_for_newschool = VALID_PDS_HANDLE_FOR_NEWSCHOOL
|
10
|
-
@invalid_pds_handle = INVALID_PDS_HANDLE
|
11
|
-
@attribute = "bor_info"
|
12
|
-
end
|
13
|
-
|
14
|
-
test "get_attribute_valid" do
|
15
|
-
get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "bor_info")
|
16
|
-
assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
|
17
|
-
get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "bor_verification")
|
18
|
-
assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
|
19
|
-
get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "bor_id")
|
20
|
-
assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
|
21
|
-
get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu, "authenticate")
|
22
|
-
assert_equal("N12162279", get_attribute.response.at("//id").inner_text)
|
23
|
-
end
|
24
|
-
|
25
|
-
test "get_attribute_invalid" do
|
26
|
-
get_attribute = Authpds::Exlibris::Pds::GetAttribute.new(@pds_url, @calling_system, @invalid_pds_handle, "bor_info")
|
27
|
-
assert_equal("Error User does not exist", get_attribute.error)
|
28
|
-
end
|
29
|
-
|
30
|
-
test "bor_info_valid_nyu" do
|
31
|
-
nyu = Authpds::Exlibris::Pds::BorInfo.new(@pds_url, @calling_system, @valid_pds_handle_for_nyu)
|
32
|
-
assert_equal("N12162279", nyu.id)
|
33
|
-
assert_equal("N12162279", nyu.nyuidn)
|
34
|
-
assert_equal("51", nyu.bor_status)
|
35
|
-
assert_equal("CB", nyu.bor_type)
|
36
|
-
assert_equal("SCOT THOMAS", nyu.name)
|
37
|
-
assert_equal("SCOT THOMAS", nyu.givenname)
|
38
|
-
assert_equal("DALTON", nyu.sn)
|
39
|
-
assert_equal("Y", nyu.ill_permission)
|
40
|
-
assert_equal("GA", nyu.college_code)
|
41
|
-
assert_equal("CSCI", nyu.dept_code)
|
42
|
-
assert_equal("Information Systems", nyu.major)
|
43
|
-
end
|
44
|
-
|
45
|
-
test "bor_info_valid_newschool" do
|
46
|
-
newschool = Authpds::Exlibris::Pds::BorInfo.new(@pds_url, @calling_system, @valid_pds_handle_for_newschool)
|
47
|
-
assert_equal("N00206454", newschool.id)
|
48
|
-
assert_equal("N00206454", newschool.nyuidn)
|
49
|
-
assert_equal("31", newschool.bor_status)
|
50
|
-
assert_equal("0", newschool.bor_type)
|
51
|
-
assert_equal("true", newschool.newschool_ldap)
|
52
|
-
assert_equal("Allen", newschool.name)
|
53
|
-
assert_equal("Allen", newschool.givenname)
|
54
|
-
assert_equal("Jones", newschool.sn)
|
55
|
-
assert_equal("Y", newschool.ill_permission)
|
56
|
-
end
|
57
|
-
|
58
|
-
test "bor_info_invalid" do
|
59
|
-
get_attribute = Authpds::Exlibris::Pds::BorInfo.new(@pds_url, @calling_system, @invalid_pds_handle)
|
60
|
-
assert_equal("Error User does not exist", get_attribute.error)
|
61
|
-
end
|
62
|
-
end
|