vidibus-secure 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -1
- data/Gemfile.lock +0 -1
- data/VERSION +1 -1
- data/lib/vidibus/secure/extensions/controller.rb +1 -7
- data/spec/vidibus/secure/extensions/controller_spec.rb +3 -3
- data/vidibus-secure.gemspec +2 -2
- metadata +4 -4
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require "uri"
|
2
|
-
require "rack/utils"
|
3
|
-
|
4
1
|
module Vidibus
|
5
2
|
module Secure
|
6
3
|
module Extensions
|
@@ -28,10 +25,7 @@ module Vidibus
|
|
28
25
|
def valid_request?(secret, options = {})
|
29
26
|
method = options.delete(:method) || request.method
|
30
27
|
uri = options.delete(:uri) || request.protocol + request.host_with_port + request.fullpath
|
31
|
-
params = options.delete(:params) ||
|
32
|
-
query = URI.parse(uri).query
|
33
|
-
query ? Rack::Utils.parse_query(query) : {}
|
34
|
-
end
|
28
|
+
params = options.delete(:params) || request.request_parameters
|
35
29
|
Vidibus::Secure.verify_request(method, uri, params, secret)
|
36
30
|
end
|
37
31
|
end
|
@@ -11,7 +11,7 @@ describe "Vidibus::Secure::Extensions::Controller" do
|
|
11
11
|
before do
|
12
12
|
stub(controller).request do
|
13
13
|
@request ||= begin
|
14
|
-
Struct.new("Request", :protocol, :host_with_port, :fullpath, :method, :
|
14
|
+
Struct.new("Request", :protocol, :host_with_port, :fullpath, :method, :request_parameters) unless defined?(Struct::Request)
|
15
15
|
Struct::Request.new("http://", "vidibus.org", "/", "get", {})
|
16
16
|
end
|
17
17
|
end
|
@@ -34,8 +34,8 @@ describe "Vidibus::Secure::Extensions::Controller" do
|
|
34
34
|
controller.valid_request?(secret, :uri => "something", :params => {})
|
35
35
|
end
|
36
36
|
|
37
|
-
it "should
|
38
|
-
mock(
|
37
|
+
it "should use request_parameters unless params are provided" do
|
38
|
+
mock(controller.request).request_parameters
|
39
39
|
controller.valid_request?(secret, :uri => "something/?with=params", :method => "get")
|
40
40
|
end
|
41
41
|
|
data/vidibus-secure.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{vidibus-secure}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andre Pankratz"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-04}
|
13
13
|
s.description = %q{Description...}
|
14
14
|
s.email = %q{andre@vidibus.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidibus-secure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andre Pankratz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-04 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|