fluent-plugin-s3 0.8.3 → 0.8.4

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: 337c5d2366c1bc76613288e4a23a2f53a9192078
4
- data.tar.gz: 50f1f97309df5a9ea20cea5da671b0cb451d2f0e
3
+ metadata.gz: 01ffa7311e94a67b2a4e73f48b3aaa0ae79c497c
4
+ data.tar.gz: 6f3e4f4c8b6545b08281c5253fc9c96b842e3342
5
5
  SHA512:
6
- metadata.gz: 258e52f9de5e1966a7ae34229a7ccecee0e40a140f2837937a91218d4b85a6e7f66dc0d24f99fe8d3787e7a37cf49a0b2a22144132ba3a69579eb2ad907cfdc0
7
- data.tar.gz: 410167969eddbc747058485898eea4c5048a1df14ff0ae4c3b06759cd931bd589cb31627adc767cd63c42279fab9f3cf3ffd3a4b53442dc173999f82f736d859
6
+ metadata.gz: 8c0ad9f1ff459c3b0e8cfd61d19250235fec011c6dca6b045437b38eb875a5589942fa1b3396db28b761249c60d57be54c3e632872b9b454bf4d4f9f7e6d7509
7
+ data.tar.gz: 9aac421b910d26bee7c678cde9f544dd343ea798fcef4e371c50d2f4616c2309a26d58f5a49090812750868ccb01683e2cc6b75fa68e34c83bd7588b2938b0ae
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ Release 0.8.4 - 2017/06/26
2
+
3
+ * in_s3: Fix object handling for URL encoded key
4
+ * Improve error message for startup API error
5
+
6
+
1
7
  Release 0.8.3 - 2017/05/09
2
8
 
3
9
  * Add tmp_dir parameter to change the directory for tempfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.3
1
+ 0.8.4
@@ -11,6 +11,7 @@ module Fluent
11
11
  require 'zlib'
12
12
  require 'time'
13
13
  require 'tempfile'
14
+ require 'cgi/util'
14
15
 
15
16
  @extractor = nil
16
17
  end
@@ -223,12 +224,12 @@ module Fluent
223
224
  @bucket.objects.first
224
225
  log.debug("Succeeded to verify API keys")
225
226
  rescue => e
226
- raise "can't call S3 API. Please check your aws_key_id / aws_sec_key or s3_region configuration. error = #{e.inspect}"
227
+ raise "can't call S3 API. Please check your credentials or s3_region configuration. error = #{e.inspect}"
227
228
  end
228
229
 
229
230
  def process(body)
230
231
  s3 = body["Records"].first["s3"]
231
- key = s3["object"]["key"]
232
+ key = CGI.unescape(s3["object"]["key"])
232
233
 
233
234
  io = @bucket.object(key).get.body
234
235
  content = @extractor.extract(io)
@@ -349,7 +349,7 @@ module Fluent
349
349
  rescue Aws::S3::Errors::NoSuchBucket
350
350
  # ignore NoSuchBucket Error because ensure_bucket checks it.
351
351
  rescue => e
352
- raise "can't call S3 API. Please check your aws_key_id / aws_sec_key or s3_region configuration. error = #{e.inspect}"
352
+ raise "can't call S3 API. Please check your credentials or s3_region configuration. error = #{e.inspect}"
353
353
  end
354
354
 
355
355
  def setup_credentials
data/test/test_in_s3.rb CHANGED
@@ -183,6 +183,42 @@ class S3InputTest < Test::Unit::TestCase
183
183
  end
184
184
  end
185
185
 
186
+ def test_one_record_url_encoded
187
+ setup_mocks
188
+ d = create_driver(CONFIG + "\ncheck_apikey_on_start false\nstore_as text\nformat none\n")
189
+ d.expect_emit("input.s3", @time, {"message" => "aaa"})
190
+
191
+ s3_object = stub(Object.new)
192
+ s3_response = stub(Object.new)
193
+ s3_response.body { StringIO.new("aaa") }
194
+ s3_object.get { s3_response }
195
+ @s3_bucket.object('test key').at_least(1) { s3_object }
196
+
197
+ body = {
198
+ "Records" => [
199
+ {
200
+ "s3" => {
201
+ "object" => {
202
+ "key" => "test+key"
203
+ }
204
+ }
205
+ }
206
+ ]
207
+ }
208
+ message = Struct::StubMessage.new(1, 1, Yajl.dump(body))
209
+ @sqs_poller.get_messages(anything, anything) do |config, stats|
210
+ config.before_request.call(stats) if config.before_request
211
+ stats.request_count += 1
212
+ if stats.request_count >= 1
213
+ d.instance.instance_variable_set(:@running, false)
214
+ end
215
+ [message]
216
+ end
217
+ assert_nothing_raised {
218
+ d.run
219
+ }
220
+ end
221
+
186
222
  def test_one_record_multi_line
187
223
  setup_mocks
188
224
  d = create_driver(CONFIG + "\ncheck_apikey_on_start false\nstore_as text\nformat none\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-09 00:00:00.000000000 Z
12
+ date: 2017-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd