-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1154 from doorkeeper-gem/refactor_stale_records_c…
…leaner Refactor StaleRecordsCleaner to be ORM agnostic
- Loading branch information
Showing
80 changed files
with
261 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
CHANGELOG_FILE = 'NEWS.md' | ||
GITHUB_REPO = 'https://github.com/doorkeeper-gem/doorkeeper' | ||
|
||
def changelog_changed? | ||
git.modified_files.include?(CHANGELOG_FILE) || git.added_files.include?(CHANGELOG_FILE) | ||
end | ||
|
||
def changelog_entry_example | ||
pr_number = github.pr_json['number'] | ||
pr_url = github.pr_json['html_url'] | ||
pr_title = github.pr_title | ||
.sub(/[?.!,;]?$/, '') | ||
.capitalize | ||
|
||
"- [##{pr_number}](#{pr_url}): #{pr_title}." | ||
end | ||
|
||
# -------------------------------------------------------------------------------------------------------------------- | ||
# Has any changes happened inside the actual library code? | ||
# -------------------------------------------------------------------------------------------------------------------- | ||
has_app_changes = !git.modified_files.grep(/lib/).empty? | ||
has_spec_changes = !git.modified_files.grep(/spec/).empty? | ||
|
||
# -------------------------------------------------------------------------------------------------------------------- | ||
# You've made changes to lib, but didn't write any tests? | ||
# -------------------------------------------------------------------------------------------------------------------- | ||
if has_app_changes && !has_spec_changes | ||
warn("There're library changes, but not tests. That's OK as long as you're refactoring existing code.", sticky: false) | ||
end | ||
|
||
# -------------------------------------------------------------------------------------------------------------------- | ||
# You've made changes to specs, but no library code has changed? | ||
# -------------------------------------------------------------------------------------------------------------------- | ||
if !has_app_changes && has_spec_changes | ||
message('We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests!', sticky: false) | ||
end | ||
|
||
# Mainly to encourage writing up some reasoning about the PR, rather than | ||
# just leaving a title | ||
if github.pr_body.length < 10 | ||
fail "Please provide a summary in the Pull Request description" | ||
end | ||
|
||
# -------------------------------------------------------------------------------------------------------------------- | ||
# Have you updated CHANGELOG.md? | ||
# -------------------------------------------------------------------------------------------------------------------- | ||
# Add a CHANGELOG entry for app changes | ||
if has_app_changes && !changelog_changed? | ||
markdown <<-MARKDOWN | ||
Here's an example of a #{CHANGELOG_FILE} entry: | ||
```markdown | ||
#{changelog_entry_example} | ||
``` | ||
MARKDOWN | ||
|
||
fail("Please include a changelog entry. \nYou can find it at [#{CHANGELOG_FILE}](#{GITHUB_REPO}/blob/master/#{CHANGELOG_FILE}).") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
app/controllers/doorkeeper/authorized_applications_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'uri' | ||
|
||
class RedirectUriValidator < ActiveModel::EachValidator | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,30 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__) | |
|
||
require 'doorkeeper/version' | ||
|
||
Gem::Specification.new do |s| | ||
s.name = 'doorkeeper' | ||
s.version = Doorkeeper.gem_version | ||
s.authors = ['Felipe Elias Philipp', 'Tute Costa', 'Jon Moss', 'Nikita Bulai'] | ||
s.email = %w([email protected]) | ||
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' | ||
Gem::Specification.new do |gem| | ||
gem.name = 'doorkeeper' | ||
gem.version = Doorkeeper.gem_version | ||
gem.authors = ['Felipe Elias Philipp', 'Tute Costa', 'Jon Moss', 'Nikita Bulai'] | ||
gem.email = %w([email protected]) | ||
gem.homepage = 'https://github.com/doorkeeper-gem/doorkeeper' | ||
gem.summary = 'OAuth 2 provider for Rails and Grape' | ||
gem.description = 'Doorkeeper is an OAuth 2 provider for Rails and Grape.' | ||
gem.license = 'MIT' | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- spec/*`.split("\n") | ||
s.require_paths = ['lib'] | ||
gem.files = `git ls-files`.split("\n") | ||
gem.test_files = `git ls-files -- spec/*`.split("\n") | ||
gem.require_paths = ['lib'] | ||
|
||
s.add_dependency 'railties', '>= 4.2' | ||
s.required_ruby_version = '>= 2.1' | ||
gem.add_dependency 'railties', '>= 4.2' | ||
gem.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' | ||
gem.add_development_dependency 'capybara', '~> 2.18' | ||
gem.add_development_dependency 'coveralls' | ||
gem.add_development_dependency 'danger', '~> 5.0' | ||
gem.add_development_dependency 'grape' | ||
gem.add_development_dependency 'database_cleaner', '~> 1.6' | ||
gem.add_development_dependency 'factory_bot', '~> 4.8' | ||
gem.add_development_dependency 'generator_spec', '~> 0.9.3' | ||
gem.add_development_dependency 'rake', '>= 11.3.0' | ||
gem.add_development_dependency 'rspec-rails' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Grape | ||
class AuthorizationDecorator < SimpleDelegator | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'doorkeeper/grape/authorization_decorator' | ||
|
||
module Doorkeeper | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module AccessGrantMixin | ||
extend ActiveSupport::Concern | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module AccessTokenMixin | ||
extend ActiveSupport::Concern | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module ApplicationMixin | ||
extend ActiveSupport::Concern | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Models | ||
module Accessible | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Models | ||
module Expirable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Models | ||
module Orderable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Models | ||
module Ownership | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Models | ||
module Revocable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module Models | ||
module Scopes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
module Authorization | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
module Authorization | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
module Authorization | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rack/utils' | ||
|
||
module Doorkeeper | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class AuthorizationCodeRequest < BaseRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class BaseRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class BaseResponse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class Client | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class Client | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class ClientCredentialsRequest < BaseRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class ClientCredentialsRequest < BaseRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class ClientCredentialsRequest < BaseRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class ClientCredentialsRequest < BaseRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class CodeRequest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class CodeResponse < BaseResponse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
Error = Struct.new(:name, :state) do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class ErrorResponse < BaseResponse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Doorkeeper | ||
module OAuth | ||
class ForbiddenTokenResponse < ErrorResponse | ||
|
Oops, something went wrong.