opro 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,7 @@
1
1
  ## master
2
2
 
3
+ ## 0.4.2
4
+ - Fix jRuby compatibility in `Opro.convert_to_lambda`
3
5
 
4
6
  ## 0.4.1
5
7
 
data/Gemfile CHANGED
@@ -12,13 +12,13 @@ group :development, :test do
12
12
  gem 'jeweler', "~> 1.6.4"
13
13
  gem "bundler", ">= 1.1.3"
14
14
 
15
-
16
15
  gem "capybara", ">= 0.4.0"
17
16
 
18
17
  gem "launchy"
19
18
 
20
19
  gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
21
20
  gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
21
+ gem "jdbc-sqlite3", :platform => :jruby
22
22
 
23
23
  gem 'devise'
24
24
  end
@@ -22,6 +22,10 @@ GEM
22
22
  activesupport (= 3.2.6)
23
23
  arel (~> 3.0.2)
24
24
  tzinfo (~> 0.3.29)
25
+ activerecord-jdbc-adapter (1.2.2.1)
26
+ activerecord-jdbcsqlite3-adapter (1.2.2.1)
27
+ activerecord-jdbc-adapter (~> 1.2.2.1)
28
+ jdbc-sqlite3 (~> 3.7.2)
25
29
  activeresource (3.2.6)
26
30
  activemodel (= 3.2.6)
27
31
  activesupport (= 3.2.6)
@@ -54,6 +58,7 @@ GEM
54
58
  git (1.2.5)
55
59
  hike (1.2.1)
56
60
  i18n (0.6.0)
61
+ jdbc-sqlite3 (3.7.2)
57
62
  jeweler (1.6.4)
58
63
  bundler (~> 1.0)
59
64
  git (>= 1.2.5)
@@ -141,6 +146,7 @@ DEPENDENCIES
141
146
  capybara (>= 0.4.0)
142
147
  database_cleaner
143
148
  devise
149
+ jdbc-sqlite3
144
150
  jeweler (~> 1.6.4)
145
151
  kramdown
146
152
  launchy
data/README.md CHANGED
@@ -220,6 +220,39 @@ You could pull out the auth token using the regular expression `/cUsTomAuthHeade
220
220
 
221
221
  Now when a client sends your custom auth header, it will be parsed correctly. Custom authorization headers should not be used for security through obscurity. They may be exposed in the docs or tests in a later iteration of oPRO. If you have strong feelings against this, then please open a pull request or send me a message stating your case.
222
222
 
223
+ ## Customizing Views & Controllers
224
+
225
+ By default oPRO ships with views and controllers much like Devise. You can use the built in oPRO views, and change styles: all oPRO views should be wrapped with an `opro` class you can use for styling. For more control you can override oPRO views with your own views. To do this you will need to provide your own routes/controllers/views. You can override `oauth_docs_controller`, `oauth_docs_controller`, and `oauth_client_apps_controller`.
226
+
227
+
228
+ Currently this is a manual process to give you control and understanding of what is happening behind the scenes, if you want to work on a generator, I will be happy to help you...ping me [@schneems](http://twitter.com/schneems). To make things a little more clear we are going to be referencing the [oPRO demo rails app](https://github.com/opro/opro_rails_demo).
229
+
230
+ To start out overriding a controller we need to specify the new controller in your routes inside of `mount_opro_oauth`, for example if you wanted to over-ride the oauth_client_apps controller with a controller in `app/controllers/oauth/client_apps_controller.rb` you could specify it like this:
231
+
232
+
233
+ mount_opro_oauth :controllers => {:oauth_client_apps => 'oauth/client_apps'}
234
+
235
+
236
+ You can see an example of [setting the routes](https://github.com/opro/opro_rails_demo/blob/master/config/routes.rb) in the [oPRO demo rails app](https://github.com/opro/opro_rails_demo). Of course you then need to create the controller, it needs to inherit from the original controller `Opro::Oauth::ClientAppController` like this:
237
+
238
+ class Oauth::ClientAppsController < Opro::Oauth::ClientAppController
239
+ end
240
+
241
+
242
+ You can see an example of a: [custom oPRO controller](https://github.com/opro/opro_rails_demo/blob/master/app/controllers/oauth/client_apps_controller.rb). Once you've got your controller finished, you need to specify your [custom oPRO views](https://github.com/opro/opro_rails_demo/tree/master/app/views/oauth/client_apps).
243
+
244
+ It may help to look at the [current oPRO controllers](https://github.com/opro/opro/tree/master/app/controllers/opro/oauth) and [current oPRO views](https://github.com/opro/opro/tree/master/app/views/opro/oauth). Again, if you get stuck take a look at the [oPRO demo rails app](https://github.com/opro/opro_rails_demo).
245
+
246
+
247
+
248
+ ## Skipping Views
249
+
250
+ If you do not wish for test, docs, or client_apps views & controllers to be available, you can skip them using `except` in your `mount_opro_oauth` like this:
251
+
252
+ mount_opro_oauth :except => [:oauth_client_apps]
253
+
254
+ We recommend against doing this, but we aren't your mother.
255
+
223
256
 
224
257
 
225
258
  ## Assumptions
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -133,11 +133,16 @@ module Opro
133
133
  end
134
134
 
135
135
 
136
- # Grossssss, don't use, needed to support `return` from the blocks provided to `find_user_for_auth`
136
+ # Needed to `return` from the blocks provided to `find_user_for_auth`
137
137
  def self.convert_to_lambda &block
138
- obj = Object.new
139
- obj.define_singleton_method(:_, &block)
140
- return obj.method(:_).to_proc
138
+ if RUBY_ENGINE && RUBY_ENGINE == "jruby"
139
+ return lambda(&block)
140
+ else
141
+ # Grossssss, don't use
142
+ obj = Object.new
143
+ obj.define_singleton_method(:_, &block)
144
+ return obj.method(:_).to_proc
145
+ end
141
146
  end
142
147
 
143
148
  # holds an Array of authentication blocks is called by find_user_for_all_auths! in token controller
@@ -11,15 +11,15 @@ module ActionDispatch::Routing
11
11
  match 'oauth/token' => 'opro/oauth/token#create', :as => 'oauth_token'
12
12
 
13
13
  unless skip_routes.include?(:client_apps)
14
- oauth_client_apps = controllers[:oauth_client_apps]||'opro/oauth/client_app'
14
+ oauth_client_apps = controllers[:oauth_client_apps] ||'opro/oauth/client_app'
15
15
  resources :oauth_client_apps, :controller => oauth_client_apps
16
16
  end
17
17
  unless skip_routes.include?(:docs)
18
- oauth_docs = controllers[:oauth_docs]||'opro/oauth/docs'
18
+ oauth_docs = controllers[:oauth_docs] ||'opro/oauth/docs'
19
19
  resources :oauth_docs, :controller => oauth_docs, :only => [:index, :show]
20
20
  end
21
21
  unless skip_routes.include?(:tests)
22
- oauth_tests = controllers[:oauth_tests] ||'opro/oauth/tests'
22
+ oauth_tests = controllers[:oauth_tests] ||'opro/oauth/tests'
23
23
  resources :oauth_tests, :controller => oauth_tests, :only => [:index, :show, :create, :destroy]
24
24
  end
25
25
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "opro"
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["schneems"]
12
- s.date = "2012-10-30"
12
+ s.date = "2012-11-07"
13
13
  s.description = " Enable OAuth clients (iphone, android, web sites, etc.) to access and use your Rails application, what you do with it is up to you"
14
14
  s.email = "richard.schneeman@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -142,6 +142,7 @@ Gem::Specification.new do |s|
142
142
  s.add_development_dependency(%q<launchy>, [">= 0"])
143
143
  s.add_development_dependency(%q<sqlite3>, [">= 0"])
144
144
  s.add_development_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
145
+ s.add_development_dependency(%q<jdbc-sqlite3>, [">= 0"])
145
146
  s.add_development_dependency(%q<devise>, [">= 0"])
146
147
  else
147
148
  s.add_dependency(%q<activesupport>, [">= 3.1.0"])
@@ -155,6 +156,7 @@ Gem::Specification.new do |s|
155
156
  s.add_dependency(%q<launchy>, [">= 0"])
156
157
  s.add_dependency(%q<sqlite3>, [">= 0"])
157
158
  s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
159
+ s.add_dependency(%q<jdbc-sqlite3>, [">= 0"])
158
160
  s.add_dependency(%q<devise>, [">= 0"])
159
161
  end
160
162
  else
@@ -169,6 +171,7 @@ Gem::Specification.new do |s|
169
171
  s.add_dependency(%q<launchy>, [">= 0"])
170
172
  s.add_dependency(%q<sqlite3>, [">= 0"])
171
173
  s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
174
+ s.add_dependency(%q<jdbc-sqlite3>, [">= 0"])
172
175
  s.add_dependency(%q<devise>, [">= 0"])
173
176
  end
174
177
  end
metadata CHANGED
@@ -1,208 +1,240 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
5
- prerelease:
4
+ prerelease:
5
+ version: 0.4.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - schneems
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-30 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
16
+ version_requirements: !ruby/object:Gem::Requirement
18
17
  requirements:
19
18
  - - ! '>='
20
19
  - !ruby/object:Gem::Version
21
20
  version: 3.1.0
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
21
  none: false
22
+ requirement: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.1.0
27
+ none: false
28
+ prerelease: false
29
+ type: :runtime
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rails
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
32
+ version_requirements: !ruby/object:Gem::Requirement
34
33
  requirements:
35
34
  - - ! '>='
36
35
  - !ruby/object:Gem::Version
37
36
  version: 3.1.0
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
37
  none: false
38
+ requirement: !ruby/object:Gem::Requirement
42
39
  requirements:
43
40
  - - ! '>='
44
41
  - !ruby/object:Gem::Version
45
42
  version: 3.1.0
43
+ none: false
44
+ prerelease: false
45
+ type: :runtime
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: kramdown
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
48
+ version_requirements: !ruby/object:Gem::Requirement
50
49
  requirements:
51
50
  - - ! '>='
52
51
  - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
52
+ version: !binary |-
53
+ MA==
57
54
  none: false
55
+ requirement: !ruby/object:Gem::Requirement
58
56
  requirements:
59
57
  - - ! '>='
60
58
  - !ruby/object:Gem::Version
61
- version: '0'
59
+ version: !binary |-
60
+ MA==
61
+ none: false
62
+ prerelease: false
63
+ type: :runtime
62
64
  - !ruby/object:Gem::Dependency
63
65
  name: mocha
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
+ version_requirements: !ruby/object:Gem::Requirement
66
67
  requirements:
67
68
  - - ! '>='
68
69
  - !ruby/object:Gem::Version
69
- version: '0'
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
70
+ version: !binary |-
71
+ MA==
73
72
  none: false
73
+ requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: !binary |-
78
+ MA==
79
+ none: false
80
+ prerelease: false
81
+ type: :development
78
82
  - !ruby/object:Gem::Dependency
79
83
  name: timecop
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
84
+ version_requirements: !ruby/object:Gem::Requirement
82
85
  requirements:
83
86
  - - ! '>='
84
87
  - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
88
+ version: !binary |-
89
+ MA==
89
90
  none: false
91
+ requirement: !ruby/object:Gem::Requirement
90
92
  requirements:
91
93
  - - ! '>='
92
94
  - !ruby/object:Gem::Version
93
- version: '0'
95
+ version: !binary |-
96
+ MA==
97
+ none: false
98
+ prerelease: false
99
+ type: :development
94
100
  - !ruby/object:Gem::Dependency
95
101
  name: jeweler
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
102
+ version_requirements: !ruby/object:Gem::Requirement
98
103
  requirements:
99
104
  - - ~>
100
105
  - !ruby/object:Gem::Version
101
106
  version: 1.6.4
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
107
  none: false
108
+ requirement: !ruby/object:Gem::Requirement
106
109
  requirements:
107
110
  - - ~>
108
111
  - !ruby/object:Gem::Version
109
112
  version: 1.6.4
113
+ none: false
114
+ prerelease: false
115
+ type: :development
110
116
  - !ruby/object:Gem::Dependency
111
117
  name: bundler
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
118
+ version_requirements: !ruby/object:Gem::Requirement
114
119
  requirements:
115
120
  - - ! '>='
116
121
  - !ruby/object:Gem::Version
117
122
  version: 1.1.3
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
123
  none: false
124
+ requirement: !ruby/object:Gem::Requirement
122
125
  requirements:
123
126
  - - ! '>='
124
127
  - !ruby/object:Gem::Version
125
128
  version: 1.1.3
129
+ none: false
130
+ prerelease: false
131
+ type: :development
126
132
  - !ruby/object:Gem::Dependency
127
133
  name: capybara
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
134
+ version_requirements: !ruby/object:Gem::Requirement
130
135
  requirements:
131
136
  - - ! '>='
132
137
  - !ruby/object:Gem::Version
133
138
  version: 0.4.0
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
139
  none: false
140
+ requirement: !ruby/object:Gem::Requirement
138
141
  requirements:
139
142
  - - ! '>='
140
143
  - !ruby/object:Gem::Version
141
144
  version: 0.4.0
145
+ none: false
146
+ prerelease: false
147
+ type: :development
142
148
  - !ruby/object:Gem::Dependency
143
149
  name: launchy
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
150
+ version_requirements: !ruby/object:Gem::Requirement
146
151
  requirements:
147
152
  - - ! '>='
148
153
  - !ruby/object:Gem::Version
149
- version: '0'
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
154
+ version: !binary |-
155
+ MA==
153
156
  none: false
157
+ requirement: !ruby/object:Gem::Requirement
154
158
  requirements:
155
159
  - - ! '>='
156
160
  - !ruby/object:Gem::Version
157
- version: '0'
161
+ version: !binary |-
162
+ MA==
163
+ none: false
164
+ prerelease: false
165
+ type: :development
158
166
  - !ruby/object:Gem::Dependency
159
167
  name: sqlite3
160
- requirement: !ruby/object:Gem::Requirement
161
- none: false
168
+ version_requirements: !ruby/object:Gem::Requirement
162
169
  requirements:
163
170
  - - ! '>='
164
171
  - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
172
+ version: !binary |-
173
+ MA==
169
174
  none: false
175
+ requirement: !ruby/object:Gem::Requirement
170
176
  requirements:
171
177
  - - ! '>='
172
178
  - !ruby/object:Gem::Version
173
- version: '0'
179
+ version: !binary |-
180
+ MA==
181
+ none: false
182
+ prerelease: false
183
+ type: :development
174
184
  - !ruby/object:Gem::Dependency
175
185
  name: activerecord-jdbcsqlite3-adapter
176
- requirement: !ruby/object:Gem::Requirement
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: !binary |-
191
+ MA==
177
192
  none: false
193
+ requirement: !ruby/object:Gem::Requirement
178
194
  requirements:
179
195
  - - ! '>='
180
196
  - !ruby/object:Gem::Version
181
- version: '0'
182
- type: :development
197
+ version: !binary |-
198
+ MA==
199
+ none: false
183
200
  prerelease: false
201
+ type: :development
202
+ - !ruby/object:Gem::Dependency
203
+ name: jdbc-sqlite3
184
204
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
205
  requirements:
187
206
  - - ! '>='
188
207
  - !ruby/object:Gem::Version
189
- version: '0'
190
- - !ruby/object:Gem::Dependency
191
- name: devise
192
- requirement: !ruby/object:Gem::Requirement
208
+ version: !binary |-
209
+ MA==
193
210
  none: false
211
+ requirement: !ruby/object:Gem::Requirement
194
212
  requirements:
195
213
  - - ! '>='
196
214
  - !ruby/object:Gem::Version
197
- version: '0'
198
- type: :development
215
+ version: !binary |-
216
+ MA==
217
+ none: false
199
218
  prerelease: false
219
+ type: :development
220
+ - !ruby/object:Gem::Dependency
221
+ name: devise
200
222
  version_requirements: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - ! '>='
225
+ - !ruby/object:Gem::Version
226
+ version: !binary |-
227
+ MA==
201
228
  none: false
229
+ requirement: !ruby/object:Gem::Requirement
202
230
  requirements:
203
231
  - - ! '>='
204
232
  - !ruby/object:Gem::Version
205
- version: '0'
233
+ version: !binary |-
234
+ MA==
235
+ none: false
236
+ prerelease: false
237
+ type: :development
206
238
  description: ! ' Enable OAuth clients (iphone, android, web sites, etc.) to access
207
239
  and use your Rails application, what you do with it is up to you'
208
240
  email: richard.schneeman@gmail.com
@@ -318,29 +350,32 @@ files:
318
350
  homepage: http://github.com/schneems/opro
319
351
  licenses:
320
352
  - MIT
321
- post_install_message:
353
+ post_install_message:
322
354
  rdoc_options: []
323
355
  require_paths:
324
356
  - lib
325
357
  required_ruby_version: !ruby/object:Gem::Requirement
326
- none: false
327
358
  requirements:
328
359
  - - ! '>='
329
360
  - !ruby/object:Gem::Version
330
- version: '0'
331
361
  segments:
332
362
  - 0
333
- hash: -3824248644036353497
334
- required_rubygems_version: !ruby/object:Gem::Requirement
363
+ hash: 2
364
+ version: !binary |-
365
+ MA==
335
366
  none: false
367
+ required_rubygems_version: !ruby/object:Gem::Requirement
336
368
  requirements:
337
369
  - - ! '>='
338
370
  - !ruby/object:Gem::Version
339
- version: '0'
371
+ version: !binary |-
372
+ MA==
373
+ none: false
340
374
  requirements: []
341
- rubyforge_project:
375
+ rubyforge_project:
342
376
  rubygems_version: 1.8.24
343
- signing_key:
377
+ signing_key:
344
378
  specification_version: 3
345
379
  summary: oPRO turns your Rails application into an OAuth Provider
346
380
  test_files: []
381
+ ...