fridge 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fridge/rails_helpers.rb +5 -1
- data/lib/fridge/version.rb +1 -1
- data/spec/fridge/rails_helpers_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2d340550f97b33c430967cef5b8de4a59b73acfdd5a1ce62ad3ee7d17a6f8c9
|
4
|
+
data.tar.gz: 06a758734a6b6e668043c3bffe2cf350495325dfdab4f73948e2788f97d5c89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8b53167a69aaf39d60b4abbe6ad347968efddc1b2333dc12136b730600d65ab0c72fc8c7416d190b33fc55ce3571d8b98cbf1322c7a0eddd46c46517114cc0c
|
7
|
+
data.tar.gz: 0632f0de72e4654663256000e201568745697a05170e49191d31598a9a5bd2f6158871379253bee1302d3b10ebf76c5a6b84d2baae803cf8fd935bb4324a47b3
|
data/lib/fridge/rails_helpers.rb
CHANGED
@@ -126,7 +126,11 @@ module Fridge
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def auth_domain
|
129
|
-
Aptible::Auth.configuration.root_url.
|
129
|
+
domain = URI.parse(Aptible::Auth.configuration.root_url).host
|
130
|
+
|
131
|
+
# On localhost we fall back to the default setting b/c browsers won't set
|
132
|
+
# cookies if localhost is named
|
133
|
+
domain == 'localhost' ? :all : domain
|
130
134
|
rescue StandardError
|
131
135
|
'auth.aptible.com'
|
132
136
|
end
|
data/lib/fridge/version.rb
CHANGED
@@ -215,5 +215,25 @@ describe Fridge::RailsHelpers do
|
|
215
215
|
expect(options[:domain]).to eq 'auth.aptible.com'
|
216
216
|
expect(options[:foobar]).to eq true
|
217
217
|
end
|
218
|
+
|
219
|
+
it 'restricts cookies to the specific subdomain' do
|
220
|
+
auth = class_double('Aptible::Auth').as_stubbed_const
|
221
|
+
allow(auth).to receive_message_chain(:configuration, :root_url) do
|
222
|
+
'https://auth-bob.aptible-sandbox.com'
|
223
|
+
end
|
224
|
+
|
225
|
+
options = controller.fridge_cookie_options
|
226
|
+
expect(options[:domain]).to eq 'auth-bob.aptible-sandbox.com'
|
227
|
+
end
|
228
|
+
|
229
|
+
it 'handles local development using defaults' do
|
230
|
+
auth = class_double('Aptible::Auth').as_stubbed_const
|
231
|
+
allow(auth).to receive_message_chain(:configuration, :root_url) do
|
232
|
+
'https://localhost:4000'
|
233
|
+
end
|
234
|
+
|
235
|
+
options = controller.fridge_cookie_options
|
236
|
+
expect(options[:domain]).to eq :all
|
237
|
+
end
|
218
238
|
end
|
219
239
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fridge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_config
|