fluoride-collector 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluoride-collector/storage/s3.rb +15 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54cd336efc2c5d59e2c9cd3a00c6ca579f8f155
|
4
|
+
data.tar.gz: 7bb320297f6e4620811a116eede521c5fbc4e203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed9b473dcaadd0cf257e72355171204f7c0d75f29ef417f799d5dd9adf2a92a9d18bfede4b58cd74195e006f425fbb20e58569ef85a71cba63fb15fc61e5dc2
|
7
|
+
data.tar.gz: 67fe004ab0c308a96d8113e4d8774354d549640d5143e32a03647ec194ee8bef1bfa7ea4961942db8a59959bd5918357e2afb4ae9edddc8b8df29a26a6e6cd63
|
@@ -7,9 +7,10 @@ module Fluoride
|
|
7
7
|
module Collector
|
8
8
|
class Storage
|
9
9
|
class S3 < Storage
|
10
|
+
attr_reader :response
|
10
11
|
def write
|
11
|
-
Net::HTTP.start(host, port) do |http|
|
12
|
-
|
12
|
+
Net::HTTP.start(host, port, :use_ssl => true) do |http|
|
13
|
+
@response = http.request(put_request)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
@@ -50,7 +51,7 @@ module Fluoride
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def authorization
|
53
|
-
hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new,
|
54
|
+
hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new, access_secret, string_to_sign)
|
54
55
|
signature = Base64.strict_encode64(hmac)
|
55
56
|
|
56
57
|
"AWS #{key_id}:#{signature}"
|
@@ -69,17 +70,20 @@ module Fluoride
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def date
|
72
|
-
@date ||= Time.now.strftime("
|
73
|
+
@date ||= Time.now.strftime("%a, %d %h %Y %T %z")
|
73
74
|
end
|
74
75
|
|
75
76
|
def put_request
|
76
|
-
req
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
@req ||=
|
78
|
+
begin
|
79
|
+
req = Net::HTTP::Put.new(uri)
|
80
|
+
req["Authorization"] = authorization
|
81
|
+
req["Date"] = date
|
82
|
+
req["Content-MD5"] = content_md5
|
83
|
+
req["Content-Type"] = content_type
|
84
|
+
req.body = record_yaml
|
85
|
+
req
|
86
|
+
end
|
83
87
|
end
|
84
88
|
end
|
85
89
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluoride-collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Judson Lester
|
@@ -46,7 +46,7 @@ rdoc_options:
|
|
46
46
|
- --main
|
47
47
|
- doc/README
|
48
48
|
- --title
|
49
|
-
- fluoride-collector-0.0.
|
49
|
+
- fluoride-collector-0.0.5 Documentation
|
50
50
|
require_paths:
|
51
51
|
- lib/
|
52
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|