doorkeeper 2.2.2 → 3.0.0.rc1

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.

Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -23
  3. data/NEWS.md +17 -9
  4. data/README.md +5 -31
  5. data/config/locales/en.yml +1 -31
  6. data/doorkeeper.gemspec +0 -3
  7. data/lib/doorkeeper.rb +0 -4
  8. data/lib/doorkeeper/models/application_mixin.rb +0 -12
  9. data/lib/doorkeeper/orm/active_record.rb +3 -4
  10. data/lib/doorkeeper/rails/helpers.rb +0 -18
  11. data/lib/doorkeeper/version.rb +1 -1
  12. data/lib/generators/doorkeeper/templates/README +0 -20
  13. data/lib/generators/doorkeeper/templates/initializer.rb +1 -3
  14. data/spec/controllers/protected_resources_controller_spec.rb +0 -13
  15. data/spec/dummy/app/models/user.rb +1 -25
  16. data/spec/dummy/config/application.rb +0 -1
  17. data/spec/dummy/config/initializers/doorkeeper.rb +0 -2
  18. data/spec/models/doorkeeper/application_spec.rb +0 -15
  19. data/spec/spec_helper_integration.rb +1 -7
  20. metadata +4 -84
  21. data/gemfiles/Gemfile.common.rb +0 -7
  22. data/gemfiles/Gemfile.mongo_mapper.rb +0 -5
  23. data/gemfiles/Gemfile.mongoid2.rb +0 -5
  24. data/gemfiles/Gemfile.mongoid3.rb +0 -4
  25. data/gemfiles/Gemfile.mongoid4.rb +0 -4
  26. data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/indexes_generator.rb +0 -12
  27. data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/templates/indexes.rb +0 -3
  28. data/lib/doorkeeper/orm/mongo_mapper.rb +0 -19
  29. data/lib/doorkeeper/orm/mongo_mapper/access_grant.rb +0 -24
  30. data/lib/doorkeeper/orm/mongo_mapper/access_token.rb +0 -43
  31. data/lib/doorkeeper/orm/mongo_mapper/application.rb +0 -32
  32. data/lib/doorkeeper/orm/mongoid2.rb +0 -19
  33. data/lib/doorkeeper/orm/mongoid2/access_grant.rb +0 -22
  34. data/lib/doorkeeper/orm/mongoid2/access_token.rb +0 -37
  35. data/lib/doorkeeper/orm/mongoid2/application.rb +0 -25
  36. data/lib/doorkeeper/orm/mongoid2/concerns/scopes.rb +0 -30
  37. data/lib/doorkeeper/orm/mongoid3.rb +0 -19
  38. data/lib/doorkeeper/orm/mongoid3/access_grant.rb +0 -22
  39. data/lib/doorkeeper/orm/mongoid3/access_token.rb +0 -37
  40. data/lib/doorkeeper/orm/mongoid3/application.rb +0 -25
  41. data/lib/doorkeeper/orm/mongoid3/concerns/scopes.rb +0 -30
  42. data/lib/doorkeeper/orm/mongoid4.rb +0 -19
  43. data/lib/doorkeeper/orm/mongoid4/access_grant.rb +0 -22
  44. data/lib/doorkeeper/orm/mongoid4/access_token.rb +0 -37
  45. data/lib/doorkeeper/orm/mongoid4/application.rb +0 -25
  46. data/lib/doorkeeper/orm/mongoid4/concerns/scopes.rb +0 -17
  47. data/spec/dummy/config/mongo.yml +0 -11
  48. data/spec/dummy/config/mongoid2.yml +0 -9
  49. data/spec/dummy/config/mongoid3.yml +0 -18
  50. data/spec/dummy/config/mongoid4.yml +0 -19
  51. data/spec/support/orm/mongo_mapper.rb +0 -10
  52. data/spec/support/orm/mongoid.rb +0 -10
@@ -1,19 +0,0 @@
1
- module Doorkeeper
2
- module Orm
3
- module Mongoid4
4
- def self.initialize_models!
5
- require 'doorkeeper/orm/mongoid4/access_grant'
6
- require 'doorkeeper/orm/mongoid4/access_token'
7
- require 'doorkeeper/orm/mongoid4/application'
8
- end
9
-
10
- def self.initialize_application_owner!
11
- require 'doorkeeper/models/concerns/ownership'
12
-
13
- Doorkeeper::Application.send :include, Doorkeeper::Models::Ownership
14
- end
15
-
16
- def self.check_requirements!(_config); end
17
- end
18
- end
19
- end
@@ -1,22 +0,0 @@
1
- require 'doorkeeper/orm/mongoid4/concerns/scopes'
2
-
3
- module Doorkeeper
4
- class AccessGrant
5
- include Mongoid::Document
6
- include Mongoid::Timestamps
7
-
8
- include AccessGrantMixin
9
- include Models::Mongoid4::Scopes
10
-
11
- self.store_in collection: :oauth_access_grants
12
-
13
- field :resource_owner_id, type: BSON::ObjectId
14
- field :application_id, type: BSON::ObjectId
15
- field :token, type: String
16
- field :expires_in, type: Integer
17
- field :redirect_uri, type: String
18
- field :revoked_at, type: DateTime
19
-
20
- index({ token: 1 }, { unique: true })
21
- end
22
- end
@@ -1,37 +0,0 @@
1
- require 'doorkeeper/orm/mongoid4/concerns/scopes'
2
-
3
- module Doorkeeper
4
- class AccessToken
5
- include Mongoid::Document
6
- include Mongoid::Timestamps
7
-
8
- include AccessTokenMixin
9
- include Models::Mongoid4::Scopes
10
-
11
- self.store_in collection: :oauth_access_tokens
12
-
13
- field :resource_owner_id, type: BSON::ObjectId
14
- field :application_id, type: BSON::ObjectId
15
- field :token, type: String
16
- field :refresh_token, type: String
17
- field :expires_in, type: Integer
18
- field :revoked_at, type: DateTime
19
-
20
- index({ token: 1 }, { unique: true })
21
- index({ refresh_token: 1 }, { unique: true, sparse: true })
22
-
23
- def self.delete_all_for(application_id, resource_owner)
24
- where(application_id: application_id,
25
- resource_owner_id: resource_owner.id).delete_all
26
- end
27
- private_class_method :delete_all_for
28
-
29
- def self.order_method
30
- :order_by
31
- end
32
-
33
- def self.created_at_desc
34
- [:created_at, :desc]
35
- end
36
- end
37
- end
@@ -1,25 +0,0 @@
1
- module Doorkeeper
2
- class Application
3
- include Mongoid::Document
4
- include Mongoid::Timestamps
5
- include Models::Mongoid4::Scopes
6
-
7
- include ApplicationMixin
8
-
9
- self.store_in collection: :oauth_applications
10
-
11
- field :name, type: String
12
- field :uid, type: String
13
- field :secret, type: String
14
- field :redirect_uri, type: String
15
-
16
- index({ uid: 1 }, { unique: true })
17
-
18
- has_many :authorized_tokens, class_name: 'Doorkeeper::AccessToken'
19
-
20
- def self.authorized_for(resource_owner)
21
- ids = AccessToken.where(resource_owner_id: resource_owner.id, revoked_at: nil).map(&:application_id)
22
- find(ids)
23
- end
24
- end
25
- end
@@ -1,17 +0,0 @@
1
- module Doorkeeper
2
- module Models
3
- module Mongoid4
4
- module Scopes
5
- extend ActiveSupport::Concern
6
-
7
- included do
8
- field :scopes, type: String
9
- end
10
-
11
- def scopes=(value)
12
- write_attribute :scopes, value
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,11 +0,0 @@
1
- defaults: &defaults
2
- host: 127.0.0.1
3
- port: 27017
4
-
5
- development:
6
- <<: *defaults
7
- database: doorkeeper-mongomapper-development
8
-
9
- test:
10
- <<: *defaults
11
- database: doorkeeper-mongomapper-test-suite
@@ -1,9 +0,0 @@
1
- development:
2
- database: doorkeeper-development
3
- persist_in_safe_mode: true
4
- autocreate_indexes: true
5
-
6
- test:
7
- database: doorkeeper-mongoid2-test
8
- persist_in_safe_mode: true
9
- autocreate_indexes: true
@@ -1,18 +0,0 @@
1
- development:
2
- sessions:
3
- default:
4
- database: doorkeeper-mongoid3-development
5
- hosts:
6
- - localhost:27017
7
- options:
8
- consistency: :strong
9
- safe: true
10
- test:
11
- sessions:
12
- default:
13
- database: doorkeeper-mongoid3-test
14
- hosts:
15
- - localhost:27017
16
- options:
17
- consistency: :strong
18
- safe: true
@@ -1,19 +0,0 @@
1
- development:
2
- sessions:
3
- default:
4
- database: doorkeeper-mongoid4-development
5
- hosts:
6
- - localhost:27017
7
- options:
8
- write:
9
- w: 1
10
-
11
- test:
12
- sessions:
13
- default:
14
- database: doorkeeper-mongoid4-test
15
- hosts:
16
- - localhost:27017
17
- options:
18
- write:
19
- w: 1
@@ -1,10 +0,0 @@
1
- DatabaseCleaner[:mongo_mapper].strategy = :truncation
2
- DatabaseCleaner[:mongo_mapper].clean_with :truncation
3
-
4
- RSpec.configure do |config|
5
- config.before :suite do
6
- Doorkeeper::Application.create_indexes
7
- Doorkeeper::AccessGrant.create_indexes
8
- Doorkeeper::AccessToken.create_indexes
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- DatabaseCleaner[:mongoid].strategy = :truncation
2
- DatabaseCleaner[:mongoid].clean_with :truncation
3
-
4
- RSpec.configure do |config|
5
- config.before do
6
- Doorkeeper::Application.create_indexes
7
- Doorkeeper::AccessGrant.create_indexes
8
- Doorkeeper::AccessToken.create_indexes
9
- end
10
- end