doorkeeper 4.2.5 → 5.0.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.
Files changed (215) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +25 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +17 -0
  4. data/.gitignore +2 -1
  5. data/.gitlab-ci.yml +16 -0
  6. data/.hound.yml +2 -13
  7. data/.rubocop.yml +17 -0
  8. data/.travis.yml +19 -4
  9. data/Appraisals +8 -4
  10. data/CODE_OF_CONDUCT.md +46 -0
  11. data/Gemfile +1 -1
  12. data/NEWS.md +115 -0
  13. data/README.md +175 -39
  14. data/RELEASING.md +5 -12
  15. data/Rakefile +6 -0
  16. data/SECURITY.md +15 -0
  17. data/UPGRADE.md +2 -0
  18. data/app/assets/stylesheets/doorkeeper/admin/application.css +2 -2
  19. data/app/controllers/doorkeeper/application_controller.rb +2 -5
  20. data/app/controllers/doorkeeper/application_metal_controller.rb +4 -0
  21. data/app/controllers/doorkeeper/applications_controller.rb +47 -13
  22. data/app/controllers/doorkeeper/authorizations_controller.rb +55 -12
  23. data/app/controllers/doorkeeper/authorized_applications_controller.rb +19 -2
  24. data/app/controllers/doorkeeper/tokens_controller.rb +24 -17
  25. data/app/helpers/doorkeeper/dashboard_helper.rb +8 -6
  26. data/app/validators/redirect_uri_validator.rb +13 -2
  27. data/app/views/doorkeeper/applications/_delete_form.html.erb +3 -1
  28. data/app/views/doorkeeper/applications/_form.html.erb +31 -19
  29. data/app/views/doorkeeper/applications/edit.html.erb +1 -1
  30. data/app/views/doorkeeper/applications/index.html.erb +18 -6
  31. data/app/views/doorkeeper/applications/new.html.erb +1 -1
  32. data/app/views/doorkeeper/applications/show.html.erb +8 -5
  33. data/app/views/doorkeeper/authorizations/error.html.erb +1 -1
  34. data/app/views/doorkeeper/authorizations/new.html.erb +5 -1
  35. data/app/views/doorkeeper/authorized_applications/index.html.erb +0 -1
  36. data/app/views/layouts/doorkeeper/admin.html.erb +15 -15
  37. data/config/locales/en.yml +19 -6
  38. data/doorkeeper.gemspec +20 -20
  39. data/gemfiles/rails_4_2.gemfile +6 -4
  40. data/gemfiles/rails_5_0.gemfile +4 -4
  41. data/gemfiles/rails_5_1.gemfile +6 -7
  42. data/gemfiles/rails_5_2.gemfile +12 -0
  43. data/gemfiles/rails_master.gemfile +17 -0
  44. data/lib/doorkeeper/config.rb +123 -71
  45. data/lib/doorkeeper/engine.rb +7 -3
  46. data/lib/doorkeeper/errors.rb +20 -5
  47. data/lib/doorkeeper/grape/helpers.rb +14 -9
  48. data/lib/doorkeeper/helpers/controller.rb +16 -22
  49. data/lib/doorkeeper/models/access_grant_mixin.rb +67 -23
  50. data/lib/doorkeeper/models/access_token_mixin.rb +54 -55
  51. data/lib/doorkeeper/models/application_mixin.rb +16 -30
  52. data/lib/doorkeeper/models/concerns/expirable.rb +7 -5
  53. data/lib/doorkeeper/models/concerns/orderable.rb +13 -0
  54. data/lib/doorkeeper/models/concerns/scopes.rb +1 -1
  55. data/lib/doorkeeper/oauth/authorization/code.rb +31 -8
  56. data/lib/doorkeeper/oauth/authorization/context.rb +15 -0
  57. data/lib/doorkeeper/oauth/authorization/token.rb +46 -20
  58. data/lib/doorkeeper/oauth/authorization_code_request.rb +33 -3
  59. data/lib/doorkeeper/oauth/base_request.rb +23 -7
  60. data/lib/doorkeeper/oauth/client/credentials.rb +6 -4
  61. data/lib/doorkeeper/oauth/client.rb +2 -4
  62. data/lib/doorkeeper/oauth/client_credentials/creator.rb +2 -1
  63. data/lib/doorkeeper/oauth/client_credentials/issuer.rb +6 -3
  64. data/lib/doorkeeper/oauth/client_credentials/validation.rb +4 -6
  65. data/lib/doorkeeper/oauth/client_credentials_request.rb +0 -4
  66. data/lib/doorkeeper/oauth/error.rb +2 -2
  67. data/lib/doorkeeper/oauth/error_response.rb +11 -4
  68. data/lib/doorkeeper/oauth/forbidden_token_response.rb +1 -1
  69. data/lib/doorkeeper/oauth/helpers/scope_checker.rb +0 -8
  70. data/lib/doorkeeper/oauth/helpers/uri_checker.rb +15 -0
  71. data/lib/doorkeeper/oauth/invalid_token_response.rb +3 -4
  72. data/lib/doorkeeper/oauth/password_access_token_request.rb +8 -4
  73. data/lib/doorkeeper/oauth/pre_authorization.rb +45 -13
  74. data/lib/doorkeeper/oauth/refresh_token_request.rb +7 -1
  75. data/lib/doorkeeper/oauth/scopes.rb +19 -9
  76. data/lib/doorkeeper/oauth/token.rb +6 -3
  77. data/lib/doorkeeper/oauth/token_introspection.rb +128 -0
  78. data/lib/doorkeeper/oauth/token_response.rb +4 -2
  79. data/lib/doorkeeper/oauth.rb +13 -0
  80. data/lib/doorkeeper/orm/active_record/access_grant.rb +27 -0
  81. data/lib/doorkeeper/orm/active_record/access_token.rb +21 -20
  82. data/lib/doorkeeper/orm/active_record/application.rb +45 -0
  83. data/lib/doorkeeper/orm/active_record/stale_records_cleaner.rb +26 -0
  84. data/lib/doorkeeper/orm/active_record.rb +21 -8
  85. data/lib/doorkeeper/rails/helpers.rb +7 -10
  86. data/lib/doorkeeper/rails/routes.rb +21 -7
  87. data/lib/doorkeeper/rake/db.rake +40 -0
  88. data/lib/doorkeeper/rake/setup.rake +6 -0
  89. data/lib/doorkeeper/rake.rb +14 -0
  90. data/lib/doorkeeper/request/authorization_code.rb +0 -2
  91. data/lib/doorkeeper/request/client_credentials.rb +0 -2
  92. data/lib/doorkeeper/request/code.rb +0 -2
  93. data/lib/doorkeeper/request/password.rb +1 -13
  94. data/lib/doorkeeper/request/refresh_token.rb +0 -2
  95. data/lib/doorkeeper/request/token.rb +0 -2
  96. data/lib/doorkeeper/request.rb +29 -30
  97. data/lib/doorkeeper/validations.rb +3 -2
  98. data/lib/doorkeeper/version.rb +14 -1
  99. data/lib/doorkeeper.rb +21 -17
  100. data/lib/generators/doorkeeper/application_owner_generator.rb +26 -12
  101. data/lib/generators/doorkeeper/confidential_applications_generator.rb +32 -0
  102. data/lib/generators/doorkeeper/install_generator.rb +17 -9
  103. data/lib/generators/doorkeeper/migration_generator.rb +26 -9
  104. data/lib/generators/doorkeeper/pkce_generator.rb +32 -0
  105. data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +31 -20
  106. data/lib/generators/doorkeeper/templates/add_confidential_to_applications.rb.erb +13 -0
  107. data/lib/generators/doorkeeper/templates/{add_owner_to_application_migration.rb → add_owner_to_application_migration.rb.erb} +1 -1
  108. data/lib/generators/doorkeeper/templates/{add_previous_refresh_token_to_access_tokens.rb → add_previous_refresh_token_to_access_tokens.rb.erb} +1 -1
  109. data/lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb +6 -0
  110. data/lib/generators/doorkeeper/templates/initializer.rb +104 -12
  111. data/lib/generators/doorkeeper/templates/{migration.rb → migration.rb.erb} +2 -1
  112. data/lib/generators/doorkeeper/views_generator.rb +3 -1
  113. data/spec/controllers/application_metal_controller_spec.rb +50 -0
  114. data/spec/controllers/applications_controller_spec.rb +141 -17
  115. data/spec/controllers/authorizations_controller_spec.rb +304 -27
  116. data/spec/controllers/protected_resources_controller_spec.rb +44 -35
  117. data/spec/controllers/token_info_controller_spec.rb +17 -21
  118. data/spec/controllers/tokens_controller_spec.rb +201 -17
  119. data/spec/dummy/app/assets/config/manifest.js +2 -0
  120. data/spec/dummy/config/environments/test.rb +4 -5
  121. data/spec/dummy/config/initializers/doorkeeper.rb +23 -2
  122. data/spec/dummy/config/initializers/{active_record_belongs_to_required_by_default.rb → new_framework_defaults.rb} +5 -1
  123. data/spec/dummy/config/initializers/secret_token.rb +0 -1
  124. data/spec/dummy/config/routes.rb +3 -42
  125. data/spec/dummy/db/migrate/20111122132257_create_users.rb +3 -1
  126. data/spec/dummy/db/migrate/20120312140401_add_password_to_users.rb +3 -1
  127. data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +3 -1
  128. data/spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb +3 -1
  129. data/spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb +3 -1
  130. data/spec/dummy/db/migrate/20170822064514_enable_pkce.rb +6 -0
  131. data/spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb +13 -0
  132. data/spec/dummy/db/schema.rb +38 -37
  133. data/spec/factories.rb +1 -1
  134. data/spec/generators/application_owner_generator_spec.rb +25 -6
  135. data/spec/generators/confidential_applications_generator_spec.rb +45 -0
  136. data/spec/generators/install_generator_spec.rb +1 -1
  137. data/spec/generators/migration_generator_spec.rb +25 -4
  138. data/spec/generators/pkce_generator_spec.rb +43 -0
  139. data/spec/generators/previous_refresh_token_generator_spec.rb +57 -0
  140. data/spec/generators/views_generator_spec.rb +1 -1
  141. data/spec/grape/grape_integration_spec.rb +135 -0
  142. data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +2 -2
  143. data/spec/lib/config_spec.rb +199 -22
  144. data/spec/lib/doorkeeper_spec.rb +1 -126
  145. data/spec/lib/models/expirable_spec.rb +0 -4
  146. data/spec/lib/models/revocable_spec.rb +2 -4
  147. data/spec/lib/models/scopes_spec.rb +0 -4
  148. data/spec/lib/oauth/authorization/uri_builder_spec.rb +0 -4
  149. data/spec/lib/oauth/authorization_code_request_spec.rb +63 -13
  150. data/spec/lib/oauth/base_request_spec.rb +43 -10
  151. data/spec/lib/oauth/base_response_spec.rb +1 -1
  152. data/spec/lib/oauth/client/credentials_spec.rb +5 -5
  153. data/spec/lib/oauth/client_credentials/creator_spec.rb +6 -2
  154. data/spec/lib/oauth/client_credentials/issuer_spec.rb +26 -7
  155. data/spec/lib/oauth/client_credentials/validation_spec.rb +2 -3
  156. data/spec/lib/oauth/client_credentials_integration_spec.rb +2 -2
  157. data/spec/lib/oauth/client_credentials_request_spec.rb +4 -5
  158. data/spec/lib/oauth/client_spec.rb +0 -3
  159. data/spec/lib/oauth/code_request_spec.rb +5 -5
  160. data/spec/lib/oauth/error_response_spec.rb +0 -3
  161. data/spec/lib/oauth/error_spec.rb +1 -3
  162. data/spec/lib/oauth/forbidden_token_response_spec.rb +1 -4
  163. data/spec/lib/oauth/helpers/scope_checker_spec.rb +0 -3
  164. data/spec/lib/oauth/helpers/unique_token_spec.rb +0 -1
  165. data/spec/lib/oauth/helpers/uri_checker_spec.rb +115 -3
  166. data/spec/lib/oauth/invalid_token_response_spec.rb +2 -5
  167. data/spec/lib/oauth/password_access_token_request_spec.rb +46 -5
  168. data/spec/lib/oauth/pre_authorization_spec.rb +40 -6
  169. data/spec/lib/oauth/refresh_token_request_spec.rb +30 -14
  170. data/spec/lib/oauth/scopes_spec.rb +28 -4
  171. data/spec/lib/oauth/token_request_spec.rb +10 -13
  172. data/spec/lib/oauth/token_response_spec.rb +0 -1
  173. data/spec/lib/oauth/token_spec.rb +37 -14
  174. data/spec/lib/orm/active_record/stale_records_cleaner_spec.rb +79 -0
  175. data/spec/lib/request/strategy_spec.rb +0 -1
  176. data/spec/lib/server_spec.rb +10 -0
  177. data/spec/models/doorkeeper/access_grant_spec.rb +45 -2
  178. data/spec/models/doorkeeper/access_token_spec.rb +132 -64
  179. data/spec/models/doorkeeper/application_spec.rb +114 -23
  180. data/spec/requests/applications/applications_request_spec.rb +139 -6
  181. data/spec/requests/applications/authorized_applications_spec.rb +1 -1
  182. data/spec/requests/endpoints/authorization_spec.rb +1 -1
  183. data/spec/requests/endpoints/token_spec.rb +15 -6
  184. data/spec/requests/flows/authorization_code_errors_spec.rb +12 -2
  185. data/spec/requests/flows/authorization_code_spec.rb +199 -2
  186. data/spec/requests/flows/client_credentials_spec.rb +73 -5
  187. data/spec/requests/flows/implicit_grant_errors_spec.rb +3 -3
  188. data/spec/requests/flows/implicit_grant_spec.rb +38 -11
  189. data/spec/requests/flows/password_spec.rb +160 -24
  190. data/spec/requests/flows/refresh_token_spec.rb +6 -6
  191. data/spec/requests/flows/revoke_token_spec.rb +26 -26
  192. data/spec/requests/flows/skip_authorization_spec.rb +16 -11
  193. data/spec/requests/protected_resources/metal_spec.rb +2 -2
  194. data/spec/requests/protected_resources/private_api_spec.rb +2 -2
  195. data/spec/routing/custom_controller_routes_spec.rb +63 -7
  196. data/spec/routing/default_routes_spec.rb +6 -2
  197. data/spec/routing/scoped_routes_spec.rb +16 -2
  198. data/spec/spec_helper.rb +54 -3
  199. data/spec/spec_helper_integration.rb +2 -64
  200. data/spec/support/dependencies/factory_bot.rb +2 -0
  201. data/spec/support/doorkeeper_rspec.rb +19 -0
  202. data/spec/support/helpers/access_token_request_helper.rb +1 -1
  203. data/spec/support/helpers/authorization_request_helper.rb +4 -4
  204. data/spec/support/helpers/model_helper.rb +9 -4
  205. data/spec/support/helpers/request_spec_helper.rb +18 -6
  206. data/spec/support/helpers/url_helper.rb +15 -10
  207. data/spec/support/http_method_shim.rb +12 -16
  208. data/spec/support/shared/controllers_shared_context.rb +2 -6
  209. data/spec/support/shared/models_shared_examples.rb +4 -4
  210. data/spec/validators/redirect_uri_validator_spec.rb +58 -7
  211. data/spec/version/version_spec.rb +15 -0
  212. data/vendor/assets/stylesheets/doorkeeper/bootstrap.min.css +4 -5
  213. metadata +75 -33
  214. data/spec/controllers/application_metal_controller.rb +0 -10
  215. data/spec/support/dependencies/factory_girl.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 990a2d9feaf3dd9945bac2a76742b719521e12c8
4
- data.tar.gz: 6a9e2f52ad07979a02040219f7a1f25c9768e353
3
+ metadata.gz: db3333346ca1b82cd7aa332bb1e43f8d979534c0
4
+ data.tar.gz: 12511ea5d14b0bba28fef47893cc925c9e45ebcd
5
5
  SHA512:
6
- metadata.gz: 641cb1c261a315bd330719a00ba622dbfd61c973f30124698db92ee33b3ff88314d4636e459fd367b73fffdd49da945307e3947a243bdbaf710f9a76a9c1759f
7
- data.tar.gz: cb2ff264f9e2e175bd3ed311d54ea24603d16f36b51bf4cdbb56fe4fe855e3785f668b9f0e8a5692ae85bc8057daaa47f14fde8c7cca367c6f08a6dce97bfb54
6
+ metadata.gz: a5265ed62b206c4f9f117c3cbc8e6d905840636297a342ea952e5dfced01f7ce4bd6b59fc7efd6a4f0e6558475c566bf59ba4a793ef3f87942cf8935dde061ba
7
+ data.tar.gz: 18d2b90ae8e5f2e6e80f518fe0a251c49ba3187fda34c9213f14c0152f301dfd149d11db14dcd94a69bb8048352f8a945107c572cfb3fa03aeabc6d6383b706c
@@ -0,0 +1,25 @@
1
+ ### Steps to reproduce
2
+ What we need to do to see your problem or bug?
3
+
4
+ The more detailed the issue, the more likely that we will fix it ASAP.
5
+
6
+ Don't use GitHub issues for questions like "How can I do that?" —
7
+ use [StackOverflow](https://stackoverflow.com/questions/tagged/doorkeeper)
8
+ instead with the corresponding tag.
9
+
10
+ ### Expected behavior
11
+ Tell us what should happen
12
+
13
+ ### Actual behavior
14
+ Tell us what happens instead
15
+
16
+ ### System configuration
17
+ You can help us to understand your problem if you will share some very
18
+ useful information about your project environment (don't forget to
19
+ remove any confidential data if it exists).
20
+
21
+ **Doorkeeper initializer**:
22
+
23
+ **Ruby version**:
24
+
25
+ **Gemfile.lock**:
@@ -0,0 +1,17 @@
1
+ ### Summary
2
+
3
+ Provide a general description of the code changes in your pull
4
+ request... were there any bugs you had fixed? If so, mention them. If
5
+ these bugs have open GitHub issues, be sure to tag them here as well,
6
+ to keep the conversation linked together.
7
+
8
+ ### Other Information
9
+
10
+ If there's anything else that's important and relevant to your pull
11
+ request, mention that information here. This could include
12
+ benchmarks, or other information.
13
+
14
+ If you are updating NEWS.md file or are asked to update it by reviewers,
15
+ please add the changelog entry at the top of the file.
16
+
17
+ Thanks for contributing to Doorkeeper project!
data/.gitignore CHANGED
@@ -6,9 +6,9 @@ pkg/
6
6
  spec/dummy/db/*.sqlite3
7
7
  spec/dummy/log/*.log
8
8
  spec/dummy/tmp/
9
+ spec/generators/tmp
9
10
  Gemfile.lock
10
11
  gemfiles/*.lock
11
- spec/generators/tmp
12
12
  .rvmrc
13
13
  *.swp
14
14
  .idea
@@ -17,3 +17,4 @@ spec/generators/tmp
17
17
  /doc/
18
18
  /rdoc/
19
19
  coverage
20
+ *.gem
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,16 @@
1
+ dependency_scanning:
2
+ image: docker:stable
3
+ variables:
4
+ DOCKER_DRIVER: overlay2
5
+ allow_failure: true
6
+ services:
7
+ - docker:stable-dind
8
+ script:
9
+ - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
10
+ - docker run
11
+ --env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
12
+ --volume "$PWD:/code"
13
+ --volume /var/run/docker.sock:/var/run/docker.sock
14
+ "registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
15
+ artifacts:
16
+ paths: [gl-dependency-scanning-report.json]
data/.hound.yml CHANGED
@@ -1,13 +1,2 @@
1
- AllCops:
2
- Exclude:
3
- - "spec/dummy/db/*"
4
-
5
- LineLength:
6
- Exclude:
7
- - spec/**/*
8
-
9
- StringLiterals:
10
- Enabled: false
11
-
12
- TrailingBlankLines:
13
- Enabled: true
1
+ ruby:
2
+ config_file: .rubocop.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "spec/dummy/db/*"
4
+
5
+ Metrics/BlockLength:
6
+ Exclude:
7
+ - spec/**/*
8
+
9
+ LineLength:
10
+ Exclude:
11
+ - spec/**/*
12
+
13
+ StringLiterals:
14
+ Enabled: false
15
+
16
+ TrailingBlankLines:
17
+ Enabled: true
data/.travis.yml CHANGED
@@ -4,22 +4,37 @@ sudo: false
4
4
 
5
5
  rvm:
6
6
  - 2.1
7
- - 2.2.6
8
- - 2.3.3
7
+ - 2.2
8
+ - 2.3
9
+ - 2.4
10
+ - 2.5
11
+ - ruby-2.6.0-preview1
9
12
 
10
13
  before_install:
14
+ - gem update --system # Need for Ruby 2.5.0. https://github.com/travis-ci/travis-ci/issues/8978
11
15
  - gem install bundler -v '~> 1.10'
12
16
 
13
17
  gemfile:
14
18
  - gemfiles/rails_4_2.gemfile
15
19
  - gemfiles/rails_5_0.gemfile
16
20
  - gemfiles/rails_5_1.gemfile
21
+ - gemfiles/rails_5_2.gemfile
22
+ - gemfiles/rails_master.gemfile
17
23
 
18
24
  matrix:
25
+ fast_finish: true
19
26
  exclude:
20
27
  - gemfile: gemfiles/rails_5_0.gemfile
21
28
  rvm: 2.1
22
29
  - gemfile: gemfiles/rails_5_1.gemfile
23
30
  rvm: 2.1
24
- allowed_failures:
25
- - gemfile: gemfiles/rails_5_1.gemfile
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
37
+ - gemfile: gemfiles/rails_master.gemfile
38
+ rvm: 2.3
39
+ allow_failures:
40
+ - gemfile: gemfiles/rails_master.gemfile
data/Appraisals CHANGED
@@ -4,11 +4,15 @@ end
4
4
 
5
5
  appraise "rails-5-0" do
6
6
  gem "rails", "~> 5.0.0"
7
- gem "rspec-rails", "~> 3.5"
7
+ gem "rspec-rails", "~> 3.7"
8
8
  end
9
9
 
10
10
  appraise "rails-5-1" do
11
- gem "rails", github: "rails/rails"
12
- gem "arel", github: "rails/arel"
13
- gem "rspec-rails", "~> 3.5"
11
+ gem "rails", "~> 5.1.0"
12
+ gem "rspec-rails", "~> 3.7"
13
+ end
14
+
15
+ appraise "rails-master" do
16
+ gem "rails", git: 'https://github.com/rails/rails'
17
+ gem "arel", git: 'https://github.com/rails/arel'
14
18
  end
@@ -0,0 +1,46 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team members or current maintainer email, specified in gemspec. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "rails", "~> 4.2.0"
3
+ gem "rails", "~> 5.2"
4
4
 
5
5
  gem "appraisal"
6
6
 
data/NEWS.md CHANGED
@@ -1,7 +1,122 @@
1
1
  # News
2
2
 
3
+ See https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions for
4
+ upgrade guides.
5
+
3
6
  User-visible changes worth mentioning.
4
7
 
8
+ ## master
9
+
10
+ - [#PR ID] Add PR description.
11
+
12
+ ## 5.0.0
13
+
14
+ - [#1127] Change the token_type initials of the Banner Token to uppercase to comply with the RFC6750 specification.
15
+
16
+ ## 5.0.0.rc2
17
+
18
+ - [#1106] Restrict access to AdminController with 'Forbidden 403' if admin_authenticator is not
19
+ configured by developers..
20
+ - [#1108] Simple formating of callback URLs when listing oauth applications
21
+ - [#1116] `AccessGrant`s will now be revoked along with `AccessToken`s when
22
+ hitting the `AuthorizedApplicationController#destroy` route.
23
+ - [#1114] Make token info endpoint's attributes consistent with token creation
24
+ - [#1119] Fix token revocation for OAuth apps using "implicit" grant flow
25
+ - [#1122] Fix AuthorizationsController#new error response to be in JSON format
26
+
27
+ ## 5.0.0.rc1
28
+
29
+ - [#1103] Allow customizing use_refresh_token
30
+ - [#1089] Removed enable_pkce_without_secret configuration option
31
+ - [#1102] Expiration time based on scopes
32
+ - [#1099] All the configuration variables in `Doorkeeper.configuration` now
33
+ always return a non-nil value (`true` or `false`)
34
+ - [#1099] ORM / Query optimization: Do not revoke the refresh token if it is not enabled
35
+ in `doorkeeper.rb`
36
+ - [#996] Expiration Time Base On Grant Type
37
+ - [#997] Allow PKCE authorization_code flow as specified in RFC7636
38
+ - [#907] Fix lookup for matching tokens in certain edge-cases
39
+ - [#992] Add API option to use Doorkeeper without management views for API only
40
+ Rails applications (`api_only`)
41
+ - [#1045] Validate redirect_uri as the native URI when making authorization code requests
42
+ - [#1048] Remove deprecated `Doorkeeper#configured?`, `Doorkeeper#database_installed?`, and
43
+ `Doorkeeper#installed?` method
44
+ - [#1031] Allow public clients to authenticate without `client_secret`. Define an app as
45
+ either public or private/confidential
46
+ - [#1010] Add configuration to enforce configured scopes (`default_scopes` and
47
+ `optional_scopes`) for applications
48
+ - [#1060] Ensure that the native redirect_uri parameter matches with redirect_uri of the client
49
+ - [#1064] Add :before_successful_authorization and :after_successful_authorization hooks
50
+ - [#1069] Upgrade Bootstrap to 4 for Admin
51
+ - [#1068] Add rake task to cleanup databases that can become large over time
52
+ - [#1072] AuthorizationsController: Memoize strategy.authorize_response result to enable
53
+ subclasses to use the response object.
54
+ - [#1075] Call `before_successful_authorization` and `after_successful_authorization` hooks
55
+ on `create` action as well as `new`
56
+ - [#1082] Fix #916: remember routes mapping and use it required places (fix error with
57
+ customized Token Info route).
58
+ - [#1086, #1088] Fix bug with receiving default scopes in the token even if they are
59
+ not present in the application scopes (use scopes intersection).
60
+ - [#1076] Add config to enforce content type to application/x-www-form-urlencoded
61
+ - Fix bug with `force_ssl_in_redirect_uri` when it breaks existing applications with an
62
+ SSL redirect_uri.
63
+
64
+ ## 4.4.2
65
+
66
+ - [#1130] Backport fix for native redirect_uri from 5.x.
67
+
68
+ ## 4.4.1
69
+
70
+ - [#1127] Backport token type to comply with the RFC6750 specification.
71
+ - [#1125] Backport Quote surround I18n yes/no keys
72
+
73
+ ## 4.4.0
74
+
75
+ - [#1120] Backport security fix from 5.x for token revocation when using public clients
76
+
77
+ ## 4.3.2
78
+
79
+ - [#1053] Support authorizing with query params in the request `redirect_uri` if explicitly present in app's `Application#redirect_uri`
80
+
81
+ ## 4.3.1
82
+
83
+ - Remove `BaseRecord` and introduce additional concern for ordering methods to fix
84
+ braking changes for Doorkeeper models.
85
+ - [#1032] Refactor BaseRequest callbacks into configurable lambdas
86
+ - [#1040] Clear mixins from ActiveRecord DSL and save only overridable API. It
87
+ allows to use this mixins in Doorkeeper ORM extensions with minimum code boilerplate.
88
+
89
+ ## 4.3.0
90
+
91
+ - [#976] Fix to invalidate the second redirect URI when the first URI is the native URI
92
+ - [#1035] Allow `Application#redirect_uri=` to handle array of URIs.
93
+ - [#1036] Allow to forbid Application redirect URI's with specific rules.
94
+ - [#1029] Deprecate `order_method` and introduce `ordered_by`. Sort applications
95
+ by `created_at` in index action.
96
+ - [#1033] Allow Doorkeeper configuration option #force_ssl_in_redirect_uri to be a callable object.
97
+ - Fix Grape integration & add specs for it
98
+ - [#913] Deferred ORM (ActiveRecord) models loading
99
+ - [#943] Fix Access Token token generation when certain errors occur in custom token generators
100
+ - [#1026] Implement RFC7662 - OAuth 2.0 Token Introspection
101
+ - [#985] Generate valid migration files for Rails >= 5
102
+ - [#972] Replace Struct subclassing with block-form initialization
103
+ - [#1003] Use URL query param to pass through native redirect auth code so automated apps can find it.
104
+ - [#868] `Scopes#&` and `Scopes#+` now take an array or any other enumerable
105
+ object.
106
+ - [#1019] Remove translation not in use: `invalid_resource_owner`.
107
+ - Use Ruby 2 hash style syntax (min required Ruby version = 2.1)
108
+ - [#948] Make Scopes.<=> work with any "other" value.
109
+ - [#974] Redirect URI is checked without query params within AuthorizationCodeRequest.
110
+ - [#1004] More explicit help text for `native_redirect_uri`.
111
+ - [#1023] Update Ruby versions and test against 2.5.0 on Travis CI.
112
+ - [#1024] Migrate from FactoryGirl to FactoryBot.
113
+ - [#1025] Improve documentation for adding foreign keys
114
+ - [#1028] Make it possible to have composite strategy names.
115
+
116
+ ## 4.2.6
117
+
118
+ - [#970] Escape certain attributes in authorization forms.
119
+
5
120
  ## 4.2.5
6
121
 
7
122
  - [#936] Deprecate `Doorkeeper#configured?`, `Doorkeeper#database_installed?`, and