faraday_middleware-aws-sigv4 0.1.0.beta → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.travis.yml +4 -1
- data/README.md +5 -0
- data/faraday_middleware-aws-sigv4.gemspec +3 -1
- data/lib/faraday_middleware/request/aws_sigv4.rb +2 -6
- data/lib/faraday_middleware/request/aws_sigv4_util.rb +4 -4
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1377fa87ae2a9265349c3706b9e81c886e54fe5
|
4
|
+
data.tar.gz: 9f6aaed4d6cf055991a01b3c43e90a08fc3c3c5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc7a30d1d30f74554d50bb9a3a78f5dc903f6343bf251df311d9754af475bc7cce31bcc0d05d9c184bbd46f3544f4822b688da2cc328661ccf95fdde027874cf
|
7
|
+
data.tar.gz: ac21f94a8e23780e925a97721d4e2a748abdef6e670d41778a7bcd896de760c963f172965888eb22e6e388ec9d009f666c30fbf07e6a98ca4b6a6e0d336e3092
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--
|
1
|
+
--require spec_helper
|
2
2
|
--color
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
[Faraday](https://github.com/lostisland/faraday) middleware for AWS Signature Version 4 using [aws-sigv4](https://rubygems.org/gems/aws-sigv4).
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/faraday_middleware-aws-sigv4.svg)](https://badge.fury.io/rb/faraday_middleware-aws-sigv4)
|
6
|
+
[![Build Status](https://travis-ci.org/winebarrel/faraday_middleware-aws-sigv4.svg?branch=master)](https://travis-ci.org/winebarrel/faraday_middleware-aws-sigv4)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/github/winebarrel/faraday_middleware-aws-sigv4/badge.svg?branch=master)](https://coveralls.io/github/winebarrel/faraday_middleware-aws-sigv4?branch=master)
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
@@ -21,6 +25,7 @@ Or install it yourself as:
|
|
21
25
|
## Usage
|
22
26
|
|
23
27
|
```ruby
|
28
|
+
# `gem install faraday_middleware` is required.
|
24
29
|
require 'faraday_middleware'
|
25
30
|
require 'faraday_middleware/aws_sigv4'
|
26
31
|
require 'pp'
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'faraday_middleware-aws-sigv4'
|
7
|
-
spec.version = '0.1.0
|
7
|
+
spec.version = '0.1.0'
|
8
8
|
spec.authors = ['Genki Sugawara']
|
9
9
|
spec.email = ['sugawara@cookpad.com']
|
10
10
|
|
@@ -27,4 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'bundler'
|
28
28
|
spec.add_development_dependency 'rake'
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
|
+
spec.add_development_dependency 'timecop'
|
31
|
+
spec.add_development_dependency 'coveralls'
|
30
32
|
end
|
@@ -6,12 +6,8 @@ class FaradayMiddleware::AwsSigV4 < Faraday::Middleware
|
|
6
6
|
|
7
7
|
def initialize(app, options = nil)
|
8
8
|
super(app)
|
9
|
-
|
10
|
-
# check options
|
11
|
-
build_signer(options)
|
12
|
-
|
9
|
+
build_signer(options) # check options
|
13
10
|
@options = options
|
14
|
-
@is_net_http_adapter = app.is_a?(Faraday::Adapter::NetHttp)
|
15
11
|
end
|
16
12
|
|
17
13
|
def call(env)
|
@@ -48,6 +44,6 @@ class FaradayMiddleware::AwsSigV4 < Faraday::Middleware
|
|
48
44
|
end
|
49
45
|
|
50
46
|
def net_http_adapter?
|
51
|
-
@
|
47
|
+
@app.is_a?(Faraday::Adapter::NetHttp)
|
52
48
|
end
|
53
49
|
end
|
@@ -15,7 +15,7 @@ module FaradayMiddleware::AwsSigV4Util
|
|
15
15
|
|
16
16
|
if params.any? {|_, v| v[?\s] }
|
17
17
|
url = url.dup
|
18
|
-
url.query =
|
18
|
+
url.query = seahorse_encode_www_form(params)
|
19
19
|
end
|
20
20
|
|
21
21
|
url
|
@@ -30,13 +30,13 @@ module FaradayMiddleware::AwsSigV4Util
|
|
30
30
|
elsif value.respond_to?(:to_ary)
|
31
31
|
value.to_ary.map {|v|
|
32
32
|
if v.nil?
|
33
|
-
|
33
|
+
# nothing to do
|
34
34
|
else
|
35
|
-
encoded_key + '=' + Aws::
|
35
|
+
encoded_key + '=' + Aws::Sigv4::Signer.uri_escape(v)
|
36
36
|
end
|
37
37
|
}.join('&')
|
38
38
|
else
|
39
|
-
encoded_key + '=' + Aws::
|
39
|
+
encoded_key + '=' + Aws::Sigv4::Signer.uri_escape(value)
|
40
40
|
end
|
41
41
|
}.join('&')
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware-aws-sigv4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: timecop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: coveralls
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
description: Faraday middleware for AWS Signature Version 4 using aws-sigv4.
|
98
126
|
email:
|
99
127
|
- sugawara@cookpad.com
|
@@ -129,12 +157,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
157
|
version: '0'
|
130
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
159
|
requirements:
|
132
|
-
- - "
|
160
|
+
- - ">="
|
133
161
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
162
|
+
version: '0'
|
135
163
|
requirements: []
|
136
164
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.5.2
|
138
166
|
signing_key:
|
139
167
|
specification_version: 4
|
140
168
|
summary: Faraday middleware for AWS Signature Version 4 using aws-sigv4.
|