anycable-rails-core 1.5.1 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/anycable/rails/action_cable_ext/broadcast_options.rb +1 -1
- data/lib/anycable/rails/config.rb +2 -1
- data/lib/anycable/rails/rack.rb +3 -5
- data/lib/anycable/rails/railtie.rb +8 -0
- data/lib/anycable/rails/version.rb +1 -1
- data/lib/generators/anycable/setup/setup_generator.rb +0 -14
- metadata +8 -3
- data/lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae33f5aaf1057a1aa63e16280048477ed7f6be5ff403e7a45bd4198aed3ef226
|
4
|
+
data.tar.gz: dfedd48dbeddaf2e722093bec52f459c576c59a3c549e26afe00753ee770496b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e84c51f6fb7b2c7e7a1b1535b2f99b4db0d83ee3235b45104aad07e353924bf2ce91269b4dbb9b992f356a622594f3c2e44941edf60b47be899196ee8adfd83
|
7
|
+
data.tar.gz: 6b9b15397056c29d3cbf01b566ea4282e41dc2065f8af827bb73f102c47e78d429aecbfd11d687660eb4c820225fa3411d9bd7bd4fb39a75155568a0e4e24e05
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.5.3 (2024-09-12)
|
6
|
+
|
7
|
+
- Set upper limit on supported Rails versions. ([@palkan][])
|
8
|
+
|
9
|
+
The current release series is unlikely to not work with Rails 8. Let's prevent using them together.
|
10
|
+
|
11
|
+
## 1.5.2 (2024-07-01)
|
12
|
+
|
13
|
+
- Automatically add `Warden::Manager` to the AnyCable middleware stack when Devise is present. ([@lHydra][])
|
14
|
+
|
5
15
|
## 1.5.1 (2024-04-05)
|
6
16
|
|
7
17
|
- Add `anycable-rails-core.rb` to avoid adding `require: ["anycable-rails"]` to Gemfiles manually. ([@palkan][])
|
@@ -265,3 +275,4 @@ See [Changelog](https://github.com/anycable/anycable-rails/blob/0-6-stable/CHANG
|
|
265
275
|
[@DmitryTsepelev]: https://github.com/DmitryTsepelev
|
266
276
|
[@sponomarev]: https://github.com/sponomarev
|
267
277
|
[@bibendi]: https://github.com/bibendi
|
278
|
+
[@lHydra]: http://github.com/lHydra
|
@@ -22,6 +22,7 @@ AnyCable::Config.attr_config(
|
|
22
22
|
batch_broadcasts: false,
|
23
23
|
socket_id_header: "X-Socket-ID",
|
24
24
|
disable_rpc_pool_size_warning: false,
|
25
|
-
websocket_url: nil
|
25
|
+
websocket_url: nil,
|
26
|
+
use_warden_manager: true
|
26
27
|
)
|
27
28
|
AnyCable::Config.ignore_options :access_logs_disabled, :persistent_session_enabled
|
data/lib/anycable/rails/rack.rb
CHANGED
@@ -15,14 +15,12 @@ module AnyCable
|
|
15
15
|
# For instance, consider the Rails session middleware: it's responsible for restoring the
|
16
16
|
# session data from cookies.
|
17
17
|
#
|
18
|
-
# AnyCable adds session
|
18
|
+
# AnyCable adds session middleware by default to its own stack.
|
19
19
|
#
|
20
|
-
# You can also use any Rack/Rails middleware you want. For example, to enable
|
20
|
+
# You can also use any Rack/Rails middleware you want. For example, to enable CustomMiddleware
|
21
21
|
# you can add the following code to an initializer or any other configuration file:
|
22
22
|
#
|
23
|
-
# AnyCable::Rails::Rack.middleware.use
|
24
|
-
# Devise.warden_config = config
|
25
|
-
# end
|
23
|
+
# AnyCable::Rails::Rack.middleware.use CustomMiddleware
|
26
24
|
module Rack
|
27
25
|
def self.app_build_lock
|
28
26
|
@app_build_lock
|
@@ -154,6 +154,14 @@ module AnyCable
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
+
initializer "anycable.warden_manager" do
|
158
|
+
if defined?(::Devise) && AnyCable.config.use_warden_manager?
|
159
|
+
AnyCable::Rails::Rack.middleware.use Warden::Manager do |config|
|
160
|
+
::Devise.warden_config = config
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
157
165
|
# Since Rails 6.1
|
158
166
|
if respond_to?(:server)
|
159
167
|
server do
|
@@ -65,16 +65,6 @@ module AnyCableRailsGenerators
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
def devise
|
69
|
-
return unless devise?
|
70
|
-
|
71
|
-
inside("config/initializers") do
|
72
|
-
template "anycable.rb"
|
73
|
-
end
|
74
|
-
|
75
|
-
say_status :info, "✅ config/initializers/anycable.rb with Devise configuration has been added"
|
76
|
-
end
|
77
|
-
|
78
68
|
def configs
|
79
69
|
inside("config") do
|
80
70
|
template "anycable.yml"
|
@@ -124,10 +114,6 @@ module AnyCableRailsGenerators
|
|
124
114
|
!!gemfile_lock&.match?(/^\s+rubocop\b/)
|
125
115
|
end
|
126
116
|
|
127
|
-
def devise?
|
128
|
-
!!gemfile_lock&.match?(/^\s+devise\b/)
|
129
|
-
end
|
130
|
-
|
131
117
|
def local?
|
132
118
|
@devenv == "local"
|
133
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anycable-rails-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anycable-core
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '6.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '8'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '6.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '8'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: globalid
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +113,6 @@ files:
|
|
107
113
|
- lib/generators/anycable/setup/templates/bin/anycable-go.tt
|
108
114
|
- lib/generators/anycable/setup/templates/config/anycable.yml.tt
|
109
115
|
- lib/generators/anycable/setup/templates/config/cable.yml.tt
|
110
|
-
- lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt
|
111
116
|
- lib/generators/anycable/with_os_helpers.rb
|
112
117
|
homepage: http://github.com/anycable/anycable-rails
|
113
118
|
licenses:
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Add Warden middleware to AnyCable stack to allow accessing
|
4
|
-
# Devise current user via `env["warden"].user`.
|
5
|
-
#
|
6
|
-
# See <%= DOCS_ROOT %>/ruby/authentication
|
7
|
-
#
|
8
|
-
# NOTE: This is only needed in environments where you use AnyCable.
|
9
|
-
if defined?(AnyCable::Rails)
|
10
|
-
AnyCable::Rails::Rack.middleware.use Warden::Manager do |config|
|
11
|
-
Devise.warden_config = config
|
12
|
-
end
|
13
|
-
end
|