doorkeeper 5.3.0 → 5.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13bf83a25959d2152f6508e2e3c07f393d2b13f78c9d1eacb0aa58aead6872bc
4
- data.tar.gz: eb0ee49811f240ab19902d32a66d580fb8ea0d111cae312dbb207817d443034d
3
+ metadata.gz: bb82e22e68fdc6c80e3cb7b65d8a280e9893222a6bf3390f216f7bb534195682
4
+ data.tar.gz: 9299736f29bce52700adeb7dde05d9669294ce03457c683c0a80d6f98ac73346
5
5
  SHA512:
6
- metadata.gz: 8618a5f367b118059aef8bb970237ce83ed8fd056419523e15d71a59bdadc0bba1630774b116ca50f0f3bcf5300015bfcc3d7ecc6400207750fa823a50f459a2
7
- data.tar.gz: f377fe495a2414754dcfa7090743d16c7a908e32c316b122f7bb7d993eb81780910bd5d2661f63b94acdeed867bf1effdae3f636a859fa4e24d29e948aeccdb1
6
+ metadata.gz: 7e951c0a2ebaa747f03afb968fc8750c166beb8cb73600fcf1ce47546e25528daf815d424b85c8ac723f9ba83b100bbf9f55acf9e3240f21db43bd463ae0838f
7
+ data.tar.gz: f4e0bc0bf47e60407aae249b6d2eb7b485fe324e688caa43bb5db473c7b1393f973e00707edab007ddf5aee75007e1e6fcf4d2de8aa049ec16fa69cbbd082c7b
@@ -5,9 +5,9 @@ upgrade guides.
5
5
 
6
6
  User-visible changes worth mentioning.
7
7
 
8
- ## master
8
+ ## 5.3.1
9
9
 
10
- - [#PR ID] Your PR short description here.
10
+ - [#1360] Backport: Increase `matching_token_for` batch lookup size to 10 000 and make it configurable.
11
11
 
12
12
  ## 5.3.0
13
13
 
@@ -23,6 +23,10 @@ User-visible changes worth mentioning.
23
23
  If you were relying on access tokens being revoked once the same client
24
24
  requested a new access token, reenable it with `revoke_previous_client_credentials_token` in Doorkeeper
25
25
  initialization file.
26
+
27
+ ## 5.2.4
28
+
29
+ - [#1360] Backport: Increase `matching_token_for` batch lookup size to 10 000 and make it configurable.
26
30
 
27
31
  ## 5.2.3
28
32
 
@@ -268,6 +268,7 @@ module Doorkeeper
268
268
  option :active_record_options, default: {}
269
269
  option :grant_flows, default: %w[authorization_code client_credentials]
270
270
  option :handle_auth_errors, default: :render
271
+ option :token_lookup_batch_size, default: 10_000
271
272
 
272
273
  # Allows to customize OAuth grant flows that +each+ application support.
273
274
  # You can configure a custom block (or use a class respond to `#call`) that must
@@ -126,8 +126,9 @@ module Doorkeeper
126
126
  return nil unless relation
127
127
 
128
128
  matching_tokens = []
129
+ batch_size = Doorkeeper.configuration.token_lookup_batch_size
129
130
 
130
- find_access_token_in_batches(relation) do |batch|
131
+ find_access_token_in_batches(relation, batch_size: batch_size) do |batch|
131
132
  tokens = batch.select do |token|
132
133
  scopes_match?(token.scopes, scopes, application.try(:scopes))
133
134
  end
@@ -9,7 +9,7 @@ module Doorkeeper
9
9
  # Semantic versioning
10
10
  MAJOR = 5
11
11
  MINOR = 3
12
- TINY = 0
12
+ TINY = 1
13
13
  PRE = nil
14
14
 
15
15
  # Full version number
@@ -117,6 +117,14 @@ Doorkeeper.configure do
117
117
  #
118
118
  # reuse_access_token
119
119
 
120
+ # In case you enabled `reuse_access_token` option Doorkeeper will try to find matching
121
+ # token using `matching_token_for` Access Token API that searches for valid records
122
+ # in batches in order not to pollute the memory with all the database records. By default
123
+ # Doorkeeper uses batch size of 10 000 records. You can increase or decrease this value
124
+ # depending on your needs and server capabilities.
125
+ #
126
+ # token_lookup_batch_size 10_000
127
+
120
128
  # Set a limit for token_reuse if using reuse_access_token option
121
129
  #
122
130
  # This option limits token_reusability to some extent.
@@ -641,6 +641,21 @@ describe Doorkeeper, "configuration" do
641
641
  end
642
642
  end
643
643
 
644
+ describe "token_lookup_batch_size" do
645
+ it "uses default doorkeeper value" do
646
+ expect(subject.token_lookup_batch_size).to eq(10_000)
647
+ end
648
+
649
+ it "can change the value" do
650
+ Doorkeeper.configure do
651
+ orm DOORKEEPER_ORM
652
+ token_lookup_batch_size 100_000
653
+ end
654
+
655
+ expect(subject.token_lookup_batch_size).to eq(100_000)
656
+ end
657
+ end
658
+
644
659
  describe "strict_content_type" do
645
660
  it "is false by default" do
646
661
  expect(subject.enforce_content_type).to eq(false)
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.3.0
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felipe Elias Philipp
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-01-29 00:00:00.000000000 Z
14
+ date: 2020-02-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties