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 +8 -8
- data/Gemfile.lock +1 -1
- data/fluent-plugin-cloud-feeds.gemspec +1 -1
- data/lib/fluent/plugin/out_rackspace_cloud_feeds.rb +3 -1
- data/spec/feeds_output_spec.rb +9 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzAzN2YxMjcwMGFmMjYzYjc3MGE4OTY0NzMzMmM1YzY4NDQ1MTQ3MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmFkZmM4Nzc5MjkxNzNjNzFmMmJkNThiYjQ0YWJmN2QxNTQ2OWY4Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWQ3ZDZmMzQwZmQ4NmE5NjFkNjRjMzgxOTdjM2QxOGViMjkyMGI4YTFjNjhl
|
10
|
+
MzY5NTU0NzY2YjY3YzYwZDVmNDdiMjUxZWQ0ZWFjMGM0MTQ5NWE5ZWVmMjEz
|
11
|
+
Y2Y4YjRjM2IxMzBhZDdlZTk0ZDFiMDBlNTg4MTQwYjU3ODk2YWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmNiMmUzNTY5ZGYzMDE3OTJmZDgwOWFiNDE5M2UxMjU4YWQ0MmZiNWQyZjIy
|
14
|
+
YzkyYWJiM2JmMWRkZGNiOTEwNTQ5NWFmMTRmYWM4MzUxNWQ3MDkwYzIyMDJm
|
15
|
+
MzY1OTMyMDMxMzIzMTkyMTFmYzI4YmY2NWZjMDlmNjdjM2QzYzg=
|
data/Gemfile.lock
CHANGED
@@ -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
|
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
|
-
|
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
|
data/spec/feeds_output_spec.rb
CHANGED
@@ -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(
|
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(
|
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(
|
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(
|
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(
|
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)
|