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.
- checksums.yaml +4 -4
- data/Appraisals +1 -1
- data/CHANGELOG.md +880 -0
- data/CONTRIBUTING.md +11 -9
- data/Dangerfile +2 -2
- data/Dockerfile +29 -0
- data/Gemfile +3 -2
- data/NEWS.md +1 -819
- data/README.md +11 -3
- data/RELEASING.md +6 -5
- data/app/controllers/doorkeeper/application_controller.rb +1 -1
- data/app/controllers/doorkeeper/application_metal_controller.rb +2 -1
- data/app/controllers/doorkeeper/applications_controller.rb +1 -0
- data/app/controllers/doorkeeper/authorizations_controller.rb +14 -7
- data/app/controllers/doorkeeper/tokens_controller.rb +32 -9
- data/app/views/doorkeeper/applications/_form.html.erb +0 -6
- data/app/views/doorkeeper/applications/show.html.erb +1 -1
- data/config/locales/en.yml +8 -2
- data/doorkeeper.gemspec +9 -1
- data/gemfiles/rails_5_0.gemfile +1 -0
- data/gemfiles/rails_5_1.gemfile +1 -0
- data/gemfiles/rails_5_2.gemfile +1 -0
- data/gemfiles/rails_6_0.gemfile +2 -1
- data/gemfiles/rails_master.gemfile +1 -0
- data/lib/doorkeeper/config/option.rb +13 -7
- data/lib/doorkeeper/config.rb +89 -6
- data/lib/doorkeeper/errors.rb +13 -18
- data/lib/doorkeeper/grape/helpers.rb +5 -1
- data/lib/doorkeeper/helpers/controller.rb +23 -4
- data/lib/doorkeeper/models/access_token_mixin.rb +49 -7
- data/lib/doorkeeper/oauth/authorization/code.rb +11 -13
- data/lib/doorkeeper/oauth/authorization/token.rb +1 -1
- data/lib/doorkeeper/oauth/authorization_code_request.rb +18 -9
- data/lib/doorkeeper/oauth/base_request.rb +2 -0
- data/lib/doorkeeper/oauth/client_credentials/creator.rb +14 -0
- data/lib/doorkeeper/oauth/client_credentials/validation.rb +8 -0
- data/lib/doorkeeper/oauth/code_request.rb +5 -11
- data/lib/doorkeeper/oauth/code_response.rb +2 -2
- data/lib/doorkeeper/oauth/error_response.rb +1 -1
- data/lib/doorkeeper/oauth/helpers/uri_checker.rb +18 -4
- data/lib/doorkeeper/oauth/invalid_request_response.rb +43 -0
- data/lib/doorkeeper/oauth/nonstandard.rb +39 -0
- data/lib/doorkeeper/oauth/password_access_token_request.rb +7 -2
- data/lib/doorkeeper/oauth/pre_authorization.rb +73 -37
- data/lib/doorkeeper/oauth/refresh_token_request.rb +13 -10
- data/lib/doorkeeper/oauth/token_introspection.rb +23 -13
- data/lib/doorkeeper/oauth/token_request.rb +4 -18
- data/lib/doorkeeper/orm/active_record/access_grant.rb +1 -1
- data/lib/doorkeeper/orm/active_record/access_token.rb +2 -2
- data/lib/doorkeeper/orm/active_record/application.rb +13 -5
- data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +61 -0
- data/lib/doorkeeper/orm/active_record.rb +18 -3
- data/lib/doorkeeper/request/authorization_code.rb +2 -0
- data/lib/doorkeeper/request.rb +6 -11
- data/lib/doorkeeper/server.rb +2 -6
- data/lib/doorkeeper/stale_records_cleaner.rb +6 -2
- data/lib/doorkeeper/version.rb +2 -2
- data/lib/doorkeeper.rb +4 -0
- data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +6 -6
- data/lib/generators/doorkeeper/templates/initializer.rb +118 -33
- data/lib/generators/doorkeeper/templates/migration.rb.erb +4 -1
- data/spec/controllers/applications_controller_spec.rb +93 -0
- data/spec/controllers/authorizations_controller_spec.rb +143 -62
- data/spec/controllers/protected_resources_controller_spec.rb +3 -3
- data/spec/controllers/tokens_controller_spec.rb +205 -37
- data/spec/dummy/config/application.rb +3 -1
- data/spec/dummy/config/initializers/doorkeeper.rb +54 -9
- data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +1 -1
- data/spec/lib/config_spec.rb +58 -1
- data/spec/lib/oauth/authorization_code_request_spec.rb +13 -1
- data/spec/lib/oauth/base_request_spec.rb +33 -16
- data/spec/lib/oauth/client_credentials/creator_spec.rb +3 -0
- data/spec/lib/oauth/code_request_spec.rb +27 -28
- data/spec/lib/oauth/helpers/uri_checker_spec.rb +17 -2
- data/spec/lib/oauth/invalid_request_response_spec.rb +75 -0
- data/spec/lib/oauth/pre_authorization_spec.rb +76 -66
- data/spec/lib/oauth/refresh_token_request_spec.rb +1 -0
- data/spec/lib/oauth/token_request_spec.rb +20 -17
- data/spec/lib/server_spec.rb +0 -12
- data/spec/models/doorkeeper/access_grant_spec.rb +21 -2
- data/spec/models/doorkeeper/access_token_spec.rb +35 -4
- data/spec/models/doorkeeper/application_spec.rb +10 -0
- data/spec/requests/endpoints/authorization_spec.rb +21 -5
- data/spec/requests/endpoints/token_spec.rb +1 -1
- data/spec/requests/flows/authorization_code_errors_spec.rb +1 -0
- data/spec/requests/flows/authorization_code_spec.rb +93 -27
- data/spec/requests/flows/client_credentials_spec.rb +38 -0
- data/spec/requests/flows/implicit_grant_errors_spec.rb +22 -10
- data/spec/requests/flows/implicit_grant_spec.rb +9 -8
- data/spec/requests/flows/password_spec.rb +37 -0
- data/spec/requests/flows/refresh_token_spec.rb +1 -1
- data/spec/requests/flows/revoke_token_spec.rb +19 -11
- data/spec/support/doorkeeper_rspec.rb +1 -1
- data/spec/support/helpers/request_spec_helper.rb +14 -2
- data/spec/validators/redirect_uri_validator_spec.rb +40 -15
- metadata +16 -15
- data/.coveralls.yml +0 -1
- data/.github/ISSUE_TEMPLATE.md +0 -25
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -17
- data/.gitignore +0 -20
- data/.gitlab-ci.yml +0 -16
- data/.hound.yml +0 -3
- data/.rspec +0 -1
- data/.rubocop.yml +0 -50
- data/.travis.yml +0 -35
- 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
|
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]
|
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 `
|
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 = '
|
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}]
|
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
|
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-
|
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
|
|