rails_multisite 3.1.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_multisite/cookie_salt.rb +16 -0
- data/lib/rails_multisite/middleware.rb +1 -0
- data/lib/rails_multisite/version.rb +1 -1
- data/lib/rails_multisite.rb +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c629d2dc8da503bfa856a639b4462108d15f776554dca35dd2d02545bc0e2793
|
4
|
+
data.tar.gz: a8199f54a9af9b8fea60e9c772d845944925499067d3ce29d362ab4ad68f13fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ea81350cad5b028a1d6558525d350b1dac376168249cb2fdcce148055fe7b86a53b3e4472815567f626025420dfd40156b84a0f6eb80ff714725df3a20d4bc
|
7
|
+
data.tar.gz: b68b07d983452e6b1d785f6e927450cfe761983123408fcc0e7cb4589c4be2d4855a0351964ce497a278c17c5ffcc378a57bbfb55bfdf8a4059466f438d03646
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RailsMultisite
|
4
|
+
class CookieSalt
|
5
|
+
COOKIE_SALT_KEYS = [
|
6
|
+
"action_dispatch.signed_cookie_salt",
|
7
|
+
"action_dispatch.encrypted_cookie_salt",
|
8
|
+
"action_dispatch.encrypted_signed_cookie_salt",
|
9
|
+
"action_dispatch.authenticated_encrypted_cookie_salt"
|
10
|
+
]
|
11
|
+
|
12
|
+
def self.update_cookie_salts(env:, host:)
|
13
|
+
COOKIE_SALT_KEYS.each { |key| env[key] = "#{env[key]} #{host}" }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -22,6 +22,7 @@ module RailsMultisite
|
|
22
22
|
|
23
23
|
ActiveRecord::Base.connection_handler.clear_active_connections!
|
24
24
|
ConnectionManagement.establish_connection(host: host, db: db)
|
25
|
+
CookieSalt.update_cookie_salts(env: env, host: host)
|
25
26
|
@app.call(env)
|
26
27
|
ensure
|
27
28
|
ActiveRecord::Base.connection_handler.clear_active_connections!
|
data/lib/rails_multisite.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_multisite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/rails_multisite/connection_management.rb
|
64
64
|
- lib/rails_multisite/connection_management/rails_60_compat.rb
|
65
65
|
- lib/rails_multisite/connection_management/rails_61_compat.rb
|
66
|
+
- lib/rails_multisite/cookie_salt.rb
|
66
67
|
- lib/rails_multisite/formatter.rb
|
67
68
|
- lib/rails_multisite/middleware.rb
|
68
69
|
- lib/rails_multisite/railtie.rb
|
@@ -72,7 +73,7 @@ files:
|
|
72
73
|
homepage: ''
|
73
74
|
licenses: []
|
74
75
|
metadata: {}
|
75
|
-
post_install_message:
|
76
|
+
post_install_message:
|
76
77
|
rdoc_options: []
|
77
78
|
require_paths:
|
78
79
|
- lib
|
@@ -88,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
89
|
version: '0'
|
89
90
|
requirements: []
|
90
91
|
rubygems_version: 3.1.6
|
91
|
-
signing_key:
|
92
|
+
signing_key:
|
92
93
|
specification_version: 4
|
93
94
|
summary: Multi tenancy support for Rails
|
94
95
|
test_files: []
|