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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99ce217ca2700339f5e12dbe053a99c982e371984d7b52341939c4af8c8dd8f2
4
- data.tar.gz: d653055f22c50b36201509cb9112a2dde807290bce92e8ccf7d4d53fcfe56628
3
+ metadata.gz: c629d2dc8da503bfa856a639b4462108d15f776554dca35dd2d02545bc0e2793
4
+ data.tar.gz: a8199f54a9af9b8fea60e9c772d845944925499067d3ce29d362ab4ad68f13fe
5
5
  SHA512:
6
- metadata.gz: 401d946022e824da7e263da2d8717af89d944bbf7c35ce4e7eab6e64643fdb0a402df73586d2df0e16a3bcb2e4a56f906a7e55f29e5ff496db25df108cc7bda9
7
- data.tar.gz: e073dbde5eb080f4d78db98c4842cbeafc22c58c4df6e41933321553327e0bdeffad0cd08d3c09d1f35193550b1d38a5814ee5e70125f28a5bbe98cb6839135c
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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  module RailsMultisite
4
- VERSION = "3.1.0"
4
+ VERSION = "4.0.0"
5
5
  end
@@ -7,3 +7,4 @@ require 'rails_multisite/railtie'
7
7
  require 'rails_multisite/formatter'
8
8
  require 'rails_multisite/connection_management'
9
9
  require 'rails_multisite/middleware'
10
+ require 'rails_multisite/cookie_salt'
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: 3.1.0
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-09-10 00:00:00.000000000 Z
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: []