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.
- checksums.yaml +4 -4
- data/.travis.yml +0 -23
- data/NEWS.md +17 -9
- data/README.md +5 -31
- data/config/locales/en.yml +1 -31
- data/doorkeeper.gemspec +0 -3
- data/lib/doorkeeper.rb +0 -4
- data/lib/doorkeeper/models/application_mixin.rb +0 -12
- data/lib/doorkeeper/orm/active_record.rb +3 -4
- data/lib/doorkeeper/rails/helpers.rb +0 -18
- data/lib/doorkeeper/version.rb +1 -1
- data/lib/generators/doorkeeper/templates/README +0 -20
- data/lib/generators/doorkeeper/templates/initializer.rb +1 -3
- data/spec/controllers/protected_resources_controller_spec.rb +0 -13
- data/spec/dummy/app/models/user.rb +1 -25
- data/spec/dummy/config/application.rb +0 -1
- data/spec/dummy/config/initializers/doorkeeper.rb +0 -2
- data/spec/models/doorkeeper/application_spec.rb +0 -15
- data/spec/spec_helper_integration.rb +1 -7
- metadata +4 -84
- data/gemfiles/Gemfile.common.rb +0 -7
- data/gemfiles/Gemfile.mongo_mapper.rb +0 -5
- data/gemfiles/Gemfile.mongoid2.rb +0 -5
- data/gemfiles/Gemfile.mongoid3.rb +0 -4
- data/gemfiles/Gemfile.mongoid4.rb +0 -4
- data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/indexes_generator.rb +0 -12
- data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/templates/indexes.rb +0 -3
- data/lib/doorkeeper/orm/mongo_mapper.rb +0 -19
- data/lib/doorkeeper/orm/mongo_mapper/access_grant.rb +0 -24
- data/lib/doorkeeper/orm/mongo_mapper/access_token.rb +0 -43
- data/lib/doorkeeper/orm/mongo_mapper/application.rb +0 -32
- data/lib/doorkeeper/orm/mongoid2.rb +0 -19
- data/lib/doorkeeper/orm/mongoid2/access_grant.rb +0 -22
- data/lib/doorkeeper/orm/mongoid2/access_token.rb +0 -37
- data/lib/doorkeeper/orm/mongoid2/application.rb +0 -25
- data/lib/doorkeeper/orm/mongoid2/concerns/scopes.rb +0 -30
- data/lib/doorkeeper/orm/mongoid3.rb +0 -19
- data/lib/doorkeeper/orm/mongoid3/access_grant.rb +0 -22
- data/lib/doorkeeper/orm/mongoid3/access_token.rb +0 -37
- data/lib/doorkeeper/orm/mongoid3/application.rb +0 -25
- data/lib/doorkeeper/orm/mongoid3/concerns/scopes.rb +0 -30
- data/lib/doorkeeper/orm/mongoid4.rb +0 -19
- data/lib/doorkeeper/orm/mongoid4/access_grant.rb +0 -22
- data/lib/doorkeeper/orm/mongoid4/access_token.rb +0 -37
- data/lib/doorkeeper/orm/mongoid4/application.rb +0 -25
- data/lib/doorkeeper/orm/mongoid4/concerns/scopes.rb +0 -17
- data/spec/dummy/config/mongo.yml +0 -11
- data/spec/dummy/config/mongoid2.yml +0 -9
- data/spec/dummy/config/mongoid3.yml +0 -18
- data/spec/dummy/config/mongoid4.yml +0 -19
- data/spec/support/orm/mongo_mapper.rb +0 -10
- 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
|
data/spec/dummy/config/mongo.yml
DELETED
@@ -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
|
data/spec/support/orm/mongoid.rb
DELETED
@@ -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
|