fridge 0.4.3 → 0.4.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c01604ddabbbd9a954e9fe73e1567aa0232509c30ed09e7694315131e0402abf
4
- data.tar.gz: fd4199b0194b7a63e7062c630dc9bb58c75eab607e27ebf13d24fe001a654c40
3
+ metadata.gz: f95fc7ff6e87f6f8d584736fe30f491611b63fc216e0d4453fccfa6f83d46c98
4
+ data.tar.gz: 02b45faa47f7bcfa6bb572247d1f331a99d254e28e6d28eb982589ebc812dcdc
5
5
  SHA512:
6
- metadata.gz: 2df7422238fac73bb4263af3af697d049b8ae870ed4c1610c40fdde3bcfd422b0cf8ac5f92a3889201b2aec5d222cda04fc49f5ee1797f6a0a2e3ea615094cb7
7
- data.tar.gz: e11293fdad80f5a7dfa6f6538b244f67ed59fc8e9867dde34c49c1067555936881b4d7b0de9f0ab5910a2a57b6d68dec0bd76462c888f7531c12ccdd6beb5d47
6
+ metadata.gz: 1fd27cadc2aadbf83e25d3b6215d504123438f401a36e614ed2c6734476cf53acb78f2d8a9d1957bffeecec071202ddca4f4ce746c319a4fcdc14ec771763ab7
7
+ data.tar.gz: 00ade0f6d5133df541f4859904cc76951407d058d90c93ddb7b4e8f4925848242c6d86c6e91fca9bb0efbc0438b93c5e211f8f85273cf5e4a0259c0d5eb161f7
data/.travis.yml CHANGED
@@ -3,3 +3,4 @@ rvm:
3
3
  - 2.2
4
4
  - 2.5
5
5
  - 2.6
6
+ - 3.1
data/Gemfile CHANGED
@@ -1,7 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'activesupport', '~> 4.0'
4
- gem 'nokogiri', '~> 1.9.1'
5
-
6
3
  # Specify your gem's dependencies in fridge.gemspec
7
4
  gemspec
data/fridge.gemspec CHANGED
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'jwt', '~> 1.5.6'
25
25
 
26
26
  spec.add_development_dependency 'aptible-tasks'
27
- spec.add_development_dependency 'bundler', '~> 1.5'
28
27
  spec.add_development_dependency 'pry'
29
28
  spec.add_development_dependency 'rails'
30
29
  spec.add_development_dependency 'rake'
@@ -126,7 +126,11 @@ module Fridge
126
126
  end
127
127
 
128
128
  def auth_domain
129
- Aptible::Auth.configuration.root_url.sub(%r{^https?://}, '')
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
@@ -1,3 +1,3 @@
1
1
  module Fridge
2
- VERSION = '0.4.3'.freeze
2
+ VERSION = '0.4.5'.freeze
3
3
  end
@@ -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.3
4
+ version: 0.4.5
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-01-26 00:00:00.000000000 Z
11
+ date: 2022-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: bundler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.5'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.5'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: pry
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -183,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
169
  - !ruby/object:Gem::Version
184
170
  version: '0'
185
171
  requirements: []
186
- rubygems_version: 3.0.3
172
+ rubygems_version: 3.0.3.1
187
173
  signing_key:
188
174
  specification_version: 4
189
175
  summary: Token validation for distributed resource servers