tshield 0.11.10.0 → 0.11.11.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: 8771fe4287a4bcba7da31ade5a34ceb2dea60b466a9351a721f58187101691de
4
- data.tar.gz: 1087f349e8e938bc006a2e141f7f1b9fa45a02c8897b8f526d6edeecd325b8fe
3
+ metadata.gz: d529a1c1f05cdb1b55bf3c98e2f27734e4c4c0e629c42c5aaa47b47fbb915cbf
4
+ data.tar.gz: bed2c5eef5de6b373872a68726a18c1b9f6e2fcb7398000aa8166e9f30886693
5
5
  SHA512:
6
- metadata.gz: 74c12d46caf171caf03c44718d9ede0f1d56c8ca0d97bd36c9a8dac15634dcf30b5921bd5cc25be9a5c7108436bbd07737f18372768f8b6eb8269f0a7e7ad2a8
7
- data.tar.gz: 398f68a82cba538f947dae0a5a6726dcd3c388ecf22dcd3cbda5aa41321f2e10942ca1dd92feade540f595442934ce435daf33d0a9cb6c2aedbfe20c7bc02365
6
+ metadata.gz: ffd115c92396a127a7433ace24ac29057f28510dc60e1f2fb547cb4f421355acbab994a6ba2f54fa19a8ac2e7eaf3df6f353fc7aaae29e16bf9249046166fcd9
7
+ data.tar.gz: 2ac272848b9a0594a6969a0582ecd05f1d214a1061e855ea9144f8d1c17fce7fadf61cb2fe5c2cce91ce73e31e1f5e80f6b726e76bdb5eb21846eb66352040cd
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'https://rubygems.org'
4
-
4
+ gem 'sinatra-cross_origin'
5
5
  gemspec
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  require 'sinatra'
4
+ require 'sinatra/cross_origin'
4
5
 
5
6
  require 'tshield/options'
6
7
  require 'tshield/controllers/requests'
@@ -17,6 +18,22 @@ module TShield
17
18
  set :bind, '0.0.0.0'
18
19
  set :port, TShield::Options.instance.port
19
20
 
21
+ configure do
22
+ enable :cross_origin
23
+ end
24
+
25
+ before do
26
+ response.headers['Access-Control-Allow-Origin'] = '*'
27
+ end
28
+
29
+ options '*' do
30
+ response.headers['Allow'] = 'GET, PUT, POST, DELETE, OPTIONS'
31
+ response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type,
32
+ Accept, X-User-Email, X-Auth-Token'
33
+ response.headers['Access-Control-Allow-Origin'] = '*'
34
+ 200
35
+ end
36
+
20
37
  def self.register_resources
21
38
  load_controllers
22
39
  register TShield::Controllers::Sessions
@@ -5,7 +5,7 @@ module TShield
5
5
  class Version
6
6
  MAJOR = 0
7
7
  MINOR = 11
8
- PATCH = 10
8
+ PATCH = 11
9
9
  PRE = 0
10
10
 
11
11
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tshield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.10.0
4
+ version: 0.11.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Rubin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-01-14 00:00:00.000000000 Z
12
+ date: 2020-02-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: byebug
@@ -394,12 +394,12 @@ specification_version: 4
394
394
  summary: Proxy for mocks API responses
395
395
  test_files:
396
396
  - spec/spec_helper.rb
397
+ - spec/tshield/request_matching_spec.rb
397
398
  - spec/tshield/options_spec.rb
398
- - spec/tshield/configuration_spec.rb
399
- - spec/tshield/request_vcr_spec.rb
400
399
  - spec/tshield/controllers/requests_spec.rb
401
- - spec/tshield/after_filter_spec.rb
400
+ - spec/tshield/request_vcr_spec.rb
402
401
  - spec/tshield/fixtures/config/tshield.yml
403
402
  - spec/tshield/fixtures/matching/example.json
404
403
  - spec/tshield/fixtures/filters/example_filter.rb
405
- - spec/tshield/request_matching_spec.rb
404
+ - spec/tshield/configuration_spec.rb
405
+ - spec/tshield/after_filter_spec.rb