telesign_lib 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +65 -0
- data/LICENSE +20 -0
- data/README.md +104 -0
- data/Rakefile +10 -0
- data/lib/telesign/api.rb +52 -0
- data/lib/telesign/auth.rb +67 -0
- data/lib/telesign/authorization_error.rb +19 -0
- data/lib/telesign/helpers.rb +22 -0
- data/lib/telesign/mock_service/fake_server.rb +215 -0
- data/lib/telesign/mock_service/railtie.rb +9 -0
- data/lib/telesign/mock_service/spin_up.rb +18 -0
- data/lib/telesign/phone_id.rb +225 -0
- data/lib/telesign/response.rb +13 -0
- data/lib/telesign/telesign_error.rb +26 -0
- data/lib/telesign/validation_error.rb +19 -0
- data/lib/telesign/verify.rb +231 -0
- data/lib/telesign/version.rb +3 -0
- data/lib/telesign.rb +14 -0
- data/telesign.gemspec +28 -0
- data/test/auth_test.rb +79 -0
- data/test/exceptions_test.rb +53 -0
- data/test/phone_id_test.rb +154 -0
- data/test/test_helper.rb +5 -0
- data/test/verify_test.rb +208 -0
- metadata +175 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ExceptionTestTest < Minitest::Test
|
4
|
+
# Test for exceptions in telesign sdk
|
5
|
+
ExpectedHttpResponse = Struct.new('MockFaraday', :headers, :status, :body)
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@expected_errors = {'errors' => [ {'code' => '1', 'description' => 'Error 1'},
|
9
|
+
{'code' => '2', 'description' => 'Error 2'}]}
|
10
|
+
@expected_headers = {a: 'AA', b: 'BB'}
|
11
|
+
@expected_status = '200'
|
12
|
+
@expected_data = 'abcdefg'
|
13
|
+
|
14
|
+
@expected_http_response = ExpectedHttpResponse.new( @expected_headers, @expected_status, @expected_data )
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def validate_exception_properties x
|
19
|
+
assert_equal x.errors, @expected_errors['errors'], 'Errors property was not set on exception'
|
20
|
+
assert_equal x.headers, @expected_headers, 'Headers property was not set on exception'
|
21
|
+
assert_equal x.status, @expected_status, 'Status property was not set on exception'
|
22
|
+
assert_equal x.data, @expected_data, 'Data property was not set on exception'
|
23
|
+
|
24
|
+
msg = x.message
|
25
|
+
@expected_errors['errors'].each do |err|
|
26
|
+
assert_match err['description'], msg
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_properties_are_populated_in_TeleSignError
|
31
|
+
begin
|
32
|
+
raise TeleSign::TeleSignError.new @expected_errors, @expected_http_response
|
33
|
+
rescue TeleSign::TeleSignError => x
|
34
|
+
validate_exception_properties x
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_properties_are_populated_in_AuthorizationError
|
39
|
+
begin
|
40
|
+
raise TeleSign::AuthorizationError.new @expected_errors, @expected_http_response
|
41
|
+
rescue TeleSign::AuthorizationError => x
|
42
|
+
validate_exception_properties x
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_properties_are_populated_in_ValidationError
|
47
|
+
begin
|
48
|
+
raise TeleSign::ValidationError.new @expected_errors, @expected_http_response
|
49
|
+
rescue TeleSign::ValidationError => x
|
50
|
+
validate_exception_properties(x)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,154 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PhoneIdTest < Minitest::Test
|
4
|
+
# Test for phone id telesign sdk
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@expected_cid = '99999999-1F7E-11E1-B760-000000000000'
|
8
|
+
@expected_secret_key = '8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M=='
|
9
|
+
@expected_phone_no = '12343455678'
|
10
|
+
@expected_data = '{ "a":"AA", "b":"BB" }'
|
11
|
+
@expected_resource = "https://rest.telesign.com/v1/phoneid/%s/%s"
|
12
|
+
@proxy = 'localhost:8080'
|
13
|
+
@expected_proxy = 'https://localhost:8080'
|
14
|
+
|
15
|
+
@acceptance_headers = { 'Accept' => /.*/,
|
16
|
+
'Authorization' => /.*/,
|
17
|
+
'User-Agent' => /.*/,
|
18
|
+
'X-Ts-Auth-Method' => /.*/,
|
19
|
+
'X-Ts-Date'=> /.*/,
|
20
|
+
'X-Ts-Nonce' => /.*/}
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_standard_phoneid
|
24
|
+
stub_request(:get, @expected_resource % ['standard', @expected_phone_no]).
|
25
|
+
with( headers: @acceptance_headers).
|
26
|
+
to_return(body: @expected_data, status: 200)
|
27
|
+
|
28
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
29
|
+
tele.phone_id.standard @expected_phone_no
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_standard_phoneid_unauthorized
|
33
|
+
response_body = '{ "a":"AA", "b":"BB", "errors": { "code":"401", "description":"Unauthorized" } }'
|
34
|
+
|
35
|
+
stub_request(:get, @expected_resource % ['standard', @expected_phone_no]).
|
36
|
+
with( headers: @acceptance_headers).
|
37
|
+
to_return(body: response_body, status: [401, 'Unauthorized'])
|
38
|
+
|
39
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
40
|
+
|
41
|
+
assert_raises(TeleSign::AuthorizationError){
|
42
|
+
tele.phone_id.standard(@expected_phone_no)
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_standard_phoneid_other_error
|
47
|
+
response_body = '{ "a":"AA", "b":"BB", "errors": { "code":"502", "description":"Bad Gateway" } }'
|
48
|
+
|
49
|
+
stub_request(:get, @expected_resource % ['standard', @expected_phone_no]).
|
50
|
+
with( headers: @acceptance_headers).
|
51
|
+
to_return(body: response_body, status: [502, 'Bad Gateway'])
|
52
|
+
|
53
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
54
|
+
|
55
|
+
assert_raises(TeleSign::TeleSignError){
|
56
|
+
tele.phone_id.standard(@expected_phone_no)
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_score_phoneid
|
61
|
+
stub_request(:get, @expected_resource % ['score', @expected_phone_no]).
|
62
|
+
with(query: {ucid: 'OTHR'}, headers: @acceptance_headers).
|
63
|
+
to_return(body: @expected_data, status: 200)
|
64
|
+
|
65
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
66
|
+
tele.phone_id.score @expected_phone_no, 'OTHR'
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_contact_phoneid
|
70
|
+
stub_request(:get, @expected_resource % ['contact', @expected_phone_no]).
|
71
|
+
with(query: {ucid: 'OTHR'}, headers: @acceptance_headers).
|
72
|
+
to_return(body: @expected_data, status: 200)
|
73
|
+
|
74
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
75
|
+
tele.phone_id.contact @expected_phone_no, 'OTHR'
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_live_phoneid
|
79
|
+
stub_request(:get, @expected_resource % ['live', @expected_phone_no]).
|
80
|
+
with(query: {ucid: 'OTHR'}, headers: @acceptance_headers).
|
81
|
+
to_return(body: @expected_data, status: 200)
|
82
|
+
|
83
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
84
|
+
tele.phone_id.live @expected_phone_no, 'OTHR'
|
85
|
+
end
|
86
|
+
|
87
|
+
# # @mock.patch.object(requests, "get")
|
88
|
+
# def test_standard_phoneid_with_proxy
|
89
|
+
# response = mock.Mock()
|
90
|
+
# response.reason = ""
|
91
|
+
# response.status_code = 200
|
92
|
+
# response.text = @expected_data
|
93
|
+
# req_mock.return_value = response
|
94
|
+
|
95
|
+
# p = PhoneId.new(@expected_cid, @expected_secret_key, @proxy)
|
96
|
+
# p.standard(@expected_phone_no)
|
97
|
+
|
98
|
+
# assert_true.called
|
99
|
+
# _, kwargs = req_mock.call_args
|
100
|
+
# assert_equal kwargs["url"], @expected_resource % ['standard', @expected_phone_no], "Phone ID resource name is incorrect"
|
101
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
102
|
+
# end
|
103
|
+
|
104
|
+
# # @mock.patch.object(requests, "get")
|
105
|
+
# def test_score_phoneid_with_proxy
|
106
|
+
# response = mock.Mock()
|
107
|
+
# response.reason = ""
|
108
|
+
# response.status_code = 200
|
109
|
+
# response.text = @expected_data
|
110
|
+
# req_mock.return_value = response
|
111
|
+
|
112
|
+
# p = PhoneId.new(@expected_cid, @expected_secret_key, @proxy)
|
113
|
+
# p.score(@expected_phone_no, 'OTHR')
|
114
|
+
|
115
|
+
# assert_true.called
|
116
|
+
# _, kwargs = req_mock.call_args
|
117
|
+
# assert_equal kwargs["url"], @expected_resource % ['score', @expected_phone_no], "Phone ID resource name is incorrect"
|
118
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
119
|
+
# end
|
120
|
+
|
121
|
+
# # @mock.patch.object(requests, "get")
|
122
|
+
# def test_contact_phoneid_with_proxy
|
123
|
+
# response = mock.Mock()
|
124
|
+
# response.reason = ""
|
125
|
+
# response.status_code = 200
|
126
|
+
# response.text = @expected_data
|
127
|
+
# req_mock.return_value = response
|
128
|
+
|
129
|
+
# p = PhoneId.new(@expected_cid, @expected_secret_key, @proxy)
|
130
|
+
# p.contact(@expected_phone_no, 'OTHR')
|
131
|
+
|
132
|
+
# assert_true.called
|
133
|
+
# _, kwargs = req_mock.call_args
|
134
|
+
# assert_equal kwargs["url"], @expected_resource % ['contact', @expected_phone_no], "Phone ID resource name is incorrect"
|
135
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
136
|
+
# end
|
137
|
+
|
138
|
+
# # @mock.patch.object(requests, "get")
|
139
|
+
# def test_live_phoneid_with_proxy
|
140
|
+
# response = mock.Mock()
|
141
|
+
# response.reason = ""
|
142
|
+
# response.status_code = 200
|
143
|
+
# response.text = @expected_data
|
144
|
+
# req_mock.return_value = response
|
145
|
+
|
146
|
+
# p = PhoneId.new(@expected_cid, @expected_secret_key, proxy_host=@proxy)
|
147
|
+
# p.live(@expected_phone_no, 'OTHR')
|
148
|
+
|
149
|
+
# assert_true.called
|
150
|
+
# _, kwargs = req_mock.call_args
|
151
|
+
# assert_equal kwargs["url"], @expected_resource % ['live', @expected_phone_no], "Phone ID resource name is incorrect"
|
152
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
153
|
+
# end
|
154
|
+
end
|
data/test/test_helper.rb
ADDED
data/test/verify_test.rb
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class VerifyTest < Minitest::Test
|
4
|
+
# Test for Verify telesign sdk
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@expected_cid = '99999999-1F7E-11E1-B760-000000000000'
|
8
|
+
@expected_secret_key = '8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M8M=='
|
9
|
+
@expected_phone_no = '12343455678'
|
10
|
+
@expected_language = 'en'
|
11
|
+
@expected_verify_code = '54321'
|
12
|
+
@expected_ref_id = '99999999999999999'
|
13
|
+
@expected_data = '{ "a":"AA", "b":"BB" }'
|
14
|
+
@expected_sms_resource = 'https://rest.telesign.com/v1/verify/sms'
|
15
|
+
@expected_call_resource = 'https://rest.telesign.com/v1/verify/call'
|
16
|
+
@expected_status_resource = "https://rest.telesign.com/v1/verify/%s" % @expected_ref_id
|
17
|
+
@proxy = 'localhost:8080'
|
18
|
+
@expected_proxy = 'https://localhost:8080'
|
19
|
+
|
20
|
+
@acceptance_headers = { 'Accept' => /.*/,
|
21
|
+
'Authorization' => /.*/,
|
22
|
+
'User-Agent' => /.*/,
|
23
|
+
'X-Ts-Auth-Method' => /.*/,
|
24
|
+
'X-Ts-Date'=> /.*/,
|
25
|
+
'X-Ts-Nonce' => /.*/,
|
26
|
+
'Content-Type'=>'application/x-www-form-urlencoded'}
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_verify_sms
|
30
|
+
fields = {phone_number: @expected_phone_no,
|
31
|
+
language: @expected_language,
|
32
|
+
verify_code: @expected_verify_code,
|
33
|
+
template: ''}
|
34
|
+
|
35
|
+
stub_request(:post, @expected_sms_resource).
|
36
|
+
with( body: fields,
|
37
|
+
headers: @acceptance_headers).
|
38
|
+
to_return(body: @expected_data, status: 200)
|
39
|
+
|
40
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
41
|
+
tele.verify.sms phone_number: @expected_phone_no,
|
42
|
+
verify_code: @expected_verify_code,
|
43
|
+
language: @expected_language
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_setting_ssl_false
|
47
|
+
fields = {phone_number: @expected_phone_no,
|
48
|
+
language: @expected_language,
|
49
|
+
verify_code: @expected_verify_code,
|
50
|
+
template: ''}
|
51
|
+
|
52
|
+
stub_request(:post, 'http://rest.telesign.com/v1/verify/sms').
|
53
|
+
with( body: fields,
|
54
|
+
headers: @acceptance_headers).
|
55
|
+
to_return(body: @expected_data, status: 200)
|
56
|
+
|
57
|
+
tele = TeleSign::Api.new customer_id: @expected_cid,
|
58
|
+
secret_key: @expected_secret_key,
|
59
|
+
ssl: false
|
60
|
+
|
61
|
+
tele.verify.sms phone_number: @expected_phone_no,
|
62
|
+
verify_code: @expected_verify_code,
|
63
|
+
language: @expected_language
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_verify_call
|
67
|
+
fields = {phone_number: @expected_phone_no,
|
68
|
+
language: @expected_language,
|
69
|
+
verify_code: @expected_verify_code}
|
70
|
+
|
71
|
+
stub_request(:post, @expected_call_resource).
|
72
|
+
with( body: fields,
|
73
|
+
headers: @acceptance_headers).
|
74
|
+
to_return(body: @expected_data, status: 200)
|
75
|
+
|
76
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
77
|
+
tele.verify.call phone_number: @expected_phone_no,
|
78
|
+
verify_code: @expected_verify_code,
|
79
|
+
language: @expected_language
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_verify_sms_default_code
|
83
|
+
fields = {phone_number: @expected_phone_no,
|
84
|
+
language: @expected_language,
|
85
|
+
verify_code: /\d{5}/,
|
86
|
+
template: ''}
|
87
|
+
|
88
|
+
stub_request(:post, @expected_sms_resource).
|
89
|
+
with( body: fields,
|
90
|
+
headers: @acceptance_headers).
|
91
|
+
to_return(body: @expected_data, status: 200)
|
92
|
+
|
93
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
94
|
+
tele.verify.sms phone_number: @expected_phone_no,
|
95
|
+
language: @expected_language
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_verify_call_default_code
|
99
|
+
fields = {phone_number: @expected_phone_no,
|
100
|
+
language: @expected_language,
|
101
|
+
verify_code: /\d{5}/}
|
102
|
+
|
103
|
+
stub_request(:post, @expected_call_resource).
|
104
|
+
with( body: fields,
|
105
|
+
headers: @acceptance_headers).
|
106
|
+
to_return(body: @expected_data, status: 200)
|
107
|
+
|
108
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
109
|
+
tele.verify.call phone_number: @expected_phone_no,
|
110
|
+
language: @expected_language
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_status_check
|
114
|
+
@acceptance_headers.delete('Content-Type')
|
115
|
+
stub_request(:get, @expected_status_resource).
|
116
|
+
with( headers: @acceptance_headers).
|
117
|
+
to_return(body: @expected_data, status: 200)
|
118
|
+
|
119
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
120
|
+
tele.verify.status @expected_ref_id
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_report_code
|
124
|
+
@acceptance_headers.delete('Content-Type')
|
125
|
+
stub_request(:get, @expected_status_resource).
|
126
|
+
with( query: {verify_code: @expected_verify_code.to_s},
|
127
|
+
headers: @acceptance_headers).
|
128
|
+
to_return(body: @expected_data, status: 200)
|
129
|
+
|
130
|
+
tele = TeleSign::Api.new customer_id: @expected_cid, secret_key: @expected_secret_key
|
131
|
+
tele.verify.status @expected_ref_id, @expected_verify_code
|
132
|
+
end
|
133
|
+
|
134
|
+
# # @mock.patch.object(requests, "post")
|
135
|
+
# def test_verify_sms_with_proxy
|
136
|
+
# response = mock.Mock()
|
137
|
+
# response.reason = ""
|
138
|
+
# response.status_code = 200
|
139
|
+
# response.text = @expected_data
|
140
|
+
# req_mock.return_value = response
|
141
|
+
|
142
|
+
# p = Verify.new(@expected_cid, @expected_secret_key, proxy_host="localhost:8080")
|
143
|
+
# p.sms(@expected_phone_no, @expected_verify_code, @expected_language)
|
144
|
+
|
145
|
+
# assert_true req_mock.called
|
146
|
+
# _, kwargs = req_mock.call_args
|
147
|
+
# assert_equal kwargs['url'], @expected_sms_resource, "Sms verify resource was incorrect"
|
148
|
+
# assert_equal kwargs["data"]["phone_number"], @expected_phone_no, "Phone number field did not match"
|
149
|
+
# assert_equal kwargs["data"]["language"], @expected_language, "Language field did not match"
|
150
|
+
# assert_equal kwargs["data"]["verify_code"], @expected_verify_code, "Verify code field did not match"
|
151
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
152
|
+
# end
|
153
|
+
|
154
|
+
# # @mock.patch.object(requests, "post")
|
155
|
+
# def test_verify_call_with_proxy
|
156
|
+
# response = mock.Mock()
|
157
|
+
# response.reason = ""
|
158
|
+
# response.status_code = 200
|
159
|
+
# response.text = @expected_data
|
160
|
+
# req_mock.return_value = response
|
161
|
+
|
162
|
+
# p = Verify.new(@expected_cid, @expected_secret_key, proxy_host=@proxy)
|
163
|
+
# p.call(@expected_phone_no, @expected_verify_code, @expected_language)
|
164
|
+
|
165
|
+
# assert_true req_mock.called
|
166
|
+
# _, kwargs = req_mock.call_args
|
167
|
+
# assert_equal kwargs['url'], @expected_call_resource, "Call verify resource was incorrect"
|
168
|
+
# assert_equal kwargs["data"]["phone_number"], @expected_phone_no, "Phone number field did not match"
|
169
|
+
# assert_equal kwargs["data"]["language"], @expected_language, "Language field did not match"
|
170
|
+
# assert_equal kwargs["data"]["verify_code"], @expected_verify_code, "Verify code field did not match"
|
171
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
172
|
+
# end
|
173
|
+
|
174
|
+
# # @mock.patch.object(requests, "get")
|
175
|
+
# def test_status_check_with_proxy
|
176
|
+
# response = mock.Mock()
|
177
|
+
# response.reason = ""
|
178
|
+
# response.status_code = 200
|
179
|
+
# response.text = @expected_data
|
180
|
+
# req_mock.return_value = response
|
181
|
+
|
182
|
+
# p = Verify.new(@expected_cid, @expected_secret_key, proxy_host=@proxy)
|
183
|
+
# p.status(@expected_ref_id)
|
184
|
+
|
185
|
+
# assert_true req_mock.called
|
186
|
+
# _, kwargs = req_mock.call_args
|
187
|
+
# assert_equal kwargs["url"], @expected_status_resource, "Status resource was incorrect"
|
188
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
189
|
+
# end
|
190
|
+
|
191
|
+
# # @mock.patch.object(requests, "get")
|
192
|
+
# def test_report_code_with_proxy
|
193
|
+
# response = mock.Mock()
|
194
|
+
# response.reason = ""
|
195
|
+
# response.status_code = 200
|
196
|
+
# response.text = @expected_data
|
197
|
+
# req_mock.return_value = response
|
198
|
+
|
199
|
+
# p = Verify.new(@expected_cid, @expected_secret_key, proxy_host=@proxy)
|
200
|
+
# p.status(@expected_ref_id, @expected_verify_code)
|
201
|
+
|
202
|
+
# assert_true req_mock.called
|
203
|
+
# _, kwargs = req_mock.call_args
|
204
|
+
# assert_equal kwargs["url"], @expected_status_resource, "Status resource was incorrect"
|
205
|
+
# assert_equal kwargs["params"]["verify_code"], @expected_verify_code, "Verify code did not match"
|
206
|
+
# assert_equal kwargs["proxies"]["https"], @expected_proxy, "Proxy did not match"
|
207
|
+
# end
|
208
|
+
end
|
metadata
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: telesign_lib
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.12
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Practice Fusion
|
8
|
+
- Andy Koch
|
9
|
+
- Andrej Antas
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: faraday
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.9'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '0.9'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: bundler
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '1.3'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.3'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: rake
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '10.4'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '10.4'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: minitest
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '5.5'
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '5.5'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: webmock
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.20'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '1.20'
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: pry
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0.10'
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0.10'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: mimic
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0.4'
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0.4'
|
113
|
+
description: Library for comunication with TeleSign REST API
|
114
|
+
email:
|
115
|
+
- akoch@practicefusion.com
|
116
|
+
executables: []
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- ".gitignore"
|
121
|
+
- Gemfile
|
122
|
+
- Gemfile.lock
|
123
|
+
- LICENSE
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- lib/telesign.rb
|
127
|
+
- lib/telesign/api.rb
|
128
|
+
- lib/telesign/auth.rb
|
129
|
+
- lib/telesign/authorization_error.rb
|
130
|
+
- lib/telesign/helpers.rb
|
131
|
+
- lib/telesign/mock_service/fake_server.rb
|
132
|
+
- lib/telesign/mock_service/railtie.rb
|
133
|
+
- lib/telesign/mock_service/spin_up.rb
|
134
|
+
- lib/telesign/phone_id.rb
|
135
|
+
- lib/telesign/response.rb
|
136
|
+
- lib/telesign/telesign_error.rb
|
137
|
+
- lib/telesign/validation_error.rb
|
138
|
+
- lib/telesign/verify.rb
|
139
|
+
- lib/telesign/version.rb
|
140
|
+
- telesign.gemspec
|
141
|
+
- test/auth_test.rb
|
142
|
+
- test/exceptions_test.rb
|
143
|
+
- test/phone_id_test.rb
|
144
|
+
- test/test_helper.rb
|
145
|
+
- test/verify_test.rb
|
146
|
+
homepage: https://github.com/redrick/ruby_telesign
|
147
|
+
licenses:
|
148
|
+
- MIT
|
149
|
+
metadata: {}
|
150
|
+
post_install_message:
|
151
|
+
rdoc_options: []
|
152
|
+
require_paths:
|
153
|
+
- lib
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
requirements: []
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.2.2
|
167
|
+
signing_key:
|
168
|
+
specification_version: 4
|
169
|
+
summary: Client gem for TeleSign REST API
|
170
|
+
test_files:
|
171
|
+
- test/auth_test.rb
|
172
|
+
- test/exceptions_test.rb
|
173
|
+
- test/phone_id_test.rb
|
174
|
+
- test/test_helper.rb
|
175
|
+
- test/verify_test.rb
|