identity_linker 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/identity_linker.gemspec +1 -1
- data/lib/identity_linker/config.rb +2 -1
- data/lib/identity_linker/linker.rb +65 -95
- data/lib/identity_linker/version.rb +1 -1
- metadata +11 -6
data/identity_linker.gemspec
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module IdentityLinker
|
2
|
-
Config = Struct.new(:server_id, :server_secret) do
|
2
|
+
Config = Struct.new(:server_id, :server_secret, :wsdl) do
|
3
3
|
|
4
4
|
def self.default
|
5
5
|
config = new
|
6
|
+
config.wsdl = 'https://signin.ccci.org/ws-identity-linking/idlinking?wsdl'
|
6
7
|
config
|
7
8
|
end
|
8
9
|
|
@@ -5,36 +5,33 @@ module IdentityLinker
|
|
5
5
|
class Linker
|
6
6
|
extend Savon::Model
|
7
7
|
|
8
|
-
endpoint "https://signin.ccci.org/ws-identity-linking/idlinking"
|
9
|
-
namespace "http://webservice.linking.idm.ccci.org/"
|
8
|
+
#endpoint "https://signin.ccci.org/ws-identity-linking/idlinking"
|
9
|
+
#namespace "http://webservice.linking.idm.ccci.org/"
|
10
10
|
|
11
11
|
attr_reader :server_id, :server_secret
|
12
12
|
|
13
|
+
def self.client
|
14
|
+
@client ||= Savon.client(wsdl: IdentityLinker.config.wsdl)
|
15
|
+
end
|
16
|
+
|
13
17
|
def initialize(server_id = nil, server_secret = nil)
|
14
18
|
@server_id = server_id || IdentityLinker.config.server_id
|
15
19
|
@server_secret = server_secret || IdentityLinker.config.server_secret
|
16
20
|
end
|
17
21
|
|
18
22
|
def find_linked_identity(id_type, id_value, target)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
if response.success?
|
34
|
-
return response.to_hash[:find_linked_identity_response][:linked_identity]
|
35
|
-
end
|
36
|
-
rescue Savon::SOAP::Fault => e
|
37
|
-
raise Error.new(e)
|
23
|
+
response = client.call(:find_linked_identity, message: {
|
24
|
+
server_id: server_id,
|
25
|
+
server_secret: server_secret,
|
26
|
+
identity: {
|
27
|
+
id_type: id_type,
|
28
|
+
id_value: id_value
|
29
|
+
},
|
30
|
+
target: target
|
31
|
+
})
|
32
|
+
|
33
|
+
if response.success?
|
34
|
+
return response.to_hash[:find_linked_identity_response][:linked_identity]
|
38
35
|
end
|
39
36
|
|
40
37
|
nil
|
@@ -45,26 +42,20 @@ module IdentityLinker
|
|
45
42
|
end
|
46
43
|
|
47
44
|
def find_linked_identity_with_details(id_type, id_value, target)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
if response.success?
|
63
|
-
return response.to_hash[:find_linked_identity_with_details_response][:linked_identity]
|
64
|
-
end
|
65
|
-
rescue Savon::SOAP::Fault => e
|
66
|
-
raise Error.new(e)
|
45
|
+
response = client.call(:find_linked_identity_with_details, message: {
|
46
|
+
server_id: server_id,
|
47
|
+
server_secret: server_secret,
|
48
|
+
identity: {
|
49
|
+
id_type: id_type,
|
50
|
+
id_value: id_value
|
51
|
+
},
|
52
|
+
target: target
|
53
|
+
})
|
54
|
+
|
55
|
+
if response.success?
|
56
|
+
return response.to_hash[:find_linked_identity_with_details_response][:linked_identity]
|
67
57
|
end
|
58
|
+
|
68
59
|
nil
|
69
60
|
end
|
70
61
|
|
@@ -73,24 +64,17 @@ module IdentityLinker
|
|
73
64
|
end
|
74
65
|
|
75
66
|
def find_all_linked_identities(id_type, id_value)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
if response.success?
|
90
|
-
return response.to_hash[:find_all_linked_identities_response][:linked_identity]
|
91
|
-
end
|
92
|
-
rescue Savon::SOAP::Fault => e
|
93
|
-
raise Error.new(e)
|
67
|
+
response = client.call(:find_all_linked_identities, message: {
|
68
|
+
server_id: server_id,
|
69
|
+
server_secret: server_secret,
|
70
|
+
identity: {
|
71
|
+
id_type: id_type,
|
72
|
+
id_value: id_value
|
73
|
+
}
|
74
|
+
})
|
75
|
+
|
76
|
+
if response.success?
|
77
|
+
return response.to_hash[:find_all_linked_identities_response][:linked_identity]
|
94
78
|
end
|
95
79
|
|
96
80
|
nil
|
@@ -101,24 +85,17 @@ module IdentityLinker
|
|
101
85
|
end
|
102
86
|
|
103
87
|
def find_all_linked_identities_with_details(id_type, id_value)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
if response.success?
|
118
|
-
return response.to_hash[:find_all_linked_identities_with_details_response][:linked_identity]
|
119
|
-
end
|
120
|
-
rescue Savon::SOAP::Fault => e
|
121
|
-
raise Error.new(e)
|
88
|
+
response = client.call(:find_all_linked_identities_with_details, message: {
|
89
|
+
server_id: server_id,
|
90
|
+
server_secret: server_secret,
|
91
|
+
identity: {
|
92
|
+
id_type: id_type,
|
93
|
+
id_value: id_value
|
94
|
+
}
|
95
|
+
})
|
96
|
+
|
97
|
+
if response.success?
|
98
|
+
return response.to_hash[:find_all_linked_identities_with_details_response][:linked_identity]
|
122
99
|
end
|
123
100
|
|
124
101
|
nil
|
@@ -129,25 +106,18 @@ module IdentityLinker
|
|
129
106
|
end
|
130
107
|
|
131
108
|
def find_linked_identities_of_type(id_type, id_value, target)
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
145
|
-
|
146
|
-
if response.success?
|
147
|
-
return [response.to_hash[:find_linked_identities_of_type_response][:linked_identity]].flatten.compact
|
148
|
-
end
|
149
|
-
rescue Savon::SOAP::Fault => e
|
150
|
-
raise Error.new(e)
|
109
|
+
response = client.call(:find_linked_identities_of_type, message: {
|
110
|
+
server_id: server_id,
|
111
|
+
server_secret: server_secret,
|
112
|
+
identity: {
|
113
|
+
id_type: id_type,
|
114
|
+
id_value: id_value
|
115
|
+
},
|
116
|
+
target: target
|
117
|
+
})
|
118
|
+
|
119
|
+
if response.success?
|
120
|
+
return [response.to_hash[:find_linked_identities_of_type_response][:linked_identity]].flatten.compact
|
151
121
|
end
|
152
122
|
|
153
123
|
nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: identity_linker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: savon
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 2.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.1.0
|
30
30
|
description: Ruby library for accessing Cru's Identity Linking system
|
31
31
|
email:
|
32
32
|
- josh.starcher@gmail.com
|
@@ -58,18 +58,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- - ! '>='
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
hash: -11102958888312575
|
61
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
65
|
none: false
|
63
66
|
requirements:
|
64
67
|
- - ! '>='
|
65
68
|
- !ruby/object:Gem::Version
|
66
69
|
version: '0'
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
hash: -11102958888312575
|
67
73
|
requirements: []
|
68
74
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.8.
|
75
|
+
rubygems_version: 1.8.23
|
70
76
|
signing_key:
|
71
77
|
specification_version: 3
|
72
78
|
summary: Ruby library for accessing Cru's Identity Linking system
|
73
79
|
test_files:
|
74
80
|
- spec/spec_helper.rb
|
75
|
-
has_rdoc:
|