Skip to content

Commit

Permalink
Fixes for mixins, update to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
nbulaj committed Feb 22, 2018
1 parent 0e67d86 commit 424e5e6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doorkeeper
Submodule doorkeeper updated 55 files
+7 −1 .github/ISSUE_TEMPLATE.md
+1 −1 .gitignore
+8 −4 .travis.yml
+14 −1 NEWS.md
+3 −3 README.md
+3 −1 SECURITY.md
+10 −1 app/controllers/doorkeeper/applications_controller.rb
+12 −2 app/validators/redirect_uri_validator.rb
+2 −1 config/locales/en.yml
+3 −2 doorkeeper.gemspec
+2 −0 gemfiles/rails_4_2.gemfile
+53 −53 lib/doorkeeper/config.rb
+13 −8 lib/doorkeeper/grape/helpers.rb
+0 −28 lib/doorkeeper/models/access_grant_mixin.rb
+10 −36 lib/doorkeeper/models/access_token_mixin.rb
+7 −25 lib/doorkeeper/models/application_mixin.rb
+2 −0 lib/doorkeeper/oauth/authorization_code_request.rb
+1 −2 lib/doorkeeper/oauth/error_response.rb
+1 −1 lib/doorkeeper/oauth/invalid_token_response.rb
+1 −0 lib/doorkeeper/oauth/password_access_token_request.rb
+1 −0 lib/doorkeeper/oauth/refresh_token_request.rb
+3 −2 lib/doorkeeper/orm/active_record.rb
+28 −1 lib/doorkeeper/orm/active_record/access_grant.rb
+22 −21 lib/doorkeeper/orm/active_record/access_token.rb
+21 −1 lib/doorkeeper/orm/active_record/application.rb
+11 −0 lib/doorkeeper/orm/active_record/base_record.rb
+2 −1 lib/doorkeeper/rails/helpers.rb
+0 −1 lib/doorkeeper/rails/routes.rb
+7 −1 lib/doorkeeper/request.rb
+3 −2 lib/doorkeeper/validations.rb
+2 −2 lib/doorkeeper/version.rb
+14 −0 lib/generators/doorkeeper/templates/initializer.rb
+13 −2 spec/controllers/applications_controller_spec.rb
+1 −1 spec/controllers/authorizations_controller_spec.rb
+2 −3 spec/controllers/protected_resources_controller_spec.rb
+2 −2 spec/controllers/tokens_controller_spec.rb
+12 −0 spec/generators/previous_refresh_token_generator_spec.rb
+135 −0 spec/grape/grape_integration_spec.rb
+113 −10 spec/lib/config_spec.rb
+23 −7 spec/lib/oauth/authorization_code_request_spec.rb
+1 −1 spec/lib/oauth/base_request_spec.rb
+1 −1 spec/lib/oauth/error_spec.rb
+5 −0 spec/lib/oauth/helpers/uri_checker_spec.rb
+6 −0 spec/lib/oauth/password_access_token_request_spec.rb
+6 −0 spec/lib/oauth/refresh_token_request_spec.rb
+10 −0 spec/lib/server_spec.rb
+33 −0 spec/models/doorkeeper/application_spec.rb
+28 −0 spec/requests/flows/client_credentials_spec.rb
+2 −2 spec/requests/flows/implicit_grant_errors_spec.rb
+39 −0 spec/requests/flows/password_spec.rb
+10 −4 spec/spec_helper_integration.rb
+1 −1 spec/support/helpers/request_spec_helper.rb
+1 −0 spec/support/helpers/url_helper.rb
+50 −5 spec/validators/redirect_uri_validator_spec.rb
+15 −0 spec/version/version_spec.rb
2 changes: 1 addition & 1 deletion doorkeeper-mongodb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
5 changes: 5 additions & 0 deletions lib/doorkeeper-mongodb/mixins/mongoid/application_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module ApplicationMixin

include Doorkeeper::OAuth::Helpers
include Doorkeeper::Models::Scopes
include BaseMixin

included do
has_many_options = {
Expand All @@ -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
Expand Down

0 comments on commit 424e5e6

Please sign in to comment.