relay_api_client 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/relay_api_client/base.rb +17 -11
- data/lib/relay_api_client/version.rb +1 -1
- data/relay_api_client.gemspec +2 -2
- metadata +17 -33
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 48adc754f98e4c27dc1b592693d44be86a22d867
|
4
|
+
data.tar.gz: d8d1835fc632c606bcbb9cea3036b78175484d3d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a02d83209a32097df6e3580fe46ddd6ccd76962d402713afa65cffe28b8853c170f0bee0377973252b28834c9f3d0142c887cf8f0054485aecd0d664f4bc1fe5
|
7
|
+
data.tar.gz: 7753ea37766e3c781ce4a17027534e17b8f80aa7def01ba5964dca05082115c6da654b32c6da27686617b92210d95893ec533e1b9b2c1a527c8f850d79a4f926
|
@@ -8,18 +8,24 @@ module RelayApiClient
|
|
8
8
|
# returns a guid or nil
|
9
9
|
def self.create_account(username, password, first_name, last_name)
|
10
10
|
password = password.gsub('&', '&').gsub('<', '<').gsub('>','>').gsub("'", "'").gsub("\"", """)
|
11
|
-
|
11
|
+
begin
|
12
|
+
response = client.call(:signup, message: {username: username, password: password, passwordConfirm: password, firstName: first_name, lastName: last_name})
|
12
13
|
|
13
|
-
|
14
|
+
h = response.to_hash
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
if response.success?
|
17
|
+
puts h.inspect
|
18
|
+
return h[:signup_response][:user][:id]
|
19
|
+
else
|
20
|
+
case h[:fault][:faultstring]
|
21
|
+
when "password does not meet with policy requirements."
|
22
|
+
raise h[:fault][:faultstring]
|
23
|
+
else
|
24
|
+
logger.debug response.inspect
|
25
|
+
end
|
26
|
+
end
|
27
|
+
rescue => e
|
28
|
+
if e.message == "(S:Client) user already exists"
|
23
29
|
# check identity linking
|
24
30
|
if RelayApiClient.linker_username &&
|
25
31
|
RelayApiClient.linker_password &&
|
@@ -27,7 +33,7 @@ module RelayApiClient
|
|
27
33
|
return l[:identity][:id_value]
|
28
34
|
end
|
29
35
|
else
|
30
|
-
|
36
|
+
raise
|
31
37
|
end
|
32
38
|
end
|
33
39
|
|
data/relay_api_client.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency
|
22
|
-
spec.add_dependency
|
21
|
+
spec.add_dependency 'savon', '~> 2.1.0'
|
22
|
+
spec.add_dependency 'identity_linker', '~> 1.0.0'
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
25
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,52 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relay_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Josh Starcher
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: savon
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 2.1.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: 2.1.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: identity_linker
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
33
|
+
version: 1.0.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
version: 1.0.0
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: bundler
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,17 +55,15 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rake
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
description: Client for the Relay API
|
@@ -94,32 +85,25 @@ files:
|
|
94
85
|
homepage: ''
|
95
86
|
licenses:
|
96
87
|
- MIT
|
88
|
+
metadata: {}
|
97
89
|
post_install_message:
|
98
90
|
rdoc_options: []
|
99
91
|
require_paths:
|
100
92
|
- lib
|
101
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
94
|
requirements:
|
104
|
-
- -
|
95
|
+
- - '>='
|
105
96
|
- !ruby/object:Gem::Version
|
106
97
|
version: '0'
|
107
|
-
segments:
|
108
|
-
- 0
|
109
|
-
hash: -1565906089891711103
|
110
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
99
|
requirements:
|
113
|
-
- -
|
100
|
+
- - '>='
|
114
101
|
- !ruby/object:Gem::Version
|
115
102
|
version: '0'
|
116
|
-
segments:
|
117
|
-
- 0
|
118
|
-
hash: -1565906089891711103
|
119
103
|
requirements: []
|
120
104
|
rubyforge_project:
|
121
|
-
rubygems_version:
|
105
|
+
rubygems_version: 2.0.3
|
122
106
|
signing_key:
|
123
|
-
specification_version:
|
107
|
+
specification_version: 4
|
124
108
|
summary: Client for the Relay API
|
125
109
|
test_files: []
|