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 CHANGED
@@ -2,7 +2,6 @@ source "http://rubygems.org"
2
2
 
3
3
  gem "mongoid", "~> 2.0.0.beta.20"
4
4
  gem "activesupport", "~> 3.0.0"
5
- gem "rack"
6
5
  gem "vidibus-core_extensions"
7
6
 
8
7
  # Development dependencies
data/Gemfile.lock CHANGED
@@ -94,7 +94,6 @@ PLATFORMS
94
94
  DEPENDENCIES
95
95
  activesupport (~> 3.0.0)
96
96
  mongoid (~> 2.0.0.beta.20)
97
- rack
98
97
  rails (~> 3.0.0)
99
98
  relevance-rcov
100
99
  rr
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
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) || begin
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, :params) unless defined?(Struct::Request)
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 extract params from request uri unless params are provided" do
38
- mock(Rack::Utils).parse_query("with=params").twice {{}}
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
 
@@ -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.2"
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-09-29}
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
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-09-29 00:00:00 +02:00
18
+ date: 2010-10-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency