doorkeeper 5.2.6 → 5.3.3
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 +2 -2
- data/CHANGELOG.md +24 -5
- data/Gemfile +2 -2
- data/app/controllers/doorkeeper/application_controller.rb +2 -2
- data/app/controllers/doorkeeper/application_metal_controller.rb +2 -2
- data/app/controllers/doorkeeper/authorizations_controller.rb +2 -2
- data/app/controllers/doorkeeper/authorized_applications_controller.rb +2 -2
- data/gemfiles/rails_5_0.gemfile +2 -2
- data/gemfiles/rails_5_1.gemfile +2 -2
- data/gemfiles/rails_5_2.gemfile +2 -2
- data/gemfiles/rails_6_0.gemfile +2 -2
- data/gemfiles/rails_master.gemfile +2 -2
- data/lib/doorkeeper/config.rb +71 -38
- data/lib/doorkeeper/grape/helpers.rb +1 -1
- data/lib/doorkeeper/helpers/controller.rb +10 -8
- data/lib/doorkeeper/models/access_grant_mixin.rb +7 -6
- data/lib/doorkeeper/models/access_token_mixin.rb +54 -16
- data/lib/doorkeeper/models/application_mixin.rb +3 -3
- data/lib/doorkeeper/models/concerns/ownership.rb +1 -1
- data/lib/doorkeeper/models/concerns/reusable.rb +1 -1
- data/lib/doorkeeper/models/concerns/revocable.rb +0 -27
- data/lib/doorkeeper/oauth/authorization/code.rb +4 -4
- data/lib/doorkeeper/oauth/authorization/token.rb +9 -6
- data/lib/doorkeeper/oauth/authorization_code_request.rb +13 -6
- data/lib/doorkeeper/oauth/base_request.rb +8 -4
- data/lib/doorkeeper/oauth/client.rb +7 -8
- data/lib/doorkeeper/oauth/client_credentials/creator.rb +16 -9
- data/lib/doorkeeper/oauth/client_credentials/issuer.rb +7 -7
- data/lib/doorkeeper/oauth/client_credentials/{validation.rb → validator.rb} +4 -4
- data/lib/doorkeeper/oauth/client_credentials_request.rb +1 -1
- data/lib/doorkeeper/oauth/code_response.rb +2 -2
- data/lib/doorkeeper/oauth/error.rb +1 -1
- data/lib/doorkeeper/oauth/error_response.rb +5 -5
- data/lib/doorkeeper/oauth/helpers/scope_checker.rb +7 -5
- data/lib/doorkeeper/oauth/helpers/unique_token.rb +8 -5
- data/lib/doorkeeper/oauth/helpers/uri_checker.rb +1 -1
- data/lib/doorkeeper/oauth/invalid_request_response.rb +3 -3
- data/lib/doorkeeper/oauth/invalid_token_response.rb +5 -2
- data/lib/doorkeeper/oauth/password_access_token_request.rb +3 -3
- data/lib/doorkeeper/oauth/pre_authorization.rb +7 -5
- data/lib/doorkeeper/oauth/refresh_token_request.rb +5 -5
- data/lib/doorkeeper/oauth/token.rb +2 -2
- data/lib/doorkeeper/oauth/token_introspection.rb +6 -6
- data/lib/doorkeeper/orm/active_record/access_grant.rb +4 -43
- data/lib/doorkeeper/orm/active_record/access_token.rb +4 -35
- data/lib/doorkeeper/orm/active_record/application.rb +3 -155
- data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +53 -0
- data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +47 -0
- data/lib/doorkeeper/orm/active_record/mixins/application.rb +187 -0
- data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +3 -3
- data/lib/doorkeeper/orm/active_record.rb +3 -3
- data/lib/doorkeeper/rails/helpers.rb +4 -4
- data/lib/doorkeeper/rails/routes.rb +5 -7
- data/lib/doorkeeper/rake/db.rake +3 -3
- data/lib/doorkeeper/request/authorization_code.rb +3 -3
- data/lib/doorkeeper/request/client_credentials.rb +2 -2
- data/lib/doorkeeper/request/password.rb +2 -2
- data/lib/doorkeeper/request/refresh_token.rb +3 -3
- data/lib/doorkeeper/request.rb +1 -1
- data/lib/doorkeeper/server.rb +1 -1
- data/lib/doorkeeper/stale_records_cleaner.rb +1 -1
- data/lib/doorkeeper/version.rb +2 -2
- data/lib/doorkeeper.rb +2 -3
- data/lib/generators/doorkeeper/application_owner_generator.rb +1 -1
- data/lib/generators/doorkeeper/confidential_applications_generator.rb +1 -1
- data/lib/generators/doorkeeper/migration_generator.rb +1 -1
- data/lib/generators/doorkeeper/pkce_generator.rb +1 -1
- data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +2 -2
- data/lib/generators/doorkeeper/templates/initializer.rb +39 -0
- data/spec/controllers/application_metal_controller_spec.rb +1 -1
- data/spec/controllers/applications_controller_spec.rb +3 -2
- data/spec/controllers/authorizations_controller_spec.rb +18 -18
- data/spec/controllers/protected_resources_controller_spec.rb +25 -17
- data/spec/controllers/token_info_controller_spec.rb +1 -1
- data/spec/controllers/tokens_controller_spec.rb +1 -1
- data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +3 -3
- data/spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb +1 -1
- data/spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb +1 -1
- data/spec/generators/install_generator_spec.rb +1 -1
- data/spec/generators/previous_refresh_token_generator_spec.rb +2 -2
- data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +1 -1
- data/spec/lib/config_spec.rb +62 -7
- data/spec/lib/doorkeeper_spec.rb +1 -1
- data/spec/lib/models/revocable_spec.rb +3 -3
- data/spec/lib/oauth/authorization_code_request_spec.rb +127 -125
- data/spec/lib/oauth/base_request_spec.rb +160 -158
- data/spec/lib/oauth/base_response_spec.rb +27 -29
- data/spec/lib/oauth/client/credentials_spec.rb +1 -1
- data/spec/lib/oauth/client_credentials/creator_spec.rb +42 -5
- data/spec/lib/oauth/client_credentials/issuer_spec.rb +12 -12
- data/spec/lib/oauth/client_credentials/validation_spec.rb +4 -4
- data/spec/lib/oauth/client_credentials_integration_spec.rb +16 -18
- data/spec/lib/oauth/client_credentials_request_spec.rb +78 -80
- data/spec/lib/oauth/client_spec.rb +26 -26
- data/spec/lib/oauth/code_request_spec.rb +34 -34
- data/spec/lib/oauth/code_response_spec.rb +21 -25
- data/spec/lib/oauth/error_response_spec.rb +42 -44
- data/spec/lib/oauth/error_spec.rb +12 -14
- data/spec/lib/oauth/forbidden_token_response_spec.rb +11 -13
- data/spec/lib/oauth/helpers/scope_checker_spec.rb +30 -18
- data/spec/lib/oauth/invalid_request_response_spec.rb +48 -50
- data/spec/lib/oauth/invalid_token_response_spec.rb +32 -34
- data/spec/lib/oauth/password_access_token_request_spec.rb +145 -147
- data/spec/lib/oauth/pre_authorization_spec.rb +159 -161
- data/spec/lib/oauth/refresh_token_request_spec.rb +138 -139
- data/spec/lib/oauth/scopes_spec.rb +104 -106
- data/spec/lib/oauth/token_request_spec.rb +115 -111
- data/spec/lib/oauth/token_response_spec.rb +71 -73
- data/spec/lib/oauth/token_spec.rb +121 -123
- data/spec/models/doorkeeper/access_grant_spec.rb +3 -5
- data/spec/models/doorkeeper/access_token_spec.rb +7 -7
- data/spec/models/doorkeeper/application_spec.rb +2 -2
- data/spec/requests/applications/applications_request_spec.rb +1 -1
- data/spec/requests/endpoints/authorization_spec.rb +5 -3
- data/spec/requests/flows/authorization_code_spec.rb +34 -22
- data/spec/requests/flows/client_credentials_spec.rb +1 -1
- data/spec/requests/flows/password_spec.rb +32 -12
- data/spec/requests/flows/refresh_token_spec.rb +19 -19
- data/spec/requests/flows/revoke_token_spec.rb +18 -12
- data/spec/spec_helper.rb +1 -4
- data/spec/support/shared/controllers_shared_context.rb +33 -23
- data/spec/validators/redirect_uri_validator_spec.rb +1 -1
- metadata +6 -5
- data/spec/support/http_method_shim.rb +0 -29
@@ -44,17 +44,17 @@ describe "Refresh Token Flow" do
|
|
44
44
|
:access_token,
|
45
45
|
application: @client,
|
46
46
|
resource_owner_id: 1,
|
47
|
-
use_refresh_token: true
|
47
|
+
use_refresh_token: true,
|
48
48
|
)
|
49
49
|
end
|
50
50
|
|
51
51
|
context "refresh_token revoked on use" do
|
52
52
|
it "client request a token with refresh token" do
|
53
53
|
post refresh_token_endpoint_url(
|
54
|
-
client: @client, refresh_token: @token.refresh_token
|
54
|
+
client: @client, refresh_token: @token.refresh_token,
|
55
55
|
)
|
56
56
|
should_have_json(
|
57
|
-
"refresh_token", Doorkeeper::AccessToken.last.refresh_token
|
57
|
+
"refresh_token", Doorkeeper::AccessToken.last.refresh_token,
|
58
58
|
)
|
59
59
|
expect(@token.reload).not_to be_revoked
|
60
60
|
end
|
@@ -62,10 +62,10 @@ describe "Refresh Token Flow" do
|
|
62
62
|
it "client request a token with expired access token" do
|
63
63
|
@token.update_attribute :expires_in, -100
|
64
64
|
post refresh_token_endpoint_url(
|
65
|
-
client: @client, refresh_token: @token.refresh_token
|
65
|
+
client: @client, refresh_token: @token.refresh_token,
|
66
66
|
)
|
67
67
|
should_have_json(
|
68
|
-
"refresh_token", Doorkeeper::AccessToken.last.refresh_token
|
68
|
+
"refresh_token", Doorkeeper::AccessToken.last.refresh_token,
|
69
69
|
)
|
70
70
|
expect(@token.reload).not_to be_revoked
|
71
71
|
end
|
@@ -78,10 +78,10 @@ describe "Refresh Token Flow" do
|
|
78
78
|
|
79
79
|
it "client request a token with refresh token" do
|
80
80
|
post refresh_token_endpoint_url(
|
81
|
-
client: @client, refresh_token: @token.refresh_token
|
81
|
+
client: @client, refresh_token: @token.refresh_token,
|
82
82
|
)
|
83
83
|
should_have_json(
|
84
|
-
"refresh_token", Doorkeeper::AccessToken.last.refresh_token
|
84
|
+
"refresh_token", Doorkeeper::AccessToken.last.refresh_token,
|
85
85
|
)
|
86
86
|
expect(@token.reload).to be_revoked
|
87
87
|
end
|
@@ -89,10 +89,10 @@ describe "Refresh Token Flow" do
|
|
89
89
|
it "client request a token with expired access token" do
|
90
90
|
@token.update_attribute :expires_in, -100
|
91
91
|
post refresh_token_endpoint_url(
|
92
|
-
client: @client, refresh_token: @token.refresh_token
|
92
|
+
client: @client, refresh_token: @token.refresh_token,
|
93
93
|
)
|
94
94
|
should_have_json(
|
95
|
-
"refresh_token", Doorkeeper::AccessToken.last.refresh_token
|
95
|
+
"refresh_token", Doorkeeper::AccessToken.last.refresh_token,
|
96
96
|
)
|
97
97
|
expect(@token.reload).to be_revoked
|
98
98
|
end
|
@@ -102,7 +102,7 @@ describe "Refresh Token Flow" do
|
|
102
102
|
let(:public_client) do
|
103
103
|
FactoryBot.create(
|
104
104
|
:application,
|
105
|
-
confidential: false
|
105
|
+
confidential: false,
|
106
106
|
)
|
107
107
|
end
|
108
108
|
|
@@ -111,7 +111,7 @@ describe "Refresh Token Flow" do
|
|
111
111
|
:access_token,
|
112
112
|
application: @client,
|
113
113
|
resource_owner_id: 1,
|
114
|
-
use_refresh_token: true
|
114
|
+
use_refresh_token: true,
|
115
115
|
)
|
116
116
|
end
|
117
117
|
|
@@ -120,14 +120,14 @@ describe "Refresh Token Flow" do
|
|
120
120
|
:access_token,
|
121
121
|
application: public_client,
|
122
122
|
resource_owner_id: 1,
|
123
|
-
use_refresh_token: true
|
123
|
+
use_refresh_token: true,
|
124
124
|
)
|
125
125
|
end
|
126
126
|
|
127
127
|
it "issues a new token without client_secret when refresh token was issued to a public client" do
|
128
128
|
post refresh_token_endpoint_url(
|
129
129
|
client_id: public_client.uid,
|
130
|
-
refresh_token: token_for_public_client.refresh_token
|
130
|
+
refresh_token: token_for_public_client.refresh_token,
|
131
131
|
)
|
132
132
|
|
133
133
|
new_token = Doorkeeper::AccessToken.last
|
@@ -146,7 +146,7 @@ describe "Refresh Token Flow" do
|
|
146
146
|
post refresh_token_endpoint_url(
|
147
147
|
client_id: "1",
|
148
148
|
client_secret: "1",
|
149
|
-
refresh_token: token_for_private_client.refresh_token
|
149
|
+
refresh_token: token_for_private_client.refresh_token,
|
150
150
|
)
|
151
151
|
|
152
152
|
should_not_have_json "refresh_token"
|
@@ -185,7 +185,7 @@ describe "Refresh Token Flow" do
|
|
185
185
|
end
|
186
186
|
create_resource_owner
|
187
187
|
_another_token = post password_token_endpoint_url(
|
188
|
-
client: @client, resource_owner: @resource_owner
|
188
|
+
client: @client, resource_owner: @resource_owner,
|
189
189
|
)
|
190
190
|
last_token.update_attribute :created_at, 5.seconds.ago
|
191
191
|
|
@@ -193,7 +193,7 @@ describe "Refresh Token Flow" do
|
|
193
193
|
:access_token,
|
194
194
|
application: @client,
|
195
195
|
resource_owner_id: @resource_owner.id,
|
196
|
-
use_refresh_token: true
|
196
|
+
use_refresh_token: true,
|
197
197
|
)
|
198
198
|
@token.update_attribute :expires_in, -100
|
199
199
|
end
|
@@ -201,7 +201,7 @@ describe "Refresh Token Flow" do
|
|
201
201
|
context "refresh_token revoked on use" do
|
202
202
|
it "client request a token after creating another token with the same user" do
|
203
203
|
post refresh_token_endpoint_url(
|
204
|
-
client: @client, refresh_token: @token.refresh_token
|
204
|
+
client: @client, refresh_token: @token.refresh_token,
|
205
205
|
)
|
206
206
|
|
207
207
|
should_have_json "refresh_token", last_token.refresh_token
|
@@ -216,7 +216,7 @@ describe "Refresh Token Flow" do
|
|
216
216
|
|
217
217
|
it "client request a token after creating another token with the same user" do
|
218
218
|
post refresh_token_endpoint_url(
|
219
|
-
client: @client, refresh_token: @token.refresh_token
|
219
|
+
client: @client, refresh_token: @token.refresh_token,
|
220
220
|
)
|
221
221
|
|
222
222
|
should_have_json "refresh_token", last_token.refresh_token
|
@@ -226,7 +226,7 @@ describe "Refresh Token Flow" do
|
|
226
226
|
|
227
227
|
def last_token
|
228
228
|
Doorkeeper::AccessToken.last_authorized_token_for(
|
229
|
-
@client.id, @resource_owner.id
|
229
|
+
@client.id, @resource_owner.id,
|
230
230
|
)
|
231
231
|
end
|
232
232
|
end
|
@@ -11,10 +11,12 @@ describe "Revoke Token Flow" do
|
|
11
11
|
let(:client_application) { FactoryBot.create :application }
|
12
12
|
let(:resource_owner) { User.create!(name: "John", password: "sekret") }
|
13
13
|
let(:access_token) do
|
14
|
-
FactoryBot.create(
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
FactoryBot.create(
|
15
|
+
:access_token,
|
16
|
+
application: client_application,
|
17
|
+
resource_owner_id: resource_owner.id,
|
18
|
+
use_refresh_token: true,
|
19
|
+
)
|
18
20
|
end
|
19
21
|
|
20
22
|
context "with authenticated, confidential OAuth 2.0 client/application" do
|
@@ -100,10 +102,12 @@ describe "Revoke Token Flow" do
|
|
100
102
|
|
101
103
|
context "with public OAuth 2.0 client/application" do
|
102
104
|
let(:access_token) do
|
103
|
-
FactoryBot.create(
|
104
|
-
|
105
|
-
|
106
|
-
|
105
|
+
FactoryBot.create(
|
106
|
+
:access_token,
|
107
|
+
application: nil,
|
108
|
+
resource_owner_id: resource_owner.id,
|
109
|
+
use_refresh_token: true,
|
110
|
+
)
|
107
111
|
end
|
108
112
|
|
109
113
|
it "should revoke the access token provided" do
|
@@ -122,10 +126,12 @@ describe "Revoke Token Flow" do
|
|
122
126
|
|
123
127
|
context "with a valid token issued for a confidential client" do
|
124
128
|
let(:access_token) do
|
125
|
-
FactoryBot.create(
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
+
FactoryBot.create(
|
130
|
+
:access_token,
|
131
|
+
application: client_application,
|
132
|
+
resource_owner_id: resource_owner.id,
|
133
|
+
use_refresh_token: true,
|
134
|
+
)
|
129
135
|
end
|
130
136
|
|
131
137
|
it "should not revoke the access token provided" do
|
data/spec/spec_helper.rb
CHANGED
@@ -29,12 +29,9 @@ end
|
|
29
29
|
|
30
30
|
Doorkeeper::RSpec.print_configuration_info
|
31
31
|
|
32
|
-
# Remove after dropping support of Rails 4.2
|
33
|
-
require "#{File.dirname(__FILE__)}/support/http_method_shim"
|
34
|
-
|
35
32
|
require "support/orm/#{DOORKEEPER_ORM}"
|
36
33
|
|
37
|
-
Dir["#{File.dirname(__FILE__)}/support/{dependencies,helpers,shared}/*.rb"].each { |file| require file }
|
34
|
+
Dir["#{File.dirname(__FILE__)}/support/{dependencies,helpers,shared}/*.rb"].sort.each { |file| require file }
|
38
35
|
|
39
36
|
RSpec.configure do |config|
|
40
37
|
config.infer_spec_type_from_file_location!
|
@@ -4,14 +4,16 @@ shared_context "valid token", token: :valid do
|
|
4
4
|
let(:token_string) { "1A2B3C4D" }
|
5
5
|
|
6
6
|
let :token do
|
7
|
-
double(
|
8
|
-
|
9
|
-
|
7
|
+
double(
|
8
|
+
Doorkeeper::AccessToken,
|
9
|
+
accessible?: true, includes_scope?: true, acceptable?: true,
|
10
|
+
previous_refresh_token: "", revoke_previous_refresh_token!: true,
|
11
|
+
)
|
10
12
|
end
|
11
13
|
|
12
14
|
before :each do
|
13
15
|
allow(
|
14
|
-
Doorkeeper::AccessToken
|
16
|
+
Doorkeeper::AccessToken,
|
15
17
|
).to receive(:by_token).with(token_string).and_return(token)
|
16
18
|
end
|
17
19
|
end
|
@@ -20,15 +22,17 @@ shared_context "invalid token", token: :invalid do
|
|
20
22
|
let(:token_string) { "1A2B3C4D" }
|
21
23
|
|
22
24
|
let :token do
|
23
|
-
double(
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
double(
|
26
|
+
Doorkeeper::AccessToken,
|
27
|
+
accessible?: false, revoked?: false, expired?: false,
|
28
|
+
includes_scope?: false, acceptable?: false,
|
29
|
+
previous_refresh_token: "", revoke_previous_refresh_token!: true,
|
30
|
+
)
|
27
31
|
end
|
28
32
|
|
29
33
|
before :each do
|
30
34
|
allow(
|
31
|
-
Doorkeeper::AccessToken
|
35
|
+
Doorkeeper::AccessToken,
|
32
36
|
).to receive(:by_token).with(token_string).and_return(token)
|
33
37
|
end
|
34
38
|
end
|
@@ -72,15 +76,17 @@ shared_context "expired token", token: :expired do
|
|
72
76
|
end
|
73
77
|
|
74
78
|
let :token do
|
75
|
-
double(
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
+
double(
|
80
|
+
Doorkeeper::AccessToken,
|
81
|
+
accessible?: false, revoked?: false, expired?: true,
|
82
|
+
includes_scope?: false, acceptable?: false,
|
83
|
+
previous_refresh_token: "", revoke_previous_refresh_token!: true,
|
84
|
+
)
|
79
85
|
end
|
80
86
|
|
81
87
|
before :each do
|
82
88
|
allow(
|
83
|
-
Doorkeeper::AccessToken
|
89
|
+
Doorkeeper::AccessToken,
|
84
90
|
).to receive(:by_token).with(token_string).and_return(token)
|
85
91
|
end
|
86
92
|
end
|
@@ -91,15 +97,17 @@ shared_context "revoked token", token: :revoked do
|
|
91
97
|
end
|
92
98
|
|
93
99
|
let :token do
|
94
|
-
double(
|
95
|
-
|
96
|
-
|
97
|
-
|
100
|
+
double(
|
101
|
+
Doorkeeper::AccessToken,
|
102
|
+
accessible?: false, revoked?: true, expired?: false,
|
103
|
+
includes_scope?: false, acceptable?: false,
|
104
|
+
previous_refresh_token: "", revoke_previous_refresh_token!: true,
|
105
|
+
)
|
98
106
|
end
|
99
107
|
|
100
108
|
before :each do
|
101
109
|
allow(
|
102
|
-
Doorkeeper::AccessToken
|
110
|
+
Doorkeeper::AccessToken,
|
103
111
|
).to receive(:by_token).with(token_string).and_return(token)
|
104
112
|
end
|
105
113
|
end
|
@@ -110,14 +118,16 @@ shared_context "forbidden token", token: :forbidden do
|
|
110
118
|
end
|
111
119
|
|
112
120
|
let :token do
|
113
|
-
double(
|
114
|
-
|
115
|
-
|
121
|
+
double(
|
122
|
+
Doorkeeper::AccessToken,
|
123
|
+
accessible?: true, includes_scope?: true, acceptable?: false,
|
124
|
+
previous_refresh_token: "", revoke_previous_refresh_token!: true,
|
125
|
+
)
|
116
126
|
end
|
117
127
|
|
118
128
|
before :each do
|
119
129
|
allow(
|
120
|
-
Doorkeeper::AccessToken
|
130
|
+
Doorkeeper::AccessToken,
|
121
131
|
).to receive(:by_token).with(token_string).and_return(token)
|
122
132
|
end
|
123
133
|
end
|
@@ -100,7 +100,7 @@ describe Doorkeeper::RedirectUriValidator do
|
|
100
100
|
it "accepts a non secured protocol when disabled" do
|
101
101
|
subject.redirect_uri = "http://example.com/callback"
|
102
102
|
allow(Doorkeeper.configuration).to receive(
|
103
|
-
:force_ssl_in_redirect_uri
|
103
|
+
:force_ssl_in_redirect_uri,
|
104
104
|
).and_return(false)
|
105
105
|
expect(subject).to be_valid
|
106
106
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Elias Philipp
|
@@ -250,7 +250,7 @@ files:
|
|
250
250
|
- lib/doorkeeper/oauth/client/credentials.rb
|
251
251
|
- lib/doorkeeper/oauth/client_credentials/creator.rb
|
252
252
|
- lib/doorkeeper/oauth/client_credentials/issuer.rb
|
253
|
-
- lib/doorkeeper/oauth/client_credentials/
|
253
|
+
- lib/doorkeeper/oauth/client_credentials/validator.rb
|
254
254
|
- lib/doorkeeper/oauth/client_credentials_request.rb
|
255
255
|
- lib/doorkeeper/oauth/code_request.rb
|
256
256
|
- lib/doorkeeper/oauth/code_response.rb
|
@@ -275,6 +275,9 @@ files:
|
|
275
275
|
- lib/doorkeeper/orm/active_record/access_grant.rb
|
276
276
|
- lib/doorkeeper/orm/active_record/access_token.rb
|
277
277
|
- lib/doorkeeper/orm/active_record/application.rb
|
278
|
+
- lib/doorkeeper/orm/active_record/mixins/access_grant.rb
|
279
|
+
- lib/doorkeeper/orm/active_record/mixins/access_token.rb
|
280
|
+
- lib/doorkeeper/orm/active_record/mixins/application.rb
|
278
281
|
- lib/doorkeeper/orm/active_record/redirect_uri_validator.rb
|
279
282
|
- lib/doorkeeper/orm/active_record/stale_records_cleaner.rb
|
280
283
|
- lib/doorkeeper/rails/helpers.rb
|
@@ -444,7 +447,6 @@ files:
|
|
444
447
|
- spec/support/helpers/model_helper.rb
|
445
448
|
- spec/support/helpers/request_spec_helper.rb
|
446
449
|
- spec/support/helpers/url_helper.rb
|
447
|
-
- spec/support/http_method_shim.rb
|
448
450
|
- spec/support/orm/active_record.rb
|
449
451
|
- spec/support/shared/controllers_shared_context.rb
|
450
452
|
- spec/support/shared/hashing_shared_context.rb
|
@@ -476,7 +478,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
476
478
|
- !ruby/object:Gem::Version
|
477
479
|
version: '0'
|
478
480
|
requirements: []
|
479
|
-
rubygems_version: 3.
|
481
|
+
rubygems_version: 3.1.2
|
480
482
|
signing_key:
|
481
483
|
specification_version: 4
|
482
484
|
summary: OAuth 2 provider for Rails and Grape
|
@@ -611,7 +613,6 @@ test_files:
|
|
611
613
|
- spec/support/helpers/model_helper.rb
|
612
614
|
- spec/support/helpers/request_spec_helper.rb
|
613
615
|
- spec/support/helpers/url_helper.rb
|
614
|
-
- spec/support/http_method_shim.rb
|
615
616
|
- spec/support/orm/active_record.rb
|
616
617
|
- spec/support/shared/controllers_shared_context.rb
|
617
618
|
- spec/support/shared/hashing_shared_context.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Rails 5 deprecates calling HTTP action methods with positional arguments
|
4
|
-
# in favor of keyword arguments. However, the keyword argument form is only
|
5
|
-
# supported in Rails 5+. Since we support back to 4, we need some sort of shim
|
6
|
-
# to avoid super noisy deprecations when running tests.
|
7
|
-
module RoutingHTTPMethodShim
|
8
|
-
def get(path, **args)
|
9
|
-
super(path, args[:params], args[:headers])
|
10
|
-
end
|
11
|
-
|
12
|
-
def post(path, **args)
|
13
|
-
super(path, args[:params], args[:headers])
|
14
|
-
end
|
15
|
-
|
16
|
-
def put(path, **args)
|
17
|
-
super(path, args[:params], args[:headers])
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module ControllerHTTPMethodShim
|
22
|
-
def process(action, http_method = "GET", **args)
|
23
|
-
if (as = args.delete(:as))
|
24
|
-
@request.headers["Content-Type"] = Mime[as].to_s
|
25
|
-
end
|
26
|
-
|
27
|
-
super(action, http_method, args[:params], args[:session], args[:flash])
|
28
|
-
end
|
29
|
-
end
|