diff --git a/NEWS.md b/NEWS.md index 9f246237f..86a539485 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,10 @@ User-visible changes worth mentioning. ## master +- [#PR ID] Add PR description. + +## 5.0.0 + - [#1127] Change the token_type initials of the Banner Token to uppercase to comply with the RFC6750 specification. ## 5.0.0.rc2 diff --git a/doorkeeper.gemspec b/doorkeeper.gemspec index f79854388..e426cb624 100644 --- a/doorkeeper.gemspec +++ b/doorkeeper.gemspec @@ -1,30 +1,30 @@ -$LOAD_PATH.push File.expand_path("../lib", __FILE__) +$LOAD_PATH.push File.expand_path('../lib', __FILE__) -require "doorkeeper/version" +require 'doorkeeper/version' Gem::Specification.new do |s| - s.name = "doorkeeper" + s.name = 'doorkeeper' s.version = Doorkeeper.gem_version - s.authors = ["Felipe Elias Philipp", "Tute Costa", "Jon Moss", "Nikita Bulai"] + s.authors = ['Felipe Elias Philipp', 'Tute Costa', 'Jon Moss', 'Nikita Bulai'] s.email = %w(bulaj.nikita@gmail.com) - s.homepage = "https://github.com/doorkeeper-gem/doorkeeper" - s.summary = "OAuth 2 provider for Rails and Grape" - s.description = "Doorkeeper is an OAuth 2 provider for Rails and Grape." + s.homepage = 'https://github.com/doorkeeper-gem/doorkeeper' + s.summary = 'OAuth 2 provider for Rails and Grape' + s.description = 'Doorkeeper is an OAuth 2 provider for Rails and Grape.' s.license = 'MIT' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- spec/*`.split("\n") - s.require_paths = ["lib"] + s.require_paths = ['lib'] - s.add_dependency "railties", ">= 4.2" - s.required_ruby_version = ">= 2.1" + s.add_dependency 'railties', '>= 4.2' + s.required_ruby_version = '>= 2.1' - s.add_development_dependency "capybara", '~> 2.18' - s.add_development_dependency "coveralls" - s.add_development_dependency "grape" - s.add_development_dependency "database_cleaner", "~> 1.6" - s.add_development_dependency "factory_bot", "~> 4.8" - s.add_development_dependency "generator_spec", "~> 0.9.3" - s.add_development_dependency "rake", ">= 11.3.0" - s.add_development_dependency "rspec-rails" + s.add_development_dependency 'capybara', '~> 2.18' + s.add_development_dependency 'coveralls' + s.add_development_dependency 'grape' + s.add_development_dependency 'database_cleaner', '~> 1.6' + s.add_development_dependency 'factory_bot', '~> 4.8' + s.add_development_dependency 'generator_spec', '~> 0.9.3' + s.add_development_dependency 'rake', '>= 11.3.0' + s.add_development_dependency 'rspec-rails' end diff --git a/lib/doorkeeper/oauth/authorization/token.rb b/lib/doorkeeper/oauth/authorization/token.rb index 675401277..e881df4c4 100644 --- a/lib/doorkeeper/oauth/authorization/token.rb +++ b/lib/doorkeeper/oauth/authorization/token.rb @@ -34,8 +34,6 @@ def refresh_token_enabled?(server, context) !!server.refresh_token_enabled? end end - - private end def initialize(pre_auth, resource_owner) diff --git a/lib/doorkeeper/oauth/client_credentials/creator.rb b/lib/doorkeeper/oauth/client_credentials/creator.rb index e9ae204c2..09ad284d5 100644 --- a/lib/doorkeeper/oauth/client_credentials/creator.rb +++ b/lib/doorkeeper/oauth/client_credentials/creator.rb @@ -5,7 +5,8 @@ class Creator def call(client, scopes, attributes = {}) AccessToken.find_or_create_for( client, nil, scopes, attributes[:expires_in], - attributes[:use_refresh_token]) + attributes[:use_refresh_token] + ) end end end diff --git a/lib/doorkeeper/rails/routes.rb b/lib/doorkeeper/rails/routes.rb index 807219f1b..78715a7fe 100644 --- a/lib/doorkeeper/rails/routes.rb +++ b/lib/doorkeeper/rails/routes.rb @@ -44,11 +44,11 @@ def generate_routes!(options) private def map_route(name, method) - unless @mapping.skipped?(name) - send(method, @mapping[name]) + return if @mapping.skipped?(name) - mapping[name] = @mapping[name] - end + send(method, @mapping[name]) + + mapping[name] = @mapping[name] end def authorization_routes(mapping) diff --git a/lib/doorkeeper/version.rb b/lib/doorkeeper/version.rb index 5181a23a4..af5e4cecc 100644 --- a/lib/doorkeeper/version.rb +++ b/lib/doorkeeper/version.rb @@ -8,7 +8,7 @@ module VERSION MAJOR = 5 MINOR = 0 TINY = 0 - PRE = 'rc2' + PRE = nil # Full version number STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') diff --git a/spec/controllers/tokens_controller_spec.rb b/spec/controllers/tokens_controller_spec.rb index 6226ae545..d87a32b17 100644 --- a/spec/controllers/tokens_controller_spec.rb +++ b/spec/controllers/tokens_controller_spec.rb @@ -33,7 +33,7 @@ allow(I18n).to receive(:translate). with( custom_message, - hash_including(scope: %i[doorkeeper errors messages]), + hash_including(scope: %i[doorkeeper errors messages]) ). and_return('Authorization custom message')