doorkeeper 1.4.2 → 2.0.0.alpha1
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/.hound.yml +3 -0
- data/CHANGELOG.md +18 -11
- data/Gemfile +7 -7
- data/README.md +20 -41
- data/app/controllers/doorkeeper/application_controller.rb +1 -7
- data/app/controllers/doorkeeper/applications_controller.rb +4 -5
- data/app/controllers/doorkeeper/tokens_controller.rb +2 -2
- data/app/helpers/doorkeeper/{form_errors_helper.rb → dashboard_helper.rb} +5 -1
- data/app/views/doorkeeper/applications/_delete_form.html.erb +1 -1
- data/app/views/doorkeeper/applications/_form.html.erb +1 -1
- data/app/views/doorkeeper/applications/index.html.erb +1 -1
- data/config/locales/en.yml +3 -3
- data/lib/doorkeeper.rb +15 -6
- data/lib/doorkeeper/config.rb +18 -24
- data/lib/doorkeeper/engine.rb +1 -6
- data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/indexes_generator.rb +12 -0
- data/lib/{generators/doorkeeper → doorkeeper/generators/doorkeeper/mongo_mapper}/templates/indexes.rb +0 -0
- data/lib/doorkeeper/models/access_grant_mixin.rb +36 -0
- data/lib/doorkeeper/models/access_token_mixin.rb +121 -0
- data/lib/doorkeeper/models/application_mixin.rb +42 -0
- data/lib/doorkeeper/models/{accessible.rb → concerns/accessible.rb} +0 -0
- data/lib/doorkeeper/models/{expirable.rb → concerns/expirable.rb} +6 -5
- data/lib/doorkeeper/models/{ownership.rb → concerns/ownership.rb} +7 -7
- data/lib/doorkeeper/models/{revocable.rb → concerns/revocable.rb} +1 -1
- data/lib/doorkeeper/models/concerns/scopes.rb +17 -0
- data/lib/doorkeeper/oauth/authorization/token.rb +6 -6
- data/lib/doorkeeper/oauth/client.rb +1 -1
- data/lib/doorkeeper/oauth/password_access_token_request.rb +3 -3
- data/lib/doorkeeper/oauth/refresh_token_request.rb +6 -6
- data/lib/doorkeeper/oauth/token.rb +3 -2
- data/lib/doorkeeper/orm/active_record.rb +17 -0
- data/lib/doorkeeper/orm/active_record/access_grant.rb +7 -0
- data/lib/doorkeeper/orm/active_record/access_token.rb +20 -0
- data/lib/doorkeeper/{models → orm}/active_record/application.rb +1 -3
- data/lib/doorkeeper/orm/mongo_mapper.rb +11 -0
- data/lib/doorkeeper/{models → orm}/mongo_mapper/access_grant.rb +4 -5
- data/lib/doorkeeper/{models → orm}/mongo_mapper/access_token.rb +5 -8
- data/lib/doorkeeper/{models → orm}/mongo_mapper/application.rb +3 -4
- data/lib/doorkeeper/orm/mongoid2.rb +11 -0
- data/lib/doorkeeper/{models → orm}/mongoid2/access_grant.rb +5 -3
- data/lib/doorkeeper/{models → orm}/mongoid2/access_token.rb +10 -13
- data/lib/doorkeeper/{models → orm}/mongoid2/application.rb +2 -0
- data/lib/doorkeeper/orm/mongoid2/concerns/scopes.rb +30 -0
- data/lib/doorkeeper/orm/mongoid3.rb +11 -0
- data/lib/doorkeeper/orm/mongoid3/access_grant.rb +22 -0
- data/lib/doorkeeper/orm/mongoid3/access_token.rb +36 -0
- data/lib/doorkeeper/{models/mongoid3_4 → orm/mongoid3}/application.rb +2 -0
- data/lib/doorkeeper/orm/mongoid3/concerns/scopes.rb +30 -0
- data/lib/doorkeeper/orm/mongoid4.rb +11 -0
- data/lib/doorkeeper/orm/mongoid4/access_grant.rb +22 -0
- data/lib/doorkeeper/orm/mongoid4/access_token.rb +36 -0
- data/lib/doorkeeper/orm/mongoid4/application.rb +24 -0
- data/lib/doorkeeper/orm/mongoid4/concerns/scopes.rb +17 -0
- data/lib/doorkeeper/rails/helpers.rb +63 -0
- data/lib/doorkeeper/rails/routes.rb +1 -12
- data/lib/doorkeeper/request/code.rb +0 -1
- data/lib/doorkeeper/request/token.rb +0 -1
- data/lib/doorkeeper/server.rb +1 -1
- data/lib/doorkeeper/version.rb +1 -1
- data/lib/generators/doorkeeper/templates/initializer.rb +2 -1
- data/spec/controllers/applications_controller_spec.rb +4 -4
- data/spec/controllers/protected_resources_controller_spec.rb +25 -175
- data/spec/dummy/app/controllers/full_protected_resources_controller.rb +2 -2
- data/spec/dummy/app/controllers/metal_controller.rb +2 -2
- data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +2 -2
- data/spec/dummy/config/application.rb +2 -0
- data/spec/lib/config_spec.rb +16 -10
- data/spec/lib/models/expirable_spec.rb +1 -1
- data/spec/lib/models/revocable_spec.rb +8 -3
- data/spec/lib/models/scopes_spec.rb +3 -3
- data/spec/lib/oauth/password_access_token_request_spec.rb +1 -1
- data/spec/lib/oauth/token_request_spec.rb +28 -1
- data/spec/lib/oauth/token_spec.rb +1 -1
- data/spec/models/doorkeeper/application_spec.rb +1 -1
- data/spec/requests/applications/applications_request_spec.rb +4 -4
- data/spec/requests/endpoints/authorization_spec.rb +0 -23
- data/spec/requests/flows/implicit_grant_spec.rb +32 -0
- data/spec/support/shared/controllers_shared_context.rb +2 -2
- metadata +40 -35
- data/lib/doorkeeper/doorkeeper_for.rb +0 -69
- data/lib/doorkeeper/helpers/filter.rb +0 -64
- data/lib/doorkeeper/models/access_grant.rb +0 -30
- data/lib/doorkeeper/models/access_token.rb +0 -106
- data/lib/doorkeeper/models/active_record/access_grant.rb +0 -9
- data/lib/doorkeeper/models/active_record/access_token.rb +0 -25
- data/lib/doorkeeper/models/application.rb +0 -40
- data/lib/doorkeeper/models/mongoid/scopes.rb +0 -15
- data/lib/doorkeeper/models/mongoid/version.rb +0 -15
- data/lib/doorkeeper/models/mongoid3_4/access_grant.rb +0 -27
- data/lib/doorkeeper/models/mongoid3_4/access_token.rb +0 -46
- data/lib/doorkeeper/models/scopes.rb +0 -21
- data/lib/generators/doorkeeper/mongo_mapper/indexes_generator.rb +0 -12
- data/script/rails +0 -5
- data/script/run_all +0 -14
@@ -1,21 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
module Models
|
3
|
-
module Scopes
|
4
|
-
def self.included(base)
|
5
|
-
base.class_eval do
|
6
|
-
define_method :scopes do
|
7
|
-
OAuth::Scopes.from_string(self[:scopes])
|
8
|
-
end
|
9
|
-
|
10
|
-
define_method :scopes_string do
|
11
|
-
OAuth::Scopes.from_string(self[:scopes]).to_s
|
12
|
-
end
|
13
|
-
|
14
|
-
define_method :includes_scope? do |required_scopes|
|
15
|
-
required_scopes.blank? || required_scopes.any? { |s| scopes.exists?(s) }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
module MongoMapper
|
3
|
-
class IndexesGenerator < ::Rails::Generators::Base
|
4
|
-
source_root File.expand_path('../../templates', __FILE__)
|
5
|
-
desc 'Creates an indexes file for use with MongoMapper\'s rake db:index'
|
6
|
-
|
7
|
-
def install
|
8
|
-
template 'indexes.rb' 'db/indexes.rb'
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/script/rails
DELETED
data/script/run_all
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -e
|
3
|
-
|
4
|
-
rails=3.2.8 orm=active_record bundle install --quiet
|
5
|
-
rails=3.2.8 orm=active_record bundle exec rake
|
6
|
-
|
7
|
-
rails=3.2.8 orm=mongoid2 bundle install --quiet
|
8
|
-
rails=3.2.8 orm=mongoid2 bundle exec rake
|
9
|
-
|
10
|
-
rails=3.2.8 orm=mongoid3 bundle install --quiet
|
11
|
-
rails=3.2.8 orm=mongoid3 bundle exec rake
|
12
|
-
|
13
|
-
rails=3.2.8 orm=mongo_mapper bundle install --quiet
|
14
|
-
rails=3.2.8 orm=mongo_mapper bundle exec rake
|