doorkeeper 5.9.1 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +1 -0
- data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +1 -0
- data/lib/doorkeeper/orm/active_record/mixins/application.rb +7 -0
- data/lib/doorkeeper/orm/active_record.rb +8 -16
- data/lib/doorkeeper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5511de8196966ae7db845cac15ebcef1be9f3b2ad6861b677cdc9ca80783c775
|
|
4
|
+
data.tar.gz: a939acb1f8734a1d6f2dedd58c5f006fb8db1726c6f87f0c4a14eec8f37ae7e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aaee9b32df715f74aa621e256c284a7a968f78ee11183d9b5e43695c0c59bbb1de0559ce8b4e232d5d4b9e4c404b8a926fa4a9f4c7e3c52da3c0f9f19cd6b169
|
|
7
|
+
data.tar.gz: 92a836decf7418aa5bedb7793d9c924486b35485e9c0706e96064a7c984fcd90c204eef8c8260de30b89e501f1a71bb4372b01c8050cb96b638c5d68bd4c512a
|
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,13 @@ User-visible changes worth mentioning.
|
|
|
7
7
|
|
|
8
8
|
## main
|
|
9
9
|
|
|
10
|
-
-
|
|
10
|
+
- Please add here
|
|
11
|
+
|
|
12
|
+
## 5.9.2
|
|
13
|
+
|
|
14
|
+
- [#1822][#1823][#1825] Update Rubocop config, auto-corrections and codebase cleanup.
|
|
15
|
+
- [#1830] Fix `NameError: uninitialized constant ApplicationRecord` on `rails db:seed` (and other non-eager-loading flows) caused by `on_load(:active_record)` firing re-entrantly during `ApplicationRecord` autoload. The orm hooks no longer depend on `ActiveSupport.on_load(:active_record)`; model concerns (`Ownership`, `PolymorphicResourceOwner::ForAccessGrant`, `PolymorphicResourceOwner::ForAccessToken`) are now wired up from each `Mixins::*` `included` block, which fires at parent-class autoload time — after `Doorkeeper.configure` has applied user settings and without re-entering the AR load chain.
|
|
16
|
+
- **Upgrade note**: fully custom model classes that don't include `Doorkeeper::Orm::ActiveRecord::Mixins::{Application,AccessToken,AccessGrant}` will no longer auto-receive `Ownership` / `PolymorphicResourceOwner` concerns (previously injected by `run_orm_hooks` via the configured class name). Either inherit from the Doorkeeper default model, include the corresponding `Mixins::*` module, or `include` the concerns directly.
|
|
11
17
|
|
|
12
18
|
## 5.9.1
|
|
13
19
|
|
|
@@ -9,6 +9,7 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
|
|
|
9
9
|
self.strict_loading_by_default = false if respond_to?(:strict_loading_by_default)
|
|
10
10
|
|
|
11
11
|
include ::Doorkeeper::AccessGrantMixin
|
|
12
|
+
include ::Doorkeeper::Models::PolymorphicResourceOwner::ForAccessGrant
|
|
12
13
|
|
|
13
14
|
belongs_to :application, class_name: Doorkeeper.config.application_class.to_s,
|
|
14
15
|
optional: true,
|
|
@@ -9,6 +9,7 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
|
|
|
9
9
|
self.strict_loading_by_default = false if respond_to?(:strict_loading_by_default)
|
|
10
10
|
|
|
11
11
|
include ::Doorkeeper::AccessTokenMixin
|
|
12
|
+
include ::Doorkeeper::Models::PolymorphicResourceOwner::ForAccessToken
|
|
12
13
|
|
|
13
14
|
belongs_to :application, class_name: Doorkeeper.config.application_class.to_s,
|
|
14
15
|
inverse_of: :access_tokens,
|
|
@@ -9,6 +9,13 @@ module Doorkeeper::Orm::ActiveRecord::Mixins
|
|
|
9
9
|
self.strict_loading_by_default = false if respond_to?(:strict_loading_by_default)
|
|
10
10
|
|
|
11
11
|
include ::Doorkeeper::ApplicationMixin
|
|
12
|
+
# Included unconditionally: this block runs once at parent-class
|
|
13
|
+
# autoload time, so gating on `enable_application_owner?` would
|
|
14
|
+
# freeze behavior at first-load time. The actual owner validation
|
|
15
|
+
# is still gated dynamically via `validate_owner?` →
|
|
16
|
+
# `confirm_application_owner?`, and `belongs_to :owner` is lazy on
|
|
17
|
+
# schemas that lack the columns.
|
|
18
|
+
include ::Doorkeeper::Models::Ownership
|
|
12
19
|
|
|
13
20
|
has_many :access_grants,
|
|
14
21
|
foreign_key: :application_id,
|
|
@@ -28,22 +28,14 @@ module Doorkeeper
|
|
|
28
28
|
autoload :Application, "doorkeeper/orm/active_record/mixins/application"
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if Doorkeeper.config.enable_application_owner?
|
|
40
|
-
Doorkeeper.config.application_model.include ::Doorkeeper::Models::Ownership
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
Doorkeeper.config.access_grant_model.include ::Doorkeeper::Models::PolymorphicResourceOwner::ForAccessGrant
|
|
44
|
-
Doorkeeper.config.access_token_model.include ::Doorkeeper::Models::PolymorphicResourceOwner::ForAccessToken
|
|
45
|
-
end
|
|
46
|
-
end
|
|
31
|
+
# Kept as a no-op so `Doorkeeper.run_orm_hooks` (and any plugin that
|
|
32
|
+
# checks `respond_to?(:run_hooks)`) stays quiet. The model concerns
|
|
33
|
+
# that used to be wired up here are now included from each Mixin's
|
|
34
|
+
# `included` block, which runs at parent-class autoload time — well
|
|
35
|
+
# after `Doorkeeper.configure` has applied user settings, and without
|
|
36
|
+
# touching `ActiveSupport.on_load(:active_record)` (whose re-entrant
|
|
37
|
+
# firing during `ApplicationRecord` autoload caused #1828).
|
|
38
|
+
def self.run_hooks; end
|
|
47
39
|
end
|
|
48
40
|
end
|
|
49
41
|
end
|
data/lib/doorkeeper/version.rb
CHANGED