soteria 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0eb950fa75e98619d90faf4ef059c4d778ea0087
4
- data.tar.gz: afd3cb956bed8f00846f1741a612124a2f301c2b
3
+ metadata.gz: f082d6b52bc5d8fc96bc6950da2f33aebc32d6a5
4
+ data.tar.gz: 736930c62ace100297974281e59c23a3f08d4a17
5
5
  SHA512:
6
- metadata.gz: aa6cc378543d13da499fc3825ba4e5f02102366837ba0f4f888d1a1a21a60b60b753bba7cd7515ebebe8351bbeac5fbca4b346103b54b7e7e1eca58d4bc2ab68
7
- data.tar.gz: a45279763e1cf759b51daca2c46fb4de4ff2e5785ec3f57d2654e16879d97d074ef037f157e7c7753fd417fffffe6d23893dcd12da6656d1335fb5df5cfd318f
6
+ metadata.gz: 6afa28dc79eee4f65a0f5d44b57af0b757fedec334c3b2f654d384a125e8128eddc2fdf245a96fdb4d38df98a2bff61ce85999bbb14bb6c3777d258ec1e3c29e
7
+ data.tar.gz: af2a753ff5f9896510a625f23ac6af2307db1152af35da6ea58b1301016833b1d4c8abc4d7d123719a17422c792b6e4fbd8376b2663619ccf3d1dc7d20a7a4cf
data/lib/soteria/auth.rb CHANGED
@@ -3,6 +3,12 @@ module Soteria
3
3
 
4
4
  class Auth
5
5
 
6
+ # Create a Auth object to make auth calls.
7
+ #
8
+ # @param [String] cert The relative path to the SSL cert on the server.
9
+ # @param [String] key The relative path to the SSL cert key on the server.
10
+ # @param [String] pw The password for the cert key file.
11
+ # @param [Boolean] log if the client should log everything. This is good for development.
6
12
  def initialize(cert, key, pw, log)
7
13
 
8
14
  @client = Savon.client(wsdl: 'lib/wsdl/vip_auth.wsdl',
@@ -50,7 +56,7 @@ module Soteria
50
56
  },
51
57
  attributes: {
52
58
  'Version': '3.1',
53
- 'Id': '123'
59
+ 'Id': Utilities.get_request_id('set_temp_pass')
54
60
  }
55
61
  ).body
56
62
 
@@ -70,7 +76,7 @@ module Soteria
70
76
  },
71
77
  attributes: {
72
78
  'Version': '3.1',
73
- 'Id': '123'
79
+ 'Id': Utilities.get_request_id('enable_sms_credentail')
74
80
  }
75
81
  ).body
76
82
 
@@ -91,7 +97,7 @@ module Soteria
91
97
  },
92
98
  attributes: {
93
99
  'Version': '3.1',
94
- 'Id': '123'
100
+ 'Id': Utilities.get_request_id('disable_sms_credentail')
95
101
  }
96
102
  ).body
97
103
 
@@ -110,7 +116,7 @@ module Soteria
110
116
  },
111
117
  attributes: {
112
118
  'Version': '3.1',
113
- 'Id': '123'
119
+ 'Id': Utilities.get_request_id('activate_token')
114
120
  }
115
121
  ).body
116
122
 
@@ -129,7 +135,7 @@ module Soteria
129
135
  },
130
136
  attributes: {
131
137
  'Version': '3.1',
132
- 'Id': '123'
138
+ 'Id': Utilities.get_request_id('deactivate_token')
133
139
  }
134
140
  ).body
135
141
 
@@ -154,7 +160,7 @@ module Soteria
154
160
  },
155
161
  attributes: {
156
162
  'Version': '3.1',
157
- 'Id': '123'
163
+ 'Id': Utilities.get_request_id('register')
158
164
  }
159
165
  ).body
160
166
 
@@ -162,6 +168,28 @@ module Soteria
162
168
  end
163
169
 
164
170
 
171
+ # If a user’s credential is lost or stolen, use the SendTemporaryPassword for SMS API to generate and send a temporary security
172
+ # code to the user’s phone number. The system-generated, temporary security code is sent using SMS, and is valid for
173
+ # one use only. The temporary security code must be used before the specified expiration time (up to seven days).
174
+ #
175
+ # @param [Int] token_id Specifies the phone number that identifies the credential to the VIP Web Services. Do not use spaces or dashes.
176
+ # @return [Hash] A hash that contains; :success a boolean if the call succeeded, :message a string with any error message, :id the id of the call for debugging purposes
177
+ def send_temp_pass(token_id)
178
+ res = client.call(:send_temporary_password,
179
+ message: {
180
+ 'vip:TokenId': token_id,
181
+ 'vip:PhoneNumber': token_id
182
+ },
183
+ attributes: {
184
+ 'Version': '3.1',
185
+ 'Id': Utilities.get_request_id('send_temp_pass')
186
+ }
187
+ ).body
188
+
189
+ get_return_hash(res[:send_temporary_password_response])
190
+ end
191
+
192
+
165
193
  # Helper function to create the hash to return. All user calls have the same return values.
166
194
  #
167
195
  # @param [Hash] res
@@ -1,4 +1,4 @@
1
1
  module Soteria
2
2
  # Version that the gem is on.
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soteria
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Casler