doorkeeper 5.3.2 → 5.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a2e558c16d91012fda8543a405ee8e107ec3e100edc255ef9c0453e15fee34b
4
- data.tar.gz: 0e9ffe0268ccfb370ec23cd5c5b124e8febdec591cd0d5443974bd73942079f2
3
+ metadata.gz: 4d3ed9e21e9d404f1c7f67a48a36a5745d9a5a7aca05b9ae63fbd10c6d170ac1
4
+ data.tar.gz: 21ab4db448c9404a7067e8223433a8aa2ecfe955fd3729e7038efafd616c4237
5
5
  SHA512:
6
- metadata.gz: 11b2350bfbe3e18b7500b9a159096dda35fc2307f66ab5ccec9e1266c18a4fc34e1ac9a8ffa763f713cd431dbb9a5fee7734bcd9d6576b41749101e3f149e969
7
- data.tar.gz: 7fdb1df4a142ac870a3a37838c4131a7514f81571319339c115754bf92ad3ed97c9e5a543008b94da6117e854104e418052bb634a5e5fcfb460063ecb83c6b5d
6
+ metadata.gz: a03ea8dbf25bc5d48f2fa92942c73dfefa74978d16229b79f1f6d691e0d591ecdc08be84bc243139a1a4df50091fde2d039f5dcae65a8250477e309a31ad054d
7
+ data.tar.gz: 7f6445f2beb910ba6b3cdeebd5d0d265986f49bb400ccccdbd811f7be8e34e5e029e07acfe22330729fe9065169b1807a4c98094abf3d247fe7175a1cd52daf5
@@ -5,6 +5,10 @@ upgrade guides.
5
5
 
6
6
  User-visible changes worth mentioning.
7
7
 
8
+ ## 5.3.3
9
+
10
+ - [#1404] Backport: Make `Doorkeeper::Application#read_attribute_for_serialization` public.
11
+
8
12
  ## 5.3.2
9
13
 
10
14
  - [#1371] Backport: add `#as_json` method and attributes serialization restriction for Application model.
@@ -12,12 +12,12 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
12
12
  has_many :access_grants,
13
13
  foreign_key: :application_id,
14
14
  dependent: :delete_all,
15
- class_name: Doorkeeper.config.access_grant_class
15
+ class_name: Doorkeeper.config.access_grant_class.to_s
16
16
 
17
17
  has_many :access_tokens,
18
18
  foreign_key: :application_id,
19
19
  dependent: :delete_all,
20
- class_name: Doorkeeper.config.access_token_class
20
+ class_name: Doorkeeper.config.access_token_class.to_s
21
21
 
22
22
  validates :name, :secret, :uid, presence: true
23
23
  validates :uid, uniqueness: { case_sensitive: true }
@@ -31,7 +31,7 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
31
31
  has_many :authorized_tokens,
32
32
  -> { where(revoked_at: nil) },
33
33
  foreign_key: :application_id,
34
- class_name: Doorkeeper.config.access_token_class
34
+ class_name: Doorkeeper.config.access_token_class.to_s
35
35
 
36
36
  has_many :authorized_applications,
37
37
  through: :authorized_tokens,
@@ -84,6 +84,21 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
84
84
  end
85
85
  end
86
86
 
87
+ def authorized_for_resource_owner?(resource_owner)
88
+ Doorkeeper.configuration.authorize_resource_owner_for_client.call(self, resource_owner)
89
+ end
90
+
91
+ # We need to hook into this method to allow serializing plan-text secrets
92
+ # when secrets hashing enabled.
93
+ #
94
+ # @param key [String] attribute name
95
+ #
96
+ def read_attribute_for_serialization(key)
97
+ return super unless key.to_s == "secret"
98
+
99
+ plaintext_secret || secret
100
+ end
101
+
87
102
  private
88
103
 
89
104
  def generate_uid
@@ -91,7 +106,7 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
91
106
  end
92
107
 
93
108
  def generate_secret
94
- return unless secret.blank?
109
+ return if secret.present?
95
110
 
96
111
  renew_secret
97
112
  end
@@ -131,17 +146,6 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
131
146
  only.uniq
132
147
  end
133
148
 
134
- # We need to hook into this method to allow serializing plan-text secrets
135
- # when secrets hashing enabled.
136
- #
137
- # @param key [String] attribute name
138
- #
139
- def read_attribute_for_serialization(key)
140
- return super unless key.to_s == "secret"
141
-
142
- plaintext_secret || secret
143
- end
144
-
145
149
  # Collection of attributes that could be serialized for public.
146
150
  # Override this method if you need additional attributes to be serialized.
147
151
  #
@@ -153,7 +157,7 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
153
157
  end
154
158
  end
155
159
 
156
- class_methods do
160
+ module ClassMethods
157
161
  # Returns Applications associated with active (not revoked) Access Tokens
158
162
  # that are owned by the specific Resource Owner.
159
163
  #
@@ -9,7 +9,7 @@ module Doorkeeper
9
9
  # Semantic versioning
10
10
  MAJOR = 5
11
11
  MINOR = 3
12
- TINY = 2
12
+ TINY = 3
13
13
  PRE = nil
14
14
 
15
15
  # Full version number
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.2
4
+ version: 5.3.3
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-05-02 00:00:00.000000000 Z
14
+ date: 2020-05-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties
@@ -478,7 +478,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
478
478
  - !ruby/object:Gem::Version
479
479
  version: '0'
480
480
  requirements: []
481
- rubygems_version: 3.0.2
481
+ rubygems_version: 3.1.2
482
482
  signing_key:
483
483
  specification_version: 4
484
484
  summary: OAuth 2 provider for Rails and Grape