doorkeeper 5.1.2 → 5.2.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of doorkeeper might be problematic. Click here for more details.

Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +1 -1
  3. data/CHANGELOG.md +880 -0
  4. data/CONTRIBUTING.md +11 -9
  5. data/Dangerfile +2 -2
  6. data/Dockerfile +29 -0
  7. data/Gemfile +3 -2
  8. data/NEWS.md +1 -819
  9. data/README.md +11 -3
  10. data/RELEASING.md +6 -5
  11. data/app/controllers/doorkeeper/application_controller.rb +1 -1
  12. data/app/controllers/doorkeeper/application_metal_controller.rb +2 -1
  13. data/app/controllers/doorkeeper/applications_controller.rb +1 -0
  14. data/app/controllers/doorkeeper/authorizations_controller.rb +14 -7
  15. data/app/controllers/doorkeeper/tokens_controller.rb +32 -9
  16. data/app/views/doorkeeper/applications/_form.html.erb +0 -6
  17. data/app/views/doorkeeper/applications/show.html.erb +1 -1
  18. data/config/locales/en.yml +8 -2
  19. data/doorkeeper.gemspec +9 -1
  20. data/gemfiles/rails_5_0.gemfile +1 -0
  21. data/gemfiles/rails_5_1.gemfile +1 -0
  22. data/gemfiles/rails_5_2.gemfile +1 -0
  23. data/gemfiles/rails_6_0.gemfile +2 -1
  24. data/gemfiles/rails_master.gemfile +1 -0
  25. data/lib/doorkeeper/config/option.rb +13 -7
  26. data/lib/doorkeeper/config.rb +89 -6
  27. data/lib/doorkeeper/errors.rb +13 -18
  28. data/lib/doorkeeper/grape/helpers.rb +5 -1
  29. data/lib/doorkeeper/helpers/controller.rb +23 -4
  30. data/lib/doorkeeper/models/access_token_mixin.rb +49 -7
  31. data/lib/doorkeeper/oauth/authorization/code.rb +11 -13
  32. data/lib/doorkeeper/oauth/authorization/token.rb +1 -1
  33. data/lib/doorkeeper/oauth/authorization_code_request.rb +18 -9
  34. data/lib/doorkeeper/oauth/base_request.rb +2 -0
  35. data/lib/doorkeeper/oauth/client_credentials/creator.rb +14 -0
  36. data/lib/doorkeeper/oauth/client_credentials/validation.rb +8 -0
  37. data/lib/doorkeeper/oauth/code_request.rb +5 -11
  38. data/lib/doorkeeper/oauth/code_response.rb +2 -2
  39. data/lib/doorkeeper/oauth/error_response.rb +1 -1
  40. data/lib/doorkeeper/oauth/helpers/uri_checker.rb +18 -4
  41. data/lib/doorkeeper/oauth/invalid_request_response.rb +43 -0
  42. data/lib/doorkeeper/oauth/nonstandard.rb +39 -0
  43. data/lib/doorkeeper/oauth/password_access_token_request.rb +7 -2
  44. data/lib/doorkeeper/oauth/pre_authorization.rb +73 -37
  45. data/lib/doorkeeper/oauth/refresh_token_request.rb +13 -10
  46. data/lib/doorkeeper/oauth/token_introspection.rb +23 -13
  47. data/lib/doorkeeper/oauth/token_request.rb +4 -18
  48. data/lib/doorkeeper/orm/active_record/access_grant.rb +1 -1
  49. data/lib/doorkeeper/orm/active_record/access_token.rb +2 -2
  50. data/lib/doorkeeper/orm/active_record/application.rb +13 -5
  51. data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +61 -0
  52. data/lib/doorkeeper/orm/active_record.rb +18 -3
  53. data/lib/doorkeeper/request/authorization_code.rb +2 -0
  54. data/lib/doorkeeper/request.rb +6 -11
  55. data/lib/doorkeeper/server.rb +2 -6
  56. data/lib/doorkeeper/stale_records_cleaner.rb +6 -2
  57. data/lib/doorkeeper/version.rb +2 -2
  58. data/lib/doorkeeper.rb +4 -0
  59. data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +6 -6
  60. data/lib/generators/doorkeeper/templates/initializer.rb +118 -33
  61. data/lib/generators/doorkeeper/templates/migration.rb.erb +4 -1
  62. data/spec/controllers/applications_controller_spec.rb +93 -0
  63. data/spec/controllers/authorizations_controller_spec.rb +143 -62
  64. data/spec/controllers/protected_resources_controller_spec.rb +3 -3
  65. data/spec/controllers/tokens_controller_spec.rb +205 -37
  66. data/spec/dummy/config/application.rb +3 -1
  67. data/spec/dummy/config/initializers/doorkeeper.rb +54 -9
  68. data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +1 -1
  69. data/spec/lib/config_spec.rb +58 -1
  70. data/spec/lib/oauth/authorization_code_request_spec.rb +13 -1
  71. data/spec/lib/oauth/base_request_spec.rb +33 -16
  72. data/spec/lib/oauth/client_credentials/creator_spec.rb +3 -0
  73. data/spec/lib/oauth/code_request_spec.rb +27 -28
  74. data/spec/lib/oauth/helpers/uri_checker_spec.rb +17 -2
  75. data/spec/lib/oauth/invalid_request_response_spec.rb +75 -0
  76. data/spec/lib/oauth/pre_authorization_spec.rb +76 -66
  77. data/spec/lib/oauth/refresh_token_request_spec.rb +1 -0
  78. data/spec/lib/oauth/token_request_spec.rb +20 -17
  79. data/spec/lib/server_spec.rb +0 -12
  80. data/spec/models/doorkeeper/access_grant_spec.rb +21 -2
  81. data/spec/models/doorkeeper/access_token_spec.rb +35 -4
  82. data/spec/models/doorkeeper/application_spec.rb +10 -0
  83. data/spec/requests/endpoints/authorization_spec.rb +21 -5
  84. data/spec/requests/endpoints/token_spec.rb +1 -1
  85. data/spec/requests/flows/authorization_code_errors_spec.rb +1 -0
  86. data/spec/requests/flows/authorization_code_spec.rb +93 -27
  87. data/spec/requests/flows/client_credentials_spec.rb +38 -0
  88. data/spec/requests/flows/implicit_grant_errors_spec.rb +22 -10
  89. data/spec/requests/flows/implicit_grant_spec.rb +9 -8
  90. data/spec/requests/flows/password_spec.rb +37 -0
  91. data/spec/requests/flows/refresh_token_spec.rb +1 -1
  92. data/spec/requests/flows/revoke_token_spec.rb +19 -11
  93. data/spec/support/doorkeeper_rspec.rb +1 -1
  94. data/spec/support/helpers/request_spec_helper.rb +14 -2
  95. data/spec/validators/redirect_uri_validator_spec.rb +40 -15
  96. metadata +16 -15
  97. data/.coveralls.yml +0 -1
  98. data/.github/ISSUE_TEMPLATE.md +0 -25
  99. data/.github/PULL_REQUEST_TEMPLATE.md +0 -17
  100. data/.gitignore +0 -20
  101. data/.gitlab-ci.yml +0 -16
  102. data/.hound.yml +0 -3
  103. data/.rspec +0 -1
  104. data/.rubocop.yml +0 -50
  105. data/.travis.yml +0 -35
  106. data/app/validators/redirect_uri_validator.rb +0 -50
data/CONTRIBUTING.md CHANGED
@@ -1,14 +1,19 @@
1
1
  # Contributing
2
2
 
3
3
  We love pull requests from everyone. By participating in this project, you agree
4
- to abide by the thoughtbot [code of conduct].
5
-
6
- [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
4
+ to abide by the [code of conduct](CODE_OF_CONDUCT.md).
7
5
 
8
6
  Fork, then clone the repo:
9
7
 
10
8
  git clone git@github.com:your-username/doorkeeper.git
11
9
 
10
+ ### Docker Setup
11
+
12
+ Build the container image with: `docker build --pull -t doorkeeper:test .`
13
+ Run the tests with: `docker run -it --rm doorkeeper:test`
14
+
15
+ ### Local Setup
16
+
12
17
  Set up Ruby dependencies via Bundler
13
18
 
14
19
  bundle install
@@ -19,14 +24,12 @@ Make sure the tests pass:
19
24
 
20
25
  Make your change.
21
26
  Write tests.
22
- Follow our [style guide][style].
27
+ Follow our [style guide](.rubocop.yml).
23
28
  Make the tests pass:
24
29
 
25
- [style]: https://github.com/thoughtbot/guides/tree/master/style
26
-
27
30
  rake
28
31
 
29
- Add notes on your change to the `NEWS.md` file.
32
+ Add notes on your change to the `CHANGELOG.md` file.
30
33
 
31
34
  Write a [good commit message][commit].
32
35
  Push to your fork.
@@ -35,8 +38,7 @@ Push to your fork.
35
38
  [commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
36
39
  [pr]: https://github.com/doorkeeper-gem/doorkeeper/compare/
37
40
 
38
- If [Hound] catches style violations,
39
- fix them.
41
+ If [Hound] catches style violations, fix them.
40
42
 
41
43
  [hound]: https://houndci.com
42
44
 
data/Dangerfile CHANGED
@@ -1,4 +1,4 @@
1
- CHANGELOG_FILE = 'NEWS.md'
1
+ CHANGELOG_FILE = 'CHANGELOG.md'
2
2
  GITHUB_REPO = 'https://github.com/doorkeeper-gem/doorkeeper'
3
3
 
4
4
  def changelog_changed?
@@ -11,7 +11,7 @@ def changelog_entry_example
11
11
  .sub(/[?.!,;]?$/, '')
12
12
  .capitalize
13
13
 
14
- "- [##{pr_number}]: #{pr_title}."
14
+ "- [##{pr_number}] #{pr_title}."
15
15
  end
16
16
 
17
17
  # --------------------------------------------------------------------------------------------------------------------
data/Dockerfile ADDED
@@ -0,0 +1,29 @@
1
+ FROM ruby:2.6.3-alpine3.9
2
+
3
+ RUN apk add --no-cache \
4
+ ca-certificates \
5
+ wget \
6
+ openssl \
7
+ bash \
8
+ build-base \
9
+ git \
10
+ sqlite-dev \
11
+ tzdata
12
+
13
+ ENV LANG en_US.UTF-8
14
+ ENV LANGUAGE en_US:en
15
+ ENV LC_ALL en_US.UTF-8
16
+
17
+ ENV BUNDLER_VERSION 2.0.1
18
+ RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force
19
+
20
+ WORKDIR /srv
21
+
22
+ COPY Gemfile doorkeeper.gemspec /srv/
23
+ COPY lib/doorkeeper/version.rb /srv/lib/doorkeeper/version.rb
24
+
25
+ RUN bundle install
26
+
27
+ COPY . /srv/
28
+
29
+ CMD ["rake"]
data/Gemfile CHANGED
@@ -5,16 +5,17 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
5
 
6
6
  gemspec
7
7
 
8
- gem "rails", "~> 6.0.0.beta3"
8
+ gem "rails", "~> 6.0.0"
9
9
 
10
10
  # TODO: Remove when rspec-rails 4.0 released
11
11
  gem "rspec-core", github: "rspec/rspec-core"
12
12
  gem "rspec-expectations", github: "rspec/rspec-expectations"
13
13
  gem "rspec-mocks", github: "rspec/rspec-mocks"
14
- gem "rspec-rails", github: "rspec/rspec-rails", branch: "4-0-dev"
14
+ gem "rspec-rails", github: "rspec/rspec-rails", branch: "4-0-maintenance"
15
15
  gem "rspec-support", github: "rspec/rspec-support"
16
16
 
17
17
  gem "rubocop", "~> 0.66"
18
+ gem "rubocop-performance"
18
19
 
19
20
  gem "bcrypt", "~> 3.1", require: false
20
21