relay_api_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/relay_api_client/base.rb +24 -6
- data/lib/relay_api_client/version.rb +1 -1
- data/lib/relay_api_client.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4021e9cf5110be50d90340cdf10a37537c17c6b
|
4
|
+
data.tar.gz: ad30db59106af084b832516910d64c2063f68ca8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a7e593508f5fb10404d21df533d0680d2dad32510fb35e1d89663fe4be2683985a2524b60ba1bb7b977ecb4adeaeb118b98b11cae680ca97d4408dfc7cbbc2
|
7
|
+
data.tar.gz: 1dd34ed62729e93eadb6f8ac845e23324140bb19bfda8f0d1abf763db3a736584f40ab040a45c895229a9d58f6aa0ea44bead03d56ca79534ec087a1a7fa7ece
|
data/.gitignore
CHANGED
@@ -2,10 +2,14 @@ module RelayApiClient
|
|
2
2
|
class Base
|
3
3
|
|
4
4
|
def self.client
|
5
|
-
@client ||= Savon.client(wsdl: RelayApiClient.wsdl)
|
5
|
+
@client ||= Savon.client(wsdl: RelayApiClient.wsdl, ssl_verify_mode: :none)
|
6
6
|
end
|
7
7
|
|
8
|
-
#
|
8
|
+
# @param [String] username
|
9
|
+
# @param [String] password
|
10
|
+
# @param [String] first_name
|
11
|
+
# @param [String] last_name
|
12
|
+
# @return [String] Returns the guid of the new account
|
9
13
|
def self.create_account(username, password, first_name, last_name)
|
10
14
|
password = password.gsub('&', '&').gsub('<', '<').gsub('>','>').gsub("'", "'").gsub("\"", """)
|
11
15
|
begin
|
@@ -25,20 +29,34 @@ module RelayApiClient
|
|
25
29
|
end
|
26
30
|
end
|
27
31
|
rescue => e
|
28
|
-
if e.message
|
32
|
+
if e.message.include?("user already exists")
|
29
33
|
# check identity linking
|
30
34
|
if RelayApiClient.linker_username &&
|
31
|
-
|
32
|
-
|
35
|
+
RelayApiClient.linker_password &&
|
36
|
+
l = IdentityLinker::Linker.find_linked_identity('relay_username', username, 'ssoguid')
|
33
37
|
return l[:identity][:id_value]
|
34
38
|
end
|
35
39
|
else
|
36
40
|
raise
|
37
41
|
end
|
38
42
|
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# @param ssoguid [String]
|
46
|
+
# @param designation [String]
|
47
|
+
# @return [Boolean] true if it succeeded, false otherwise.
|
48
|
+
def self.set_designation_number(ssoguid, designation)
|
49
|
+
response = client.call(:set_designation, message: {ssoguid: ssoguid, designation: designation})
|
39
50
|
|
40
|
-
|
51
|
+
response.success?
|
41
52
|
end
|
42
53
|
|
54
|
+
# @param args [Hash] arguments to pass on to SOAP call
|
55
|
+
# @return [Boolean] true if it succeeded, false otherwise.
|
56
|
+
def self.set_role(args)
|
57
|
+
response = client.call(:set_role, message: args)
|
58
|
+
|
59
|
+
response.success?
|
60
|
+
end
|
43
61
|
end
|
44
62
|
end
|
data/lib/relay_api_client.rb
CHANGED
@@ -8,7 +8,7 @@ module RelayApiClient
|
|
8
8
|
def configure
|
9
9
|
yield self
|
10
10
|
|
11
|
-
self.wsdl ||= 'https://signin.
|
11
|
+
self.wsdl ||= 'https://signin.cru.org/sso/selfservice/webservice/5.0?wsdl'
|
12
12
|
|
13
13
|
if linker_username && linker_password
|
14
14
|
IdentityLinker.configure do |c|
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relay_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Starcher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: identity_linker
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Client for the Relay API
|
@@ -73,7 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
77
77
|
- Gemfile
|
78
78
|
- LICENSE.txt
|
79
79
|
- README.md
|
@@ -92,17 +92,17 @@ require_paths:
|
|
92
92
|
- lib
|
93
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.4.2
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Client for the Relay API
|