doorkeeper 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.hound.yml +2 -1
- data/.rubocop.yml +37 -4
- data/.travis.yml +16 -21
- data/Appraisals +29 -7
- data/Dangerfile +67 -0
- data/Gemfile +19 -5
- data/NEWS.md +107 -10
- data/README.md +75 -470
- data/Rakefile +10 -8
- data/app/controllers/doorkeeper/application_controller.rb +3 -2
- data/app/controllers/doorkeeper/application_metal_controller.rb +4 -13
- data/app/controllers/doorkeeper/applications_controller.rb +21 -7
- data/app/controllers/doorkeeper/authorizations_controller.rb +3 -3
- data/app/controllers/doorkeeper/authorized_applications_controller.rb +2 -0
- data/app/controllers/doorkeeper/token_info_controller.rb +4 -2
- data/app/controllers/doorkeeper/tokens_controller.rb +13 -11
- data/app/helpers/doorkeeper/dashboard_helper.rb +3 -1
- data/app/validators/redirect_uri_validator.rb +7 -2
- data/app/views/doorkeeper/applications/_form.html.erb +6 -0
- data/app/views/doorkeeper/applications/show.html.erb +1 -1
- data/app/views/layouts/doorkeeper/admin.html.erb +5 -3
- data/bin/console +16 -0
- data/config/locales/en.yml +1 -0
- data/doorkeeper.gemspec +28 -24
- data/gemfiles/rails_5_0.gemfile +9 -4
- data/gemfiles/rails_5_1.gemfile +9 -4
- data/gemfiles/rails_5_2.gemfile +10 -5
- data/gemfiles/rails_6_0.gemfile +17 -0
- data/gemfiles/rails_master.gemfile +9 -9
- data/lib/doorkeeper/config/option.rb +64 -0
- data/lib/doorkeeper/config.rb +197 -76
- data/lib/doorkeeper/engine.rb +3 -1
- data/lib/doorkeeper/errors.rb +17 -0
- data/lib/doorkeeper/grape/authorization_decorator.rb +6 -4
- data/lib/doorkeeper/grape/helpers.rb +5 -3
- data/lib/doorkeeper/helpers/controller.rb +5 -2
- data/lib/doorkeeper/models/access_grant_mixin.rb +25 -6
- data/lib/doorkeeper/models/access_token_mixin.rb +68 -22
- data/lib/doorkeeper/models/application_mixin.rb +45 -1
- data/lib/doorkeeper/models/concerns/accessible.rb +2 -0
- data/lib/doorkeeper/models/concerns/expirable.rb +6 -2
- data/lib/doorkeeper/models/concerns/orderable.rb +2 -0
- data/lib/doorkeeper/models/concerns/ownership.rb +3 -6
- data/lib/doorkeeper/models/concerns/reusable.rb +19 -0
- data/lib/doorkeeper/models/concerns/revocable.rb +4 -1
- data/lib/doorkeeper/models/concerns/scopes.rb +7 -1
- data/lib/doorkeeper/models/concerns/secret_storable.rb +108 -0
- data/lib/doorkeeper/oauth/authorization/code.rb +4 -2
- data/lib/doorkeeper/oauth/authorization/context.rb +2 -0
- data/lib/doorkeeper/oauth/authorization/token.rb +14 -7
- data/lib/doorkeeper/oauth/authorization/uri_builder.rb +3 -1
- data/lib/doorkeeper/oauth/authorization_code_request.rb +8 -4
- data/lib/doorkeeper/oauth/base_request.rb +2 -0
- data/lib/doorkeeper/oauth/base_response.rb +2 -0
- data/lib/doorkeeper/oauth/client/credentials.rb +2 -0
- data/lib/doorkeeper/oauth/client.rb +3 -1
- data/lib/doorkeeper/oauth/client_credentials/creator.rb +2 -0
- data/lib/doorkeeper/oauth/client_credentials/issuer.rb +2 -0
- data/lib/doorkeeper/oauth/client_credentials/validation.rb +7 -4
- data/lib/doorkeeper/oauth/client_credentials_request.rb +3 -1
- data/lib/doorkeeper/oauth/code_request.rb +2 -0
- data/lib/doorkeeper/oauth/code_response.rb +4 -2
- data/lib/doorkeeper/oauth/error.rb +2 -0
- data/lib/doorkeeper/oauth/error_response.rb +20 -6
- data/lib/doorkeeper/oauth/forbidden_token_response.rb +10 -3
- data/lib/doorkeeper/oauth/helpers/scope_checker.rb +25 -8
- data/lib/doorkeeper/oauth/helpers/unique_token.rb +15 -1
- data/lib/doorkeeper/oauth/helpers/uri_checker.rb +42 -3
- data/lib/doorkeeper/oauth/invalid_token_response.rb +22 -0
- data/lib/doorkeeper/oauth/password_access_token_request.rb +9 -2
- data/lib/doorkeeper/oauth/pre_authorization.rb +13 -5
- data/lib/doorkeeper/oauth/refresh_token_request.rb +15 -4
- data/lib/doorkeeper/oauth/scopes.rb +7 -3
- data/lib/doorkeeper/oauth/token.rb +4 -2
- data/lib/doorkeeper/oauth/token_introspection.rb +76 -8
- data/lib/doorkeeper/oauth/token_request.rb +2 -0
- data/lib/doorkeeper/oauth/token_response.rb +11 -9
- data/lib/doorkeeper/oauth.rb +5 -5
- data/lib/doorkeeper/orm/active_record/access_grant.rb +27 -13
- data/lib/doorkeeper/orm/active_record/access_token.rb +6 -13
- data/lib/doorkeeper/orm/active_record/application.rb +26 -7
- data/lib/doorkeeper/orm/active_record/stale_records_cleaner.rb +10 -3
- data/lib/doorkeeper/orm/active_record.rb +8 -6
- data/lib/doorkeeper/rails/helpers.rb +5 -1
- data/lib/doorkeeper/rails/routes/mapper.rb +2 -0
- data/lib/doorkeeper/rails/routes/mapping.rb +9 -7
- data/lib/doorkeeper/rails/routes.rb +19 -12
- data/lib/doorkeeper/rake/db.rake +17 -17
- data/lib/doorkeeper/rake.rb +1 -1
- data/lib/doorkeeper/request/authorization_code.rb +2 -0
- data/lib/doorkeeper/request/client_credentials.rb +2 -0
- data/lib/doorkeeper/request/code.rb +2 -0
- data/lib/doorkeeper/request/password.rb +2 -0
- data/lib/doorkeeper/request/refresh_token.rb +2 -0
- data/lib/doorkeeper/request/strategy.rb +2 -0
- data/lib/doorkeeper/request/token.rb +2 -0
- data/lib/doorkeeper/request.rb +3 -1
- data/lib/doorkeeper/secret_storing/base.rb +64 -0
- data/lib/doorkeeper/secret_storing/bcrypt.rb +60 -0
- data/lib/doorkeeper/secret_storing/plain.rb +33 -0
- data/lib/doorkeeper/secret_storing/sha256_hash.rb +26 -0
- data/lib/doorkeeper/server.rb +2 -0
- data/lib/doorkeeper/stale_records_cleaner.rb +20 -0
- data/lib/doorkeeper/validations.rb +2 -0
- data/lib/doorkeeper/version.rb +4 -2
- data/lib/doorkeeper.rb +69 -59
- data/lib/generators/doorkeeper/application_owner_generator.rb +10 -9
- data/lib/generators/doorkeeper/confidential_applications_generator.rb +10 -9
- data/lib/generators/doorkeeper/install_generator.rb +11 -9
- data/lib/generators/doorkeeper/migration_generator.rb +9 -9
- data/lib/generators/doorkeeper/pkce_generator.rb +10 -9
- data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +10 -9
- data/lib/generators/doorkeeper/templates/initializer.rb +138 -13
- data/lib/generators/doorkeeper/templates/migration.rb.erb +17 -10
- data/lib/generators/doorkeeper/views_generator.rb +6 -4
- data/spec/controllers/application_metal_controller_spec.rb +24 -10
- data/spec/controllers/applications_controller_spec.rb +76 -78
- data/spec/controllers/authorizations_controller_spec.rb +189 -142
- data/spec/controllers/protected_resources_controller_spec.rb +111 -67
- data/spec/controllers/token_info_controller_spec.rb +14 -12
- data/spec/controllers/tokens_controller_spec.rb +170 -112
- data/spec/dummy/Rakefile +3 -1
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/app/controllers/custom_authorizations_controller.rb +3 -1
- data/spec/dummy/app/controllers/full_protected_resources_controller.rb +4 -2
- data/spec/dummy/app/controllers/home_controller.rb +6 -5
- data/spec/dummy/app/controllers/metal_controller.rb +2 -0
- data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +4 -2
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/user.rb +2 -0
- data/spec/dummy/config/application.rb +26 -2
- data/spec/dummy/config/boot.rb +2 -4
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/development.rb +2 -0
- data/spec/dummy/config/environments/production.rb +2 -0
- data/spec/dummy/config/environments/test.rb +4 -2
- data/spec/dummy/config/initializers/backtrace_silencers.rb +2 -0
- data/spec/dummy/config/initializers/doorkeeper.rb +7 -3
- data/spec/dummy/config/initializers/secret_token.rb +3 -1
- data/spec/dummy/config/initializers/session_store.rb +3 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/spec/dummy/config.ru +3 -1
- data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +20 -13
- data/spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb +1 -1
- data/spec/dummy/db/migrate/20170822064514_enable_pkce.rb +2 -0
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/script/rails +7 -4
- data/spec/factories.rb +11 -9
- data/spec/generators/application_owner_generator_spec.rb +13 -26
- data/spec/generators/confidential_applications_generator_spec.rb +12 -28
- data/spec/generators/install_generator_spec.rb +19 -14
- data/spec/generators/migration_generator_spec.rb +13 -26
- data/spec/generators/pkce_generator_spec.rb +11 -26
- data/spec/generators/previous_refresh_token_generator_spec.rb +16 -29
- data/spec/generators/templates/routes.rb +2 -1
- data/spec/generators/views_generator_spec.rb +14 -12
- data/spec/grape/grape_integration_spec.rb +35 -33
- data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +9 -7
- data/spec/lib/config_spec.rb +290 -104
- data/spec/lib/doorkeeper_spec.rb +8 -6
- data/spec/lib/models/expirable_spec.rb +22 -8
- data/spec/lib/models/reusable_spec.rb +40 -0
- data/spec/lib/models/revocable_spec.rb +8 -6
- data/spec/lib/models/scopes_spec.rb +27 -13
- data/spec/lib/models/secret_storable_spec.rb +135 -0
- data/spec/lib/oauth/authorization/uri_builder_spec.rb +17 -15
- data/spec/lib/oauth/authorization_code_request_spec.rb +43 -17
- data/spec/lib/oauth/base_request_spec.rb +24 -12
- data/spec/lib/oauth/base_response_spec.rb +3 -1
- data/spec/lib/oauth/client/credentials_spec.rb +26 -24
- data/spec/lib/oauth/client_credentials/creator_spec.rb +56 -10
- data/spec/lib/oauth/client_credentials/issuer_spec.rb +27 -20
- data/spec/lib/oauth/client_credentials/validation_spec.rb +21 -15
- data/spec/lib/oauth/client_credentials_integration_spec.rb +8 -6
- data/spec/lib/oauth/client_credentials_request_spec.rb +27 -21
- data/spec/lib/oauth/client_spec.rb +15 -13
- data/spec/lib/oauth/code_request_spec.rb +10 -8
- data/spec/lib/oauth/code_response_spec.rb +9 -7
- data/spec/lib/oauth/error_response_spec.rb +19 -11
- data/spec/lib/oauth/error_spec.rb +4 -2
- data/spec/lib/oauth/forbidden_token_response_spec.rb +7 -5
- data/spec/lib/oauth/helpers/scope_checker_spec.rb +68 -31
- data/spec/lib/oauth/helpers/unique_token_spec.rb +8 -6
- data/spec/lib/oauth/helpers/uri_checker_spec.rb +124 -93
- data/spec/lib/oauth/invalid_token_response_spec.rb +3 -1
- data/spec/lib/oauth/password_access_token_request_spec.rb +95 -34
- data/spec/lib/oauth/pre_authorization_spec.rb +80 -54
- data/spec/lib/oauth/refresh_token_request_spec.rb +46 -39
- data/spec/lib/oauth/scopes_spec.rb +63 -61
- data/spec/lib/oauth/token_request_spec.rb +80 -25
- data/spec/lib/oauth/token_response_spec.rb +40 -38
- data/spec/lib/oauth/token_spec.rb +64 -45
- data/spec/lib/request/strategy_spec.rb +3 -1
- data/spec/lib/secret_storing/base_spec.rb +60 -0
- data/spec/lib/secret_storing/bcrypt_spec.rb +49 -0
- data/spec/lib/secret_storing/plain_spec.rb +44 -0
- data/spec/lib/secret_storing/sha256_hash_spec.rb +48 -0
- data/spec/lib/server_spec.rb +20 -18
- data/spec/lib/{orm/active_record/stale_records_cleaner_spec.rb → stale_records_cleaner_spec.rb} +28 -18
- data/spec/models/doorkeeper/access_grant_spec.rb +80 -15
- data/spec/models/doorkeeper/access_token_spec.rb +212 -83
- data/spec/models/doorkeeper/application_spec.rb +146 -49
- data/spec/requests/applications/applications_request_spec.rb +100 -68
- data/spec/requests/applications/authorized_applications_spec.rb +20 -18
- data/spec/requests/endpoints/authorization_spec.rb +27 -25
- data/spec/requests/endpoints/token_spec.rb +38 -36
- data/spec/requests/flows/authorization_code_errors_spec.rb +27 -25
- data/spec/requests/flows/authorization_code_spec.rb +260 -158
- data/spec/requests/flows/client_credentials_spec.rb +54 -52
- data/spec/requests/flows/implicit_grant_errors_spec.rb +11 -9
- data/spec/requests/flows/implicit_grant_spec.rb +27 -25
- data/spec/requests/flows/password_spec.rb +64 -56
- data/spec/requests/flows/refresh_token_spec.rb +91 -32
- data/spec/requests/flows/revoke_token_spec.rb +49 -63
- data/spec/requests/flows/skip_authorization_spec.rb +23 -21
- data/spec/requests/protected_resources/metal_spec.rb +7 -5
- data/spec/requests/protected_resources/private_api_spec.rb +37 -35
- data/spec/routing/custom_controller_routes_spec.rb +71 -65
- data/spec/routing/default_routes_spec.rb +22 -20
- data/spec/routing/scoped_routes_spec.rb +20 -18
- data/spec/spec_helper.rb +15 -13
- data/spec/spec_helper_integration.rb +3 -1
- data/spec/support/dependencies/factory_bot.rb +3 -1
- data/spec/support/doorkeeper_rspec.rb +5 -2
- data/spec/support/helpers/access_token_request_helper.rb +3 -1
- data/spec/support/helpers/authorization_request_helper.rb +4 -2
- data/spec/support/helpers/config_helper.rb +2 -0
- data/spec/support/helpers/model_helper.rb +11 -5
- data/spec/support/helpers/request_spec_helper.rb +5 -3
- data/spec/support/helpers/url_helper.rb +20 -18
- data/spec/support/http_method_shim.rb +4 -9
- data/spec/support/orm/active_record.rb +3 -1
- data/spec/support/shared/controllers_shared_context.rb +68 -10
- data/spec/support/shared/hashing_shared_context.rb +36 -0
- data/spec/support/shared/models_shared_examples.rb +12 -10
- data/spec/validators/redirect_uri_validator_spec.rb +76 -47
- data/spec/version/version_spec.rb +7 -5
- metadata +70 -21
- data/gemfiles/rails_4_2.gemfile +0 -13
- data/spec/dummy/config/initializers/new_framework_defaults.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d8ea67fd14f902f63a276aed1f57a134c39fa02322d4b1f114571e2a90310ead
|
|
4
|
+
data.tar.gz: 44f9f0b886117c6dabe6a09c236107ba6b8c3469b40526a4f6c10f2e4b3e8eac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2aa8f4fbe445a84f98035e8ebeb99e715860fb7d29637d8e6cca994bf18a9ba7c051d38fda66829a5dd260f93ee74ff9f6f6d863e610203fa690da7b698b7da1
|
|
7
|
+
data.tar.gz: 5d474565c95e341b7b4773a7c1e2a782fa1bc27c4f22874428db52ceb4df10ccbb342420ba5266ba0d779380d42df3576f56449d390ecbf795e4deee50bdaff4
|
data/.hound.yml
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
+
TargetRubyVersion: 2.4
|
|
2
3
|
Exclude:
|
|
3
4
|
- "spec/dummy/db/*"
|
|
5
|
+
- "spec/dummy/config/*"
|
|
6
|
+
- "Dangerfile"
|
|
7
|
+
- "gemfiles/*.gemfile"
|
|
4
8
|
|
|
5
9
|
Metrics/BlockLength:
|
|
6
10
|
Exclude:
|
|
7
11
|
- spec/**/*
|
|
12
|
+
- lib/doorkeeper/rake/*
|
|
8
13
|
|
|
9
|
-
LineLength:
|
|
14
|
+
Metrics/LineLength:
|
|
10
15
|
Exclude:
|
|
11
16
|
- spec/**/*
|
|
17
|
+
Max: 100
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
Metrics/MethodLength:
|
|
20
|
+
Exclude:
|
|
21
|
+
- spec/dummy/db/*
|
|
22
|
+
|
|
23
|
+
Style/StringLiterals:
|
|
24
|
+
EnforcedStyle: double_quotes
|
|
25
|
+
Style/StringLiteralsInInterpolation:
|
|
26
|
+
EnforcedStyle: double_quotes
|
|
27
|
+
|
|
28
|
+
Style/FrozenStringLiteralComment:
|
|
29
|
+
Enabled: true
|
|
30
|
+
|
|
31
|
+
Style/TrailingCommaInHashLiteral:
|
|
32
|
+
EnforcedStyleForMultiline: consistent_comma
|
|
33
|
+
Style/TrailingCommaInArrayLiteral:
|
|
34
|
+
EnforcedStyleForMultiline: consistent_comma
|
|
35
|
+
|
|
36
|
+
Style/SymbolArray:
|
|
37
|
+
MinSize: 3
|
|
38
|
+
Style/WordArray:
|
|
39
|
+
MinSize: 3
|
|
40
|
+
|
|
41
|
+
Style/ClassAndModuleChildren:
|
|
42
|
+
Exclude:
|
|
43
|
+
- spec/**/*
|
|
15
44
|
|
|
16
|
-
|
|
45
|
+
Layout/MultilineMethodCallIndentation:
|
|
46
|
+
EnforcedStyle: indented
|
|
47
|
+
Layout/TrailingBlankLines:
|
|
17
48
|
Enabled: true
|
|
49
|
+
Layout/DotPosition:
|
|
50
|
+
EnforcedStyle: leading
|
data/.travis.yml
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
cache: bundler
|
|
2
1
|
language: ruby
|
|
3
|
-
|
|
2
|
+
cache: bundler
|
|
4
3
|
|
|
5
4
|
rvm:
|
|
6
|
-
- 2.1
|
|
7
|
-
- 2.2
|
|
8
|
-
- 2.3
|
|
9
5
|
- 2.4
|
|
10
6
|
- 2.5
|
|
11
|
-
-
|
|
7
|
+
- 2.6
|
|
8
|
+
- ruby-head
|
|
12
9
|
|
|
13
|
-
before_install:
|
|
14
|
-
- gem update --system
|
|
15
|
-
- gem install bundler
|
|
10
|
+
#before_install:
|
|
11
|
+
# - gem update --system
|
|
12
|
+
# - gem install bundler
|
|
16
13
|
|
|
17
14
|
gemfile:
|
|
18
|
-
- gemfiles/rails_4_2.gemfile
|
|
19
15
|
- gemfiles/rails_5_0.gemfile
|
|
20
16
|
- gemfiles/rails_5_1.gemfile
|
|
21
17
|
- gemfiles/rails_5_2.gemfile
|
|
18
|
+
- gemfiles/rails_6_0.gemfile
|
|
22
19
|
- gemfiles/rails_master.gemfile
|
|
23
20
|
|
|
24
21
|
matrix:
|
|
25
22
|
fast_finish: true
|
|
23
|
+
# Run Danger only once
|
|
24
|
+
include:
|
|
25
|
+
- rvm: 2.5
|
|
26
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
|
27
|
+
script: bundle exec danger
|
|
26
28
|
exclude:
|
|
27
|
-
- gemfile: gemfiles/
|
|
28
|
-
rvm: 2.
|
|
29
|
-
- gemfile: gemfiles/rails_5_1.gemfile
|
|
30
|
-
rvm: 2.1
|
|
31
|
-
- gemfile: gemfiles/rails_5_2.gemfile
|
|
32
|
-
rvm: 2.1
|
|
33
|
-
- gemfile: gemfiles/rails_master.gemfile
|
|
34
|
-
rvm: 2.1
|
|
35
|
-
- gemfile: gemfiles/rails_master.gemfile
|
|
36
|
-
rvm: 2.2
|
|
29
|
+
- gemfile: gemfiles/rails_6_0.gemfile
|
|
30
|
+
rvm: 2.4
|
|
37
31
|
- gemfile: gemfiles/rails_master.gemfile
|
|
38
|
-
rvm: 2.
|
|
32
|
+
rvm: 2.4
|
|
39
33
|
allow_failures:
|
|
40
34
|
- gemfile: gemfiles/rails_master.gemfile
|
|
35
|
+
- rvm: ruby-head
|
data/Appraisals
CHANGED
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
gem "rails", "~> 4.2.0"
|
|
3
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
4
2
|
|
|
5
3
|
appraise "rails-5-0" do
|
|
6
4
|
gem "rails", "~> 5.0.0"
|
|
7
|
-
gem "
|
|
5
|
+
gem "sqlite3", "~> 1.3", "< 1.4", platform: %i[ruby mswin mingw x64_mingw]
|
|
8
6
|
end
|
|
9
7
|
|
|
10
8
|
appraise "rails-5-1" do
|
|
11
9
|
gem "rails", "~> 5.1.0"
|
|
12
|
-
gem "
|
|
10
|
+
gem "sqlite3", "~> 1.3", "< 1.4", platform: %i[ruby mswin mingw x64_mingw]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
appraise "rails-5-2" do
|
|
14
|
+
gem "rails", "~> 5.2.0"
|
|
15
|
+
gem "sqlite3", "~> 1.3", "< 1.4", platform: %i[ruby mswin mingw x64_mingw]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
appraise "rails-6-0" do
|
|
19
|
+
gem "rails", "~> 6.0.0.beta3"
|
|
20
|
+
gem "sqlite3", "~> 1.4", platform: %i[ruby mswin mingw x64_mingw]
|
|
21
|
+
|
|
22
|
+
# TODO: Remove when rspec-rails 4.0 released
|
|
23
|
+
gem "rspec-core", github: "rspec/rspec-core"
|
|
24
|
+
gem "rspec-expectations", github: "rspec/rspec-expectations"
|
|
25
|
+
gem "rspec-mocks", github: "rspec/rspec-mocks"
|
|
26
|
+
gem "rspec-rails", github: "rspec/rspec-rails", branch: "4-0-dev"
|
|
27
|
+
gem "rspec-support", github: "rspec/rspec-support"
|
|
13
28
|
end
|
|
14
29
|
|
|
15
30
|
appraise "rails-master" do
|
|
16
|
-
gem "rails", git:
|
|
17
|
-
gem "
|
|
31
|
+
gem "rails", git: "https://github.com/rails/rails"
|
|
32
|
+
gem "sqlite3", "~> 1.4", platform: %i[ruby mswin mingw x64_mingw]
|
|
33
|
+
|
|
34
|
+
# TODO: Remove when rspec-rails 4.0 released
|
|
35
|
+
gem "rspec-core", github: "rspec/rspec-core"
|
|
36
|
+
gem "rspec-expectations", github: "rspec/rspec-expectations"
|
|
37
|
+
gem "rspec-mocks", github: "rspec/rspec-mocks"
|
|
38
|
+
gem "rspec-rails", github: "rspec/rspec-rails", branch: "4-0-dev"
|
|
39
|
+
gem "rspec-support", github: "rspec/rspec-support"
|
|
18
40
|
end
|
data/Dangerfile
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
CHANGELOG_FILE = 'NEWS.md'
|
|
2
|
+
GITHUB_REPO = 'https://github.com/doorkeeper-gem/doorkeeper'
|
|
3
|
+
|
|
4
|
+
def changelog_changed?
|
|
5
|
+
git.modified_files.include?(CHANGELOG_FILE) || git.added_files.include?(CHANGELOG_FILE)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def changelog_entry_example
|
|
9
|
+
pr_number = github.pr_json['number']
|
|
10
|
+
pr_title = github.pr_title
|
|
11
|
+
.sub(/[?.!,;]?$/, '')
|
|
12
|
+
.capitalize
|
|
13
|
+
|
|
14
|
+
"- [##{pr_number}]: #{pr_title}."
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
18
|
+
# Has any changes happened inside the actual library code?
|
|
19
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
20
|
+
has_app_changes = !git.modified_files.grep(/lib|app/).empty?
|
|
21
|
+
has_spec_changes = !git.modified_files.grep(/spec/).empty?
|
|
22
|
+
|
|
23
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
24
|
+
# You've made changes to lib, but didn't write any tests?
|
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
26
|
+
if has_app_changes && !has_spec_changes
|
|
27
|
+
warn("There're library changes, but not tests. That's OK as long as you're refactoring existing code.", sticky: false)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
31
|
+
# You've made changes to specs, but no library code has changed?
|
|
32
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
33
|
+
if !has_app_changes && has_spec_changes
|
|
34
|
+
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)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Mainly to encourage writing up some reasoning about the PR, rather than
|
|
38
|
+
# just leaving a title
|
|
39
|
+
if github.pr_body.length < 10
|
|
40
|
+
fail "Please provide a summary in the Pull Request description"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
44
|
+
# Have you updated CHANGELOG.md?
|
|
45
|
+
# --------------------------------------------------------------------------------------------------------------------
|
|
46
|
+
# Add a CHANGELOG entry for app changes
|
|
47
|
+
if has_app_changes && !changelog_changed?
|
|
48
|
+
markdown <<-MARKDOWN
|
|
49
|
+
Here's an example of a #{CHANGELOG_FILE} entry:
|
|
50
|
+
```markdown
|
|
51
|
+
#{changelog_entry_example}
|
|
52
|
+
```
|
|
53
|
+
MARKDOWN
|
|
54
|
+
|
|
55
|
+
warn(
|
|
56
|
+
"Please include a changelog entry. \nYou can find it at [#{CHANGELOG_FILE}](#{GITHUB_REPO}/blob/master/#{CHANGELOG_FILE})." +
|
|
57
|
+
"You can skip this warning only if you made some typo fix or other small changes that didn't affect the API."
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if git.commits.any? { |commit| commit.message =~ /^Merge branch '#{github.branch_for_base}'/ }
|
|
62
|
+
warn('Please rebase to get rid of the merge commits in this PR')
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
if git.commits.length > 1
|
|
66
|
+
warn('Please squash all your commits to a single one')
|
|
67
|
+
end
|
data/Gemfile
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
source "https://rubygems.org"
|
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
|
+
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
gem "rails", "~> 6.0.0.beta3"
|
|
2
9
|
|
|
3
|
-
|
|
10
|
+
# TODO: Remove when rspec-rails 4.0 released
|
|
11
|
+
gem "rspec-core", github: "rspec/rspec-core"
|
|
12
|
+
gem "rspec-expectations", github: "rspec/rspec-expectations"
|
|
13
|
+
gem "rspec-mocks", github: "rspec/rspec-mocks"
|
|
14
|
+
gem "rspec-rails", github: "rspec/rspec-rails", branch: "4-0-dev"
|
|
15
|
+
gem "rspec-support", github: "rspec/rspec-support"
|
|
4
16
|
|
|
5
|
-
gem "
|
|
17
|
+
gem "rubocop", "~> 0.66"
|
|
18
|
+
|
|
19
|
+
gem "bcrypt", "~> 3.1", require: false
|
|
6
20
|
|
|
7
21
|
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
|
8
|
-
gem "sqlite3", platform: [
|
|
9
|
-
|
|
10
|
-
|
|
22
|
+
gem "sqlite3", "~> 1.4", platform: %i[ruby mswin mingw x64_mingw]
|
|
23
|
+
|
|
24
|
+
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw]
|
data/NEWS.md
CHANGED
|
@@ -7,7 +7,83 @@ User-visible changes worth mentioning.
|
|
|
7
7
|
|
|
8
8
|
## master
|
|
9
9
|
|
|
10
|
-
- [#PR
|
|
10
|
+
- [#PR] Add your PR description here.
|
|
11
|
+
|
|
12
|
+
## 5.1.0
|
|
13
|
+
|
|
14
|
+
- [#1243]: Add nil check operator in token checking at token introspection.
|
|
15
|
+
- [#1241] Explaining foreign key options for resource owner in a single place
|
|
16
|
+
- [#1237] Allow to set blank redirect URI if Doorkeeper configured to use redirect URI-less grant flows.
|
|
17
|
+
- [#1234] Fix `StaleRecordsCleaner` to properly work with big amount of records.
|
|
18
|
+
- [#1228] Allow to explicitly set non-expiring tokens in `custom_access_token_expires_in` configuration
|
|
19
|
+
option using `Float::INIFINITY` return value.
|
|
20
|
+
- [#1224] Do not try to store token if not found by fallback hashing strategy.
|
|
21
|
+
- [#1223] Update Hound/Rubocop rules, correct Doorkeeper codebase to follow style-guides.
|
|
22
|
+
- [#1220] Drop Rails 4.2 & Ruby < 2.4 support.
|
|
23
|
+
|
|
24
|
+
## 5.1.0.rc2
|
|
25
|
+
|
|
26
|
+
- [#1208] Unify hashing implementation into secret storing strategies
|
|
27
|
+
|
|
28
|
+
**[IMPORTANT]**: If you have been using the master branch of doorkeeper with bcrypt in your Gemfile.lock,
|
|
29
|
+
your application secrets have been hashed using BCrypt. To restore this behavior, use the initializer option
|
|
30
|
+
`use_application_hashing using: 'Doorkeeper::SecretStoring::BCrypt`.
|
|
31
|
+
|
|
32
|
+
- [#1216] Add nil check to `expires_at` method.
|
|
33
|
+
- [#1215] Fix deprecates for Rails 6.
|
|
34
|
+
- [#1214] Scopes field accepts array.
|
|
35
|
+
- [#1209] Fix tokens validation for Token Introspection request.
|
|
36
|
+
- [#1202] Use correct HTTP status codes for error responses.
|
|
37
|
+
|
|
38
|
+
**[IMPORTANT]**: this change might break your application if you were relying on the previous
|
|
39
|
+
401 status codes, this is now a 400 by default, or a 401 for `invalid_client` and `invalid_token` errors.
|
|
40
|
+
|
|
41
|
+
- [#1201] Fix custom TTL block `client` parameter to always be an `Doorkeeper::Application` instance.
|
|
42
|
+
|
|
43
|
+
**[IMPORTANT]**: those who defined `custom_access_token_expires_in` configuration option need to check
|
|
44
|
+
their block implementation: if you are using `oauth_client.application` to get `Doorkeeper::Application`
|
|
45
|
+
instance, then you need to replace it with just `oauth_client`.
|
|
46
|
+
|
|
47
|
+
- [#1200] Increase default Doorkeeper access token value complexity (`urlsafe_base64` instead of just `hex`)
|
|
48
|
+
matching RFC6749/RFC6750.
|
|
49
|
+
|
|
50
|
+
**[IMPORTANT]**: this change have possible side-effects in case you have custom database constraints for
|
|
51
|
+
access token value, application secrets, refresh tokens or you patched Doorkeeper models and introduced
|
|
52
|
+
token value validations, or you are using database with case-insensitive WHERE clause like MySQL
|
|
53
|
+
(you can face some collisions). Before this change access token value matched `[a-f0-9]` regex, and now
|
|
54
|
+
it matches `[a-zA-Z0-9\-_]`. In case you have such restrictions and your don't use custom token generator
|
|
55
|
+
please change configuration option `default_generator_method ` to `:hex`.
|
|
56
|
+
|
|
57
|
+
- [#1195] Allow to customize Token Introspection response (fixes #1194).
|
|
58
|
+
- [#1189] Option to set `token_reuse_limit`.
|
|
59
|
+
- [#1191] Try to load bcrypt for hashing of application secrets, but add fallback.
|
|
60
|
+
|
|
61
|
+
## 5.1.0.rc1
|
|
62
|
+
|
|
63
|
+
- [#1188] Use `params` instead of `request.POST` in tokens controller (fixes #1183).
|
|
64
|
+
- [#1182] Fix loopback IP redirect URIs to conform with RFC8252, p. 7.3 (fixes #1170).
|
|
65
|
+
- [#1179] Authorization Code Grant Flow without client id returns invalid_client error.
|
|
66
|
+
- [#1177] Allow to limit `scopes` for certain `grant_types`
|
|
67
|
+
- [#1176] Fix test factory support for `factory_bot_rails`
|
|
68
|
+
- [#1175] Internal refactor: use `scopes_string` inside `scopes`.
|
|
69
|
+
- [#1168] Allow optional hashing of tokens and secrets.
|
|
70
|
+
- [#1164] Fix error when `root_path` is not defined.
|
|
71
|
+
- [#1162] Fix `enforce_content_type` for requests without body.
|
|
72
|
+
|
|
73
|
+
## 5.0.2
|
|
74
|
+
|
|
75
|
+
- [#1158] Fix initializer template: change `handle_auth_errors` option
|
|
76
|
+
- [#1157] Remove redundant index from migration template.
|
|
77
|
+
|
|
78
|
+
## 5.0.1
|
|
79
|
+
|
|
80
|
+
- [#1154] Refactor `StaleRecordsCleaner` to be ORM agnostic.
|
|
81
|
+
- [#1152] Fix migration template: change resource owner data type from integer to Rails generic `references`
|
|
82
|
+
- [#1151] Fix Refresh Token strategy: add proper validation of client credentials both for Public & Private clients.
|
|
83
|
+
- [#1149] Fix for `URIChecker#valid_for_authorization?` false negative when query is blank, but `?` present.
|
|
84
|
+
- [#1140] Allow rendering custom errors from exceptions (issue #844). Originally opened as [#944].
|
|
85
|
+
- [#1138] Revert regression bug (check for token expiration in Authorizations controller so authorization
|
|
86
|
+
triggers every time)
|
|
11
87
|
|
|
12
88
|
## 5.0.0
|
|
13
89
|
|
|
@@ -15,14 +91,14 @@ User-visible changes worth mentioning.
|
|
|
15
91
|
|
|
16
92
|
## 5.0.0.rc2
|
|
17
93
|
|
|
18
|
-
- [#
|
|
19
|
-
|
|
20
|
-
- [#1108] Simple formating of callback URLs when listing oauth applications
|
|
94
|
+
- [#1122] Fix AuthorizationsController#new error response to be in JSON format
|
|
95
|
+
- [#1119] Fix token revocation for OAuth apps using "implicit" grant flow
|
|
21
96
|
- [#1116] `AccessGrant`s will now be revoked along with `AccessToken`s when
|
|
22
97
|
hitting the `AuthorizedApplicationController#destroy` route.
|
|
23
98
|
- [#1114] Make token info endpoint's attributes consistent with token creation
|
|
24
|
-
- [#
|
|
25
|
-
- [#
|
|
99
|
+
- [#1108] Simple formating of callback URLs when listing oauth applications
|
|
100
|
+
- [#1106] Restrict access to AdminController with 'Forbidden 403' if admin_authenticator is not
|
|
101
|
+
configured by developers.
|
|
26
102
|
|
|
27
103
|
## 5.0.0.rc1
|
|
28
104
|
|
|
@@ -43,6 +119,12 @@ User-visible changes worth mentioning.
|
|
|
43
119
|
`Doorkeeper#installed?` method
|
|
44
120
|
- [#1031] Allow public clients to authenticate without `client_secret`. Define an app as
|
|
45
121
|
either public or private/confidential
|
|
122
|
+
|
|
123
|
+
**[IMPORTANT]**: all the applications (clients) now are considered as private by default.
|
|
124
|
+
You need to manually change `confidential` column to `false` if you are using public clients,
|
|
125
|
+
in other case your mobile (or other) applications will not be able to authorize.
|
|
126
|
+
See [#1142](https://github.com/doorkeeper-gem/doorkeeper/issues/1142) for more details.
|
|
127
|
+
|
|
46
128
|
- [#1010] Add configuration to enforce configured scopes (`default_scopes` and
|
|
47
129
|
`optional_scopes`) for applications
|
|
48
130
|
- [#1060] Ensure that the native redirect_uri parameter matches with redirect_uri of the client
|
|
@@ -60,20 +142,31 @@ User-visible changes worth mentioning.
|
|
|
60
142
|
- [#1076] Add config to enforce content type to application/x-www-form-urlencoded
|
|
61
143
|
- Fix bug with `force_ssl_in_redirect_uri` when it breaks existing applications with an
|
|
62
144
|
SSL redirect_uri.
|
|
63
|
-
|
|
145
|
+
|
|
146
|
+
## 4.4.3
|
|
147
|
+
|
|
148
|
+
- [#1143] Adds a config option `opt_out_native_route_change` to opt out of the breaking api
|
|
149
|
+
changed introduced in https://github.com/doorkeeper-gem/doorkeeper/pull/1003
|
|
150
|
+
|
|
151
|
+
|
|
64
152
|
## 4.4.2
|
|
65
153
|
|
|
66
154
|
- [#1130] Backport fix for native redirect_uri from 5.x.
|
|
67
|
-
|
|
155
|
+
|
|
68
156
|
## 4.4.1
|
|
69
157
|
|
|
70
158
|
- [#1127] Backport token type to comply with the RFC6750 specification.
|
|
71
159
|
- [#1125] Backport Quote surround I18n yes/no keys
|
|
72
|
-
|
|
160
|
+
|
|
73
161
|
## 4.4.0
|
|
74
|
-
|
|
162
|
+
|
|
75
163
|
- [#1120] Backport security fix from 5.x for token revocation when using public clients
|
|
76
164
|
|
|
165
|
+
**[IMPORTANT]**: all the applications (clients) now are considered as private by default.
|
|
166
|
+
You need to manually change `confidential` column to `false` if you are using public clients,
|
|
167
|
+
in other case your mobile (or other) applications will not be able to authorize.
|
|
168
|
+
See [#1142](https://github.com/doorkeeper-gem/doorkeeper/issues/1142) for more details.
|
|
169
|
+
|
|
77
170
|
## 4.3.2
|
|
78
171
|
|
|
79
172
|
- [#1053] Support authorizing with query params in the request `redirect_uri` if explicitly present in app's `Application#redirect_uri`
|
|
@@ -101,6 +194,10 @@ User-visible changes worth mentioning.
|
|
|
101
194
|
- [#985] Generate valid migration files for Rails >= 5
|
|
102
195
|
- [#972] Replace Struct subclassing with block-form initialization
|
|
103
196
|
- [#1003] Use URL query param to pass through native redirect auth code so automated apps can find it.
|
|
197
|
+
|
|
198
|
+
**[IMPORTANT]**: Previously authorization code response route was `/oauth/authorize/<code>`,
|
|
199
|
+
now it is `oauth/authorize/native?code=<code>` (in order to help applications to automatically find the code value).
|
|
200
|
+
|
|
104
201
|
- [#868] `Scopes#&` and `Scopes#+` now take an array or any other enumerable
|
|
105
202
|
object.
|
|
106
203
|
- [#1019] Remove translation not in use: `invalid_resource_owner`.
|