fluent-plugin-cloud-feeds 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDY1ODgzYTM5YWM1Nzk4OGFlOWJkODcxYzU2MjE1N2I3MzdlNGFiMw==
4
+ MzAzN2YxMjcwMGFmMjYzYjc3MGE4OTY0NzMzMmM1YzY4NDQ1MTQ3MA==
5
5
  data.tar.gz: !binary |-
6
- YjM3NWRjZGY1YTMzMGZkYzg3Yjk3ZDYxMWUxNDJjMTcxMzIzOTVlYg==
6
+ MmFkZmM4Nzc5MjkxNzNjNzFmMmJkNThiYjQ0YWJmN2QxNTQ2OWY4Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Mjg1OTBjMjEzY2QwZTgwZWU2MDJhODJkMmRiMWQ0ZDdlODEyMDI1NmEzNzJi
10
- MWI1MWRmMWI2ZjBjODdhNDZmNTBiNjI4ZWJmNzNkZTg4Y2Q1NWYyNDIyOGE5
11
- OWZhZGU0YWNkYWRhZTFmYWJhMDU5NWRmZmE5NjkyZWYxZTVmNTg=
9
+ ZWQ3ZDZmMzQwZmQ4NmE5NjFkNjRjMzgxOTdjM2QxOGViMjkyMGI4YTFjNjhl
10
+ MzY5NTU0NzY2YjY3YzYwZDVmNDdiMjUxZWQ0ZWFjMGM0MTQ5NWE5ZWVmMjEz
11
+ Y2Y4YjRjM2IxMzBhZDdlZTk0ZDFiMDBlNTg4MTQwYjU3ODk2YWM=
12
12
  data.tar.gz: !binary |-
13
- MDQxYzg2MTdjZTg2ZDUxYzlmNmVhY2UxZTE5ZGJmYWRhNWY4ZmYwNDczMmZh
14
- NTM0ZGI0M2Y2YjJkOGM2NGFlNDIxY2E3M2Y0YjIwOTNiOTRhYjQwZmUyZTdi
15
- YmIxYzkzMWIzZjI2YTVlMGFlMWQ0NWVhYTdkYTc4ZDUzM2M2Mzc=
13
+ YmNiMmUzNTY5ZGYzMDE3OTJmZDgwOWFiNDE5M2UxMjU4YWQ0MmZiNWQyZjIy
14
+ YzkyYWJiM2JmMWRkZGNiOTEwNTQ5NWFmMTRmYWM4MzUxNWQ3MDkwYzIyMDJm
15
+ MzY1OTMyMDMxMzIzMTkyMTFmYzI4YmY2NWZjMDlmNjdjM2QzYzg=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-cloud-feeds (1.0.2)
4
+ fluent-plugin-cloud-feeds (1.1.0)
5
5
  fluentd (= 0.12.7)
6
6
  net-http-persistent (>= 2.7)
7
7
 
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "fluent-plugin-cloud-feeds"
5
- s.version = "1.0.2"
5
+ s.version = "1.1.0"
6
6
  s.authors = ["David Kowis", "Tyler Royal"]
7
7
  s.email= ["david.kowis@rackspace.com", "tyler.royal@rackspace.com"]
8
8
  s.homepage = "https://github.com/rackerlabs/fluent-plugin-cloud-feeds"
@@ -93,6 +93,7 @@ class Fluent::RackspaceCloudFeedsOutput < Fluent::Output
93
93
  now = DateTime.strptime(time.to_s, '%s').strftime("%FT%T.%LZ")
94
94
 
95
95
  <<EOF
96
+ <?xml version="1.0" encoding="UTF-8" ?>
96
97
  <entry xmlns="http://www.w3.org/2005/Atom">
97
98
  <id>#{SecureRandom.uuid.to_s}</id>
98
99
  <title type="text">User Access Event</title>
@@ -108,7 +109,8 @@ EOF
108
109
  es.each { |time, record|
109
110
  # take the data, put it in to an abdera envelope
110
111
  post = Net::HTTP::Post.new @feeds_uri.path
111
- post.body = atomic_wrapper(record, time)
112
+
113
+ post.body = atomic_wrapper(JSON.parse(record)['message'], time)
112
114
  unless @auth_token
113
115
  #get new auth token
114
116
  @auth_token = authenticate_user
@@ -33,6 +33,10 @@ RSpec.describe('Rackspace Cloud Feeds output plugin') do
33
33
  EOF
34
34
  end
35
35
 
36
+ def encoded_payload
37
+ {'message' => simple_sample_payload}.to_json
38
+ end
39
+
36
40
  def less_simple_payload
37
41
  <<EOF
38
42
  { "GUID" : "9b2ac70c-16c9-493e-85be-d26a39319c2b", "ServiceCode" : "repose", "Region" : "USA", "DataCenter" : "DFW", "Timestamp" : "1429546468047", "Request" : { "Method" : "GET", "URL" : "http://localhost:10006/", "QueryString" : "", "Parameters" : { }, "UserName" : "", "ImpersonatorName" : "", "ProjectID" : [ ], "Roles" : [ ], "UserAgent" : "deproxy 0.21" }, "Response" : { "Code" : 200, "Message" : "OK" }, "MethodLabel" : "" }
@@ -100,7 +104,7 @@ EOF
100
104
  stub_identity_auth_post(token)
101
105
  stub_atom_post(simple_sample_payload)
102
106
 
103
- driver.emit(simple_sample_payload)
107
+ driver.emit(encoded_payload)
104
108
 
105
109
  expect(a_request(:post, IDENTITY_URL).with do |req|
106
110
  parsed = JSON.parse(req.body)
@@ -127,7 +131,7 @@ EOF
127
131
  stub_identity_auth_post(token)
128
132
 
129
133
  stub_atom_post(simple_sample_payload)
130
- driver.emit(simple_sample_payload)
134
+ driver.emit(encoded_payload)
131
135
 
132
136
 
133
137
  expect(a_request(:post, FEED_URL).with do |req|
@@ -146,7 +150,7 @@ EOF
146
150
 
147
151
  # simulate behavior from the bufferize plugin, which will retry the call eventually
148
152
  expect {
149
- driver.emit(simple_sample_payload)
153
+ driver.emit(encoded_payload)
150
154
  }.to raise_exception(/NOT AUTHORIZED TO POST TO FEED ENDPOINT.+/)
151
155
 
152
156
  #expect another request to identity
@@ -154,7 +158,7 @@ EOF
154
158
  stub_atom_post(simple_sample_payload)
155
159
 
156
160
  #simulate the thing being called again
157
- driver.emit(simple_sample_payload)
161
+ driver.emit(encoded_payload)
158
162
 
159
163
  expect(a_request(:post, IDENTITY_URL).with do |req|
160
164
  parsed = JSON.parse(req.body)
@@ -191,7 +195,7 @@ EOF
191
195
  end
192
196
 
193
197
  expect {
194
- driver.emit(simple_sample_payload)
198
+ driver.emit(encoded_payload)
195
199
  }.to raise_exception(/Unable to authenticate with identity at.+/)
196
200
 
197
201
  expect(WebMock).not_to have_requested(:post, FEED_URL)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloud-feeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kowis