exvo-auth 0.9.3 → 0.9.4

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/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :gemcutter
2
+
3
+ # Specify your gem's dependencies in exvo-auth.gemspec
4
+ gemspec
data/README CHANGED
@@ -96,3 +96,11 @@ If scopes are empty, then provider app should not present any resources to consu
96
96
 
97
97
  before_filter {|c| c.authenticate_app_in_scope!("payments") }
98
98
 
99
+
100
+ Dejavu - replay non-GET requests after authentication redirects
101
+ ===============================================================
102
+
103
+ Limitations:
104
+
105
+ * doesn't work with file uploads
106
+ * all request params become query params when replayed
data/Rakefile CHANGED
@@ -1,55 +1,11 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ require 'bundler'
2
+ require 'rake/testtask'
3
3
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "exvo-auth"
8
- gem.description = gem.summary = %Q{Sign in with Exvo account}
9
- gem.email = "jacek.becela@gmail.com"
10
- gem.homepage = "http://github.com/Exvo/Auth"
11
- gem.authors = ["Jacek Becela"]
12
- gem.add_dependency "oa-oauth", "~> 0.0.4"
13
- gem.add_dependency "httparty", "~> 0.6.1"
14
- gem.add_development_dependency "mocha", "~> 0.9.8"
15
- gem.add_development_dependency "test-unit", "~> 2.1.0"
16
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
- end
18
- Jeweler::GemcutterTasks.new
19
- rescue LoadError
20
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
- end
4
+ Bundler::GemHelper.install_tasks
22
5
 
23
- require 'rake/testtask'
24
6
  Rake::TestTask.new(:test) do |test|
25
7
  test.libs << 'lib' << 'test'
26
8
  test.pattern = 'test/**/test_*.rb'
27
9
  test.verbose = true
28
10
  end
29
-
30
- begin
31
- require 'rcov/rcovtask'
32
- Rcov::RcovTask.new do |test|
33
- test.libs << 'test'
34
- test.pattern = 'test/**/test_*.rb'
35
- test.verbose = true
36
- end
37
- rescue LoadError
38
- task :rcov do
39
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
40
- end
41
- end
42
-
43
- task :test => :check_dependencies
44
-
45
11
  task :default => :test
46
-
47
- require 'rake/rdoctask'
48
- Rake::RDocTask.new do |rdoc|
49
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
-
51
- rdoc.rdoc_dir = 'rdoc'
52
- rdoc.title = "exvo-auth #{version}"
53
- rdoc.rdoc_files.include('README*')
54
- rdoc.rdoc_files.include('lib/**/*.rb')
55
- end
data/exvo-auth.gemspec CHANGED
@@ -1,80 +1,27 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/exvo_auth/version", __FILE__)
5
3
 
6
4
  Gem::Specification.new do |s|
7
- s.name = %q{exvo-auth}
8
- s.version = "0.9.3"
5
+ s.name = "exvo-auth"
6
+ s.version = ExvoAuth::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Jacek Becela"]
9
+ s.email = ["jacek.becela@gmail.com"]
10
+ s.homepage = "http://rubygems.org/gems/exvo-auth"
11
+ s.summary = "Sign in with Exvo account"
12
+ s.description = "Sign in with Exvo account"
9
13
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Jacek Becela"]
12
- s.date = %q{2010-09-06}
13
- s.description = %q{Sign in with Exvo account}
14
- s.email = %q{jacek.becela@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README"
18
- ]
19
- s.files = [
20
- ".gitignore",
21
- "LICENSE",
22
- "README",
23
- "Rakefile",
24
- "VERSION",
25
- "exvo-auth.gemspec",
26
- "lib/exvo-auth.rb",
27
- "lib/exvo_auth/autonomous/auth.rb",
28
- "lib/exvo_auth/autonomous/base.rb",
29
- "lib/exvo_auth/autonomous/cache.rb",
30
- "lib/exvo_auth/autonomous/consumer.rb",
31
- "lib/exvo_auth/autonomous/http.rb",
32
- "lib/exvo_auth/autonomous/provider.rb",
33
- "lib/exvo_auth/config.rb",
34
- "lib/exvo_auth/controllers/base.rb",
35
- "lib/exvo_auth/controllers/merb.rb",
36
- "lib/exvo_auth/controllers/rails.rb",
37
- "lib/exvo_auth/dejavu.rb",
38
- "lib/exvo_auth/middleware.rb",
39
- "lib/exvo_auth/oauth2.rb",
40
- "lib/exvo_auth/strategies/base.rb",
41
- "lib/exvo_auth/strategies/interactive.rb",
42
- "lib/exvo_auth/strategies/non_interactive.rb",
43
- "test/helper.rb",
44
- "test/test_exvo_auth.rb",
45
- "test/test_integration.rb"
46
- ]
47
- s.homepage = %q{http://github.com/Exvo/Auth}
48
- s.rdoc_options = ["--charset=UTF-8"]
49
- s.require_paths = ["lib"]
50
- s.rubygems_version = %q{1.3.7}
51
- s.summary = %q{Sign in with Exvo account}
52
- s.test_files = [
53
- "test/helper.rb",
54
- "test/test_exvo_auth.rb",
55
- "test/test_integration.rb"
56
- ]
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+ s.rubyforge_project = "exvo-auth"
16
+
17
+ s.add_dependency "oa-oauth", "~> 0.0.4"
18
+ s.add_dependency "httparty", "~> 0.6.1"
57
19
 
58
- if s.respond_to? :specification_version then
59
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
60
- s.specification_version = 3
20
+ s.add_development_dependency "mocha", "~> 0.9.8"
21
+ s.add_development_dependency "test-unit", "~> 2.1.0"
22
+ s.add_development_dependency "bundler", "~> 1.0.0"
61
23
 
62
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
63
- s.add_runtime_dependency(%q<oa-oauth>, ["~> 0.0.4"])
64
- s.add_runtime_dependency(%q<httparty>, ["~> 0.6.1"])
65
- s.add_development_dependency(%q<mocha>, ["~> 0.9.8"])
66
- s.add_development_dependency(%q<test-unit>, ["~> 2.1.0"])
67
- else
68
- s.add_dependency(%q<oa-oauth>, ["~> 0.0.4"])
69
- s.add_dependency(%q<httparty>, ["~> 0.6.1"])
70
- s.add_dependency(%q<mocha>, ["~> 0.9.8"])
71
- s.add_dependency(%q<test-unit>, ["~> 2.1.0"])
72
- end
73
- else
74
- s.add_dependency(%q<oa-oauth>, ["~> 0.0.4"])
75
- s.add_dependency(%q<httparty>, ["~> 0.6.1"])
76
- s.add_dependency(%q<mocha>, ["~> 0.9.8"])
77
- s.add_dependency(%q<test-unit>, ["~> 2.1.0"])
78
- end
24
+ s.files = `git ls-files`.split("\n")
25
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
26
+ s.require_path = 'lib'
79
27
  end
80
-
data/lib/exvo-auth.rb CHANGED
@@ -9,6 +9,7 @@ module ExvoAuth
9
9
  autoload :Middleware, 'exvo_auth/middleware'
10
10
  autoload :Config, 'exvo_auth/config'
11
11
  autoload :Dejavu, 'exvo_auth/dejavu'
12
+ autoload :VERSION, 'exvo_auth/version'
12
13
 
13
14
  module Strategies
14
15
  autoload :Base, 'exvo_auth/strategies/base'
@@ -85,13 +85,14 @@ module ExvoAuth::Controllers::Base
85
85
  end
86
86
 
87
87
  def current_request
88
- {
89
- :script_name => request.script_name,
90
- :path_info => request.path_info,
91
- :method => request_method,
92
- :params => request.params, # GET + POST params together. no uploads and other crazy shit please ;)
93
- :content_type => request.content_type
94
- }
88
+ request.params.merge(
89
+ :_dejavu => {
90
+ :script_name => request.script_name,
91
+ :path_info => request.path_info,
92
+ :method => request_method,
93
+ :content_type => request.content_type
94
+ }
95
+ )
95
96
  end
96
97
 
97
98
  def store_request!
@@ -100,12 +101,12 @@ module ExvoAuth::Controllers::Base
100
101
 
101
102
  def request_replay_url
102
103
  if stored_request = session.delete(:stored_request)
103
- decoded = MultiJson.decode(Base64.decode64(stored_request))
104
- if decoded["method"] == "GET"
105
- qs = decoded["query_string"]
106
- decoded["script_name"] + decoded["path_info"] + (qs ? "?" + qs : "")
104
+ params = MultiJson.decode(Base64.decode64(stored_request))
105
+ dejavu = params.delete("_dejavu")
106
+ if dejavu["method"] == "GET"
107
+ dejavu["script_name"] + dejavu["path_info"] + (params.any? ? "?" + Rack::Utils.build_nested_query(params) : "")
107
108
  else
108
- "/auth/dejavu?" + Rack::Utils.build_query(:stored_request => stored_request)
109
+ "/auth/dejavu?" + Rack::Utils.build_nested_query(params.merge(:_dejavu => dejavu))
109
110
  end
110
111
  end
111
112
  end
@@ -11,12 +11,13 @@ class ExvoAuth::Dejavu
11
11
  private
12
12
 
13
13
  def dejavu(env)
14
- data = MultiJson.decode(Base64.decode64(Rack::Request.new(env).params["stored_request"]))
14
+ params = Rack::Request.new(env).params
15
+ dejavu = params.delete("_dejavu")
15
16
 
16
- env["QUERY_STRING"] = Rack::Utils.build_nested_query(data["params"]) # Will not work with file uploads.
17
- env["SCRIPT_NAME"] = data["script_name"]
18
- env["PATH_INFO"] = data["path_info"]
19
- env["REQUEST_METHOD"] = data["method"]
20
- env["CONTENT_TYPE"] = data["content_type"]
17
+ env["QUERY_STRING"] = Rack::Utils.build_nested_query(params) # Will not work with file uploads.
18
+ env["SCRIPT_NAME"] = dejavu["script_name"]
19
+ env["PATH_INFO"] = dejavu["path_info"]
20
+ env["REQUEST_METHOD"] = dejavu["method"]
21
+ env["CONTENT_TYPE"] = dejavu["content_type"]
21
22
  end
22
23
  end
@@ -0,0 +1,3 @@
1
+ module ExvoAuth
2
+ VERSION = "0.9.4"
3
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exvo-auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 51
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 3
10
- version: 0.9.3
9
+ - 4
10
+ version: 0.9.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jacek Becela
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-06 00:00:00 +02:00
18
+ date: 2010-09-14 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -82,21 +82,36 @@ dependencies:
82
82
  version: 2.1.0
83
83
  type: :development
84
84
  version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: bundler
87
+ prerelease: false
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ hash: 23
94
+ segments:
95
+ - 1
96
+ - 0
97
+ - 0
98
+ version: 1.0.0
99
+ type: :development
100
+ version_requirements: *id005
85
101
  description: Sign in with Exvo account
86
- email: jacek.becela@gmail.com
102
+ email:
103
+ - jacek.becela@gmail.com
87
104
  executables: []
88
105
 
89
106
  extensions: []
90
107
 
91
- extra_rdoc_files:
92
- - LICENSE
93
- - README
108
+ extra_rdoc_files: []
109
+
94
110
  files:
95
111
  - .gitignore
96
- - LICENSE
112
+ - Gemfile
97
113
  - README
98
114
  - Rakefile
99
- - VERSION
100
115
  - exvo-auth.gemspec
101
116
  - lib/exvo-auth.rb
102
117
  - lib/exvo_auth/autonomous/auth.rb
@@ -115,16 +130,17 @@ files:
115
130
  - lib/exvo_auth/strategies/base.rb
116
131
  - lib/exvo_auth/strategies/interactive.rb
117
132
  - lib/exvo_auth/strategies/non_interactive.rb
133
+ - lib/exvo_auth/version.rb
118
134
  - test/helper.rb
119
135
  - test/test_exvo_auth.rb
120
136
  - test/test_integration.rb
121
137
  has_rdoc: true
122
- homepage: http://github.com/Exvo/Auth
138
+ homepage: http://rubygems.org/gems/exvo-auth
123
139
  licenses: []
124
140
 
125
141
  post_install_message:
126
- rdoc_options:
127
- - --charset=UTF-8
142
+ rdoc_options: []
143
+
128
144
  require_paths:
129
145
  - lib
130
146
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -141,18 +157,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
157
  requirements:
142
158
  - - ">="
143
159
  - !ruby/object:Gem::Version
144
- hash: 3
160
+ hash: 23
145
161
  segments:
146
- - 0
147
- version: "0"
162
+ - 1
163
+ - 3
164
+ - 6
165
+ version: 1.3.6
148
166
  requirements: []
149
167
 
150
- rubyforge_project:
168
+ rubyforge_project: exvo-auth
151
169
  rubygems_version: 1.3.7
152
170
  signing_key:
153
171
  specification_version: 3
154
172
  summary: Sign in with Exvo account
155
- test_files:
156
- - test/helper.rb
157
- - test/test_exvo_auth.rb
158
- - test/test_integration.rb
173
+ test_files: []
174
+
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010 Jacek Becela
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.9.3