4me-sdk 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/sdk4me/client.rb +1 -1
- data/lib/sdk4me/client/version.rb +1 -1
- data/spec/lib/sdk4me/attachments_spec.rb +3 -3
- data/spec/lib/sdk4me/client_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e60520cbd73635cb830ffbe38668234a3a626561066fd8b63936e69f80ddbe79
|
4
|
+
data.tar.gz: 35409fc13cf51fcea5f445347e5fff9e4fdf0bde66f67cb4ee6e42d3b8bda215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02ba8ae69285fe81b9915546be3c8ba07298d6cc55620fcd830e2c8ff33429f786d7cf33685c08f90e658dade1d7a30c17031ef89f98c3b1478cbcf976e65f55
|
7
|
+
data.tar.gz: 16da929f4143f8412faf517e1b8941d932ef8a98508b8cc2a8708db12d481481058118212320089b7a8679c65bb3490089e6f5567bf1329d573206a541d130ff
|
data/lib/sdk4me/client.rb
CHANGED
@@ -283,7 +283,7 @@ module Sdk4me
|
|
283
283
|
elsif '303' == response.raw.code.to_s
|
284
284
|
@logger.debug { "Redirect: #{response.raw.header['Location']}" }
|
285
285
|
else
|
286
|
-
@logger.error { "
|
286
|
+
@logger.error { "#{request.method} request to #{domain}:#{port}#{request.path} failed: #{response.message}" }
|
287
287
|
end
|
288
288
|
response
|
289
289
|
end
|
@@ -123,7 +123,7 @@ describe Sdk4me::Attachments do
|
|
123
123
|
it 'should report an error when 4me confirmation fails' do
|
124
124
|
stub_request(:post, 'https://itrp.s3.amazonaws.com/').with(body: @multi_part_body, headers: @multi_part_headers).to_return(body: 'OK', status: 303, headers: {'Location' => 'https://mycompany.4me.com/s3_success?sig=99e82e8a046'})
|
125
125
|
stub_request(:get, "https://api.4me.com/v1/s3_success?sig=99e82e8a046&key=#{@key}").with(basic_auth: ['secret', 'x']).to_return(body: {message: 'oops!'}.to_json)
|
126
|
-
expect_log('
|
126
|
+
expect_log('GET request to api.4me.com:443/v1/s3_success?sig=99e82e8a046&key=attachments%2F5%2Freqs%2F000%2F070%2F451%2Fzxxb4ot60xfd6sjg%2Fupload%2Etxt failed: oops!', :error)
|
127
127
|
expect_log("Attachment upload failed: 4me confirmation s3_success?sig=99e82e8a046 for #{@key} failed: oops!", :error)
|
128
128
|
expect(@attachments.send(:upload_attachment, @aws_conf, "#{@fixture_dir}/upload.txt", false)).to be_nil
|
129
129
|
end
|
@@ -161,14 +161,14 @@ describe Sdk4me::Attachments do
|
|
161
161
|
|
162
162
|
it 'should report an error when 4me upload fails' do
|
163
163
|
stub_request(:post, 'https://api.4me.com/v1/attachments').with(basic_auth: ['secret', 'x']).with(body: @multi_part_body, headers: @multi_part_headers).to_return(body: {message: 'oops!'}.to_json)
|
164
|
-
expect_log('
|
164
|
+
expect_log('POST request to api.4me.com:443/v1/attachments failed: oops!', :error)
|
165
165
|
expect_log("Attachment upload failed: 4me upload to https://api.4me.com/attachments for #{@key} failed: oops!", :error)
|
166
166
|
expect(@attachments.send(:upload_attachment, @sdk4me_conf, "#{@fixture_dir}/upload.txt", false)).to be_nil
|
167
167
|
end
|
168
168
|
|
169
169
|
it 'should raise an exception when 4me upload fails' do
|
170
170
|
stub_request(:post, 'https://api.4me.com/v1/attachments').with(basic_auth: ['secret', 'x']).with(body: @multi_part_body, headers: @multi_part_headers).to_return(body: {message: 'oops!'}.to_json)
|
171
|
-
expect_log('
|
171
|
+
expect_log('POST request to api.4me.com:443/v1/attachments failed: oops!', :error)
|
172
172
|
message = "Attachment upload failed: 4me upload to https://api.4me.com/attachments for #{@key} failed: oops!"
|
173
173
|
expect{ @attachments.send(:upload_attachment, @sdk4me_conf, "#{@fixture_dir}/upload.txt", true) }.to raise_error(::Sdk4me::UploadFailed, message)
|
174
174
|
end
|
@@ -326,7 +326,7 @@ describe Sdk4me::Client do
|
|
326
326
|
expect_log("Response:\n{\n \"state\": \"processing\"\n}", :debug)
|
327
327
|
expect_log("Import of '#{@fixture_dir}/people.csv' is processing. Checking again in 30 seconds.", :debug)
|
328
328
|
expect_log('Sending GET request to api.4me.com:443/v1/import/68ef5ef0f64c0', :debug)
|
329
|
-
expect_log("
|
329
|
+
expect_log("GET request to api.4me.com:443/v1/import/68ef5ef0f64c0 failed: 500: No Response from Server - network error for 'api.4me.com:443/v1/import/68ef5ef0f64c0'", :error)
|
330
330
|
expect_log('Sending GET request to api.4me.com:443/v1/import/68ef5ef0f64c0', :debug)
|
331
331
|
expect_log("Response:\n{\n \"state\": \"done\",\n \"results\": {\n \"errors\": 0,\n \"updated\": 1,\n \"created\": 1,\n \"failures\": 0,\n \"unchanged\": 0,\n \"deleted\": 0\n }\n}", :debug)
|
332
332
|
|
@@ -429,7 +429,7 @@ describe Sdk4me::Client do
|
|
429
429
|
expect_log(%(Response:\n{\n "state": "processing"\n}), :debug)
|
430
430
|
expect_log("Export of 'people' is processing. Checking again in 30 seconds.", :debug)
|
431
431
|
expect_log('Sending GET request to api.4me.com:443/v1/export/68ef5ef0f64c0', :debug)
|
432
|
-
expect_log("
|
432
|
+
expect_log("GET request to api.4me.com:443/v1/export/68ef5ef0f64c0 failed: 500: No Response from Server - network error for 'api.4me.com:443/v1/export/68ef5ef0f64c0'", :error)
|
433
433
|
expect_log('Sending GET request to api.4me.com:443/v1/export/68ef5ef0f64c0', :debug)
|
434
434
|
expect_log(%(Response:\n{\n "state": "done",\n "url": "https://download.example.com/export.zip?AWSAccessKeyId=12345"\n}), :debug)
|
435
435
|
|
@@ -467,7 +467,7 @@ describe Sdk4me::Client do
|
|
467
467
|
it 'should not retry when max_retry_time = -1' do
|
468
468
|
stub = stub_request(:get, 'https://api.4me.com/v1/me').with(basic_auth: ['secret', 'x']).to_raise(StandardError.new('network error'))
|
469
469
|
expect_log('Sending GET request to api.4me.com:443/v1/me', :debug )
|
470
|
-
expect_log("
|
470
|
+
expect_log("GET request to api.4me.com:443/v1/me failed: 500: No Response from Server - network error for 'api.4me.com:443/v1/me'", :error)
|
471
471
|
|
472
472
|
client = Sdk4me::Client.new(api_token: 'secret', max_retry_time: -1)
|
473
473
|
response = client.get('me')
|
@@ -512,7 +512,7 @@ describe Sdk4me::Client do
|
|
512
512
|
it 'should not block on rate limit when block_at_rate_limit is false' do
|
513
513
|
stub = stub_request(:get, 'https://api.4me.com/v1/me').with(basic_auth: ['secret', 'x']).to_return(status: 429, body: {message: 'Too Many Requests'}.to_json)
|
514
514
|
expect_log('Sending GET request to api.4me.com:443/v1/me', :debug )
|
515
|
-
expect_log("
|
515
|
+
expect_log("GET request to api.4me.com:443/v1/me failed: 429: Too Many Requests", :error)
|
516
516
|
|
517
517
|
client = Sdk4me::Client.new(api_token: 'secret', block_at_rate_limit: false)
|
518
518
|
response = client.get('me')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 4me-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 4me
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01
|
11
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_config
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.7.6.2
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: The official 4me SDK for Ruby. Provides easy access to the APIs found at
|