diff --git a/Rakefile b/Rakefile index 74c98d9..95bc97c 100644 --- a/Rakefile +++ b/Rakefile @@ -4,8 +4,10 @@ require 'rspec/core/rake_task' task :load_doorkeeper do `rm -rf spec/` `git checkout spec` - `git submodule init` - `git submodule update` + unless Dir.exist?('doorkeeper') + `git submodule init` + `git submodule update` + end `cp -r -n doorkeeper/spec .` `rm -rf spec/generators/` # we are not ActiveRecord `bundle exec rspec` diff --git a/config/locales/en.yml b/config/locales/en.yml index d8858dd..fa2d3c7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -13,6 +13,7 @@ en: invalid_uri: 'must be a valid URI.' relative_uri: 'must be an absolute URI.' secured_uri: 'must be an HTTPS/SSL URI.' + forbidden_uri: 'is forbidden by the server.' mongoid: <<: *orm diff --git a/doorkeeper b/doorkeeper index 0e1cc96..62289ad 160000 --- a/doorkeeper +++ b/doorkeeper @@ -1 +1 @@ -Subproject commit 0e1cc9606b82f5fda8363d79a8955e727e761c7d +Subproject commit 62289ad49f423cadbfbf1435ffd0046b71fc0ea3 diff --git a/doorkeeper-mongodb.gemspec b/doorkeeper-mongodb.gemspec index 5099a77..cb5cef7 100644 --- a/doorkeeper-mongodb.gemspec +++ b/doorkeeper-mongodb.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |gem| gem.files = Dir['lib/**/*', 'config/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] gem.test_files = Dir['spec/**/*'] - gem.add_dependency 'doorkeeper', '>= 4.0.0' + gem.add_dependency 'doorkeeper', '>= 4.0.0', '< 5.0' gem.add_development_dependency 'grape' gem.add_development_dependency 'coveralls' diff --git a/lib/doorkeeper-mongodb/mixins/mongo_mapper/application_mixin.rb b/lib/doorkeeper-mongodb/mixins/mongo_mapper/application_mixin.rb index 7843f8a..3f56c68 100644 --- a/lib/doorkeeper-mongodb/mixins/mongo_mapper/application_mixin.rb +++ b/lib/doorkeeper-mongodb/mixins/mongo_mapper/application_mixin.rb @@ -17,6 +17,10 @@ module ApplicationMixin validates :redirect_uri, redirect_uri: true before_validation :generate_uid, :generate_secret, on: :create + + def redirect_uri=(uris) + super(uris.is_a?(Array) ? uris.join("\n") : uris) + end end module ClassMethods diff --git a/lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb b/lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb index e0fdc65..525b158 100644 --- a/lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb +++ b/lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb @@ -9,6 +9,7 @@ module AccessGrantMixin include Doorkeeper::Models::Revocable include Doorkeeper::Models::Accessible include Doorkeeper::Models::Scopes + include BaseMixin included do belongs_to_opts = { diff --git a/lib/doorkeeper-mongodb/mixins/mongoid/access_token_mixin.rb b/lib/doorkeeper-mongodb/mixins/mongoid/access_token_mixin.rb index b45ce12..d281fd6 100644 --- a/lib/doorkeeper-mongodb/mixins/mongoid/access_token_mixin.rb +++ b/lib/doorkeeper-mongodb/mixins/mongoid/access_token_mixin.rb @@ -9,6 +9,7 @@ module AccessTokenMixin include Doorkeeper::Models::Revocable include Doorkeeper::Models::Accessible include Doorkeeper::Models::Scopes + include BaseMixin included do belongs_to_opts = { diff --git a/lib/doorkeeper-mongodb/mixins/mongoid/application_mixin.rb b/lib/doorkeeper-mongodb/mixins/mongoid/application_mixin.rb index 81c0a32..ed9eb78 100644 --- a/lib/doorkeeper-mongodb/mixins/mongoid/application_mixin.rb +++ b/lib/doorkeeper-mongodb/mixins/mongoid/application_mixin.rb @@ -6,6 +6,7 @@ module ApplicationMixin include Doorkeeper::OAuth::Helpers include Doorkeeper::Models::Scopes + include BaseMixin included do has_many_options = { @@ -25,6 +26,10 @@ module ApplicationMixin validates :redirect_uri, redirect_uri: true before_validation :generate_uid, :generate_secret, on: :create + + def redirect_uri=(uris) + super(uris.is_a?(Array) ? uris.join("\n") : uris) + end end module ClassMethods