rack-signature 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rack/signature/verify.rb +3 -4
- data/lib/rack/signature/version.rb +1 -1
- data/lib/rack/signature.rb +2 -2
- data/test/test_helper.rb +0 -1
- data/test/verify_test.rb +1 -6
- metadata +1 -1
@@ -15,11 +15,10 @@ module Rack
|
|
15
15
|
# ==== Attributes
|
16
16
|
#
|
17
17
|
# * +app+ - A Rack app
|
18
|
-
# * +key+ -
|
19
|
-
# get the shared key used for verifying the signature
|
18
|
+
# * +key+ - The shared key used as a salt.
|
20
19
|
#
|
21
|
-
def initialize(app,
|
22
|
-
@app, @key = app,
|
20
|
+
def initialize(app, key)
|
21
|
+
@app, @key = app, key
|
23
22
|
end
|
24
23
|
|
25
24
|
def call(env)
|
data/lib/rack/signature.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/test/verify_test.rb
CHANGED
@@ -5,13 +5,12 @@ describe "Verifying a signed request" do
|
|
5
5
|
include Rack::Test::Methods
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@klass = client_klass
|
9
8
|
@shared_key = key
|
10
9
|
@signature = expected_signature
|
11
10
|
end
|
12
11
|
|
13
12
|
let(:app) { lambda { |env| [200, {}, ['Hello World']] } }
|
14
|
-
let(:rack_signature) { Rack::Signature.new(app, @
|
13
|
+
let(:rack_signature) { Rack::Signature.new(app, @shared_key) }
|
15
14
|
let(:mock_request) { Rack::MockRequest.new(rack_signature) }
|
16
15
|
|
17
16
|
describe "when a request is made without a signature" do
|
@@ -81,8 +80,4 @@ describe "Verifying a signed request" do
|
|
81
80
|
"Z0qY8Hy4a/gJkGZI0gklzM6vZztsAVVDjA18vb1BvHg="
|
82
81
|
end
|
83
82
|
|
84
|
-
def client_klass
|
85
|
-
OpenStruct.new(get_signature_key: key)
|
86
|
-
end
|
87
|
-
|
88
83
|
end
|