barkibu-kb-fake 0.32.0 → 1.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kb/fake/api.rb +10 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b633ee90bb1180e33adffcf4e9c7ac04f92daab00389dcf258d1b1f89d1565fe
4
- data.tar.gz: b11eb625fe4f4b99d3bf1f4f4a43135082019e8392873b85ba4fa6eb4f634b65
3
+ metadata.gz: 907f498f343e4c4975045fc803afcb3270aeccb8e2dc8d82e3bde88cedc477f8
4
+ data.tar.gz: 39b6f7c012044e53755b131d77b8a7a17776f217e86762253e645ede225d4528
5
5
  SHA512:
6
- metadata.gz: ab8c2b4250aa1eb6051fe526f0837da476f88bd22c038994892a25b13bd31b1fef55832c7f06c8c748cc4509644056b9e855ad0b902f2db148ad56e5a47cad8a
7
- data.tar.gz: 167031a7ad512139fa61edf1b1e9c7f9f96fd54ad09df4c1f9d7cd0e6566bc81ed01e8d3d1b468abf7cd1435bfe3a5aeac736bb8d21ccf1365621bcb66c19fdc
6
+ metadata.gz: aa1746510325a99076034dfe8f3712a142ee07a2a5d35246c981e6fa40178e426ec4a4fd81b5e35d04b5235ad5112fdcd978dd75e3c2f6a3c9278a19cf1ddcec
7
+ data.tar.gz: 7549f1944a4a05f84dc54b09d6c2a58342ed9f34aae0a4ac633f1819b084dcb43885090ebb9de7d57457372aba5c35480f83432677490bdac2cc467ea3fac6c5
data/lib/kb/fake/api.rb CHANGED
@@ -44,6 +44,16 @@ module KB
44
44
  include BoundedContext::PetFamily::PetContracts
45
45
  include BoundedContext::PetFamily::Products
46
46
 
47
+ # Sinatra >= 4.1 ships Rack::Protection::HostAuthorization, which authorizes
48
+ # on the Host header and, when it infers a development environment, only
49
+ # permits localhost-style hosts — rejecting requests addressed to the
50
+ # stubbed KB host with "403 Host not permitted". Permitting specific hosts
51
+ # on the consumer side is no fix either: with the net_http adapter WebMock
52
+ # intercepts before Net::HTTP adds the Host header, so the header is absent
53
+ # and can never match a permitted list. An empty list disables the check;
54
+ # it guards against DNS rebinding, which cannot apply to an in-process fake.
55
+ set :host_authorization, permitted_hosts: []
56
+
47
57
  set :state, ApiState.new
48
58
 
49
59
  def self.snapshot
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barkibu-kb-fake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Figea
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.32.0
18
+ version: 1.0.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.32.0
25
+ version: 1.0.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: countries
28
28
  requirement: !ruby/object:Gem::Requirement