doorkeeper 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of doorkeeper might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/NEWS.md +5 -0
- data/README.md +17 -1
- data/app/controllers/doorkeeper/application_controller.rb +3 -1
- data/lib/doorkeeper/config.rb +8 -1
- data/lib/doorkeeper/version.rb +1 -1
- data/lib/generators/doorkeeper/templates/initializer.rb +6 -1
- data/spec/lib/config_spec.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba5c804bf7f98c343b73a08ddeb8aca3c16e068f
|
4
|
+
data.tar.gz: 2b7e888f0adec7f5067bcae28e3b3e2d6d0ade2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9945f4ec12a539210541bf179d5ccd3d45d5e9627d7a890d321ba74cb9392913646c0186eeba1cc9b7da143938cc913b47f3295ba53d946c41c203c4bbdd502
|
7
|
+
data.tar.gz: 5fb30e9a5d74d6ca628cef571f20ffc51bb648a63aae85b91ec9794a5f5bfe6ea4955286ff64bc087253ca7439b54d46ca3a473113049d125764e4ab9a3bb982
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -91,11 +91,17 @@ rake db:migrate
|
|
91
91
|
|
92
92
|
### Other ORMs
|
93
93
|
|
94
|
-
See [doorkeeper-mongodb project] for
|
94
|
+
See [doorkeeper-mongodb project] for Mongoid and MongoMapper support. Follow along
|
95
95
|
the implementation in that repository to extend doorkeeper with other ORMs.
|
96
96
|
|
97
97
|
[doorkeeper-mongodb project]: https://github.com/doorkeeper-gem/doorkeeper-mongodb
|
98
98
|
|
99
|
+
If you are using [Sequel gem] then you can add [doorkeeper-sequel extension] to your project.
|
100
|
+
Follow configuration instructions for setting up the necessary Doorkeeper ORM.
|
101
|
+
|
102
|
+
[Sequel gem]: https://github.com/jeremyevans/sequel/
|
103
|
+
[doorkeeper-sequel extension]: https://github.com/nbulaj/doorkeeper-sequel
|
104
|
+
|
99
105
|
### Routes
|
100
106
|
|
101
107
|
The installation script will also automatically add the Doorkeeper routes into
|
@@ -282,6 +288,16 @@ end
|
|
282
288
|
JWT token support is available with
|
283
289
|
[Doorkeeper-JWT](https://github.com/chriswarren/doorkeeper-jwt).
|
284
290
|
|
291
|
+
### Custom Base Controller
|
292
|
+
|
293
|
+
By default Doorkeeper's main controller `Doorkeeper::ApplicationController` inherits from `ActionController::Base`.
|
294
|
+
You may want to use your own controller to inherit from, to keep Doorkeeper controllers in the same context than the rest your app:
|
295
|
+
|
296
|
+
```ruby
|
297
|
+
Doorkeeper.configure do
|
298
|
+
base_controller 'ApplicationController'
|
299
|
+
end
|
300
|
+
```
|
285
301
|
|
286
302
|
### Authenticated resource owner
|
287
303
|
|
data/lib/doorkeeper/config.rb
CHANGED
@@ -93,6 +93,10 @@ doorkeeper.
|
|
93
93
|
'@access_token_generator', access_token_generator
|
94
94
|
)
|
95
95
|
end
|
96
|
+
|
97
|
+
def base_controller(base_controller)
|
98
|
+
@config.instance_variable_set('@base_controller', base_controller)
|
99
|
+
end
|
96
100
|
end
|
97
101
|
|
98
102
|
module Option
|
@@ -184,7 +188,10 @@ doorkeeper.
|
|
184
188
|
option :realm, default: 'Doorkeeper'
|
185
189
|
option :force_ssl_in_redirect_uri, default: !Rails.env.development?
|
186
190
|
option :grant_flows, default: %w(authorization_code client_credentials)
|
187
|
-
option :access_token_generator,
|
191
|
+
option :access_token_generator,
|
192
|
+
default: 'Doorkeeper::OAuth::Helpers::UniqueToken'
|
193
|
+
option :base_controller,
|
194
|
+
default: 'ActionController::Base'
|
188
195
|
|
189
196
|
attr_reader :reuse_access_token
|
190
197
|
|
data/lib/doorkeeper/version.rb
CHANGED
@@ -31,7 +31,12 @@ Doorkeeper.configure do
|
|
31
31
|
|
32
32
|
# Use a custom class for generating the access token.
|
33
33
|
# https://github.com/doorkeeper-gem/doorkeeper#custom-access-token-generator
|
34
|
-
# access_token_generator
|
34
|
+
# access_token_generator '::Doorkeeper::JWT'
|
35
|
+
|
36
|
+
# The controller Doorkeeper::ApplicationController inherits from.
|
37
|
+
# Defaults to ActionController::Base.
|
38
|
+
# https://github.com/doorkeeper-gem/doorkeeper#custom-base-controller
|
39
|
+
# base_controller 'ApplicationController'
|
35
40
|
|
36
41
|
# Reuse access token for the same resource owner within an application (disabled by default)
|
37
42
|
# Rationale: https://github.com/doorkeeper-gem/doorkeeper/issues/383
|
data/spec/lib/config_spec.rb
CHANGED
@@ -314,4 +314,21 @@ describe Doorkeeper, 'configuration' do
|
|
314
314
|
expect(subject.access_token_generator).to eq('Example')
|
315
315
|
end
|
316
316
|
end
|
317
|
+
|
318
|
+
describe 'base_controller' do
|
319
|
+
context 'default' do
|
320
|
+
it { expect(Doorkeeper.configuration.base_controller).to eq('ActionController::Base') }
|
321
|
+
end
|
322
|
+
|
323
|
+
context 'custom' do
|
324
|
+
before do
|
325
|
+
Doorkeeper.configure do
|
326
|
+
orm DOORKEEPER_ORM
|
327
|
+
base_controller 'ApplicationController'
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
it { expect(Doorkeeper.configuration.base_controller).to eq('ApplicationController') }
|
332
|
+
end
|
333
|
+
end
|
317
334
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Elias Philipp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-07-
|
12
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -378,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
378
378
|
version: '0'
|
379
379
|
requirements: []
|
380
380
|
rubyforge_project:
|
381
|
-
rubygems_version: 2.
|
381
|
+
rubygems_version: 2.5.1
|
382
382
|
signing_key:
|
383
383
|
specification_version: 4
|
384
384
|
summary: OAuth 2 provider for Rails and Grape
|