bowtie-io 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bowtie/middleware/policy_check.rb +6 -12
- data/lib/bowtie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e72bbf8a5ab9d5dd6b4a137fc2b59f1b324f51e
|
4
|
+
data.tar.gz: f6b35e5449efabf45da2458ff7acf48ed1578cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e3284cb488a17cb51b704515b5a454b7382c059ce00e6641b4182e2350fef54f11a37c99b72deb9cd3a3edbef8e028220e9fb4a40fcb94d071570858cb3e40
|
7
|
+
data.tar.gz: 42f1225f4a1d279227c8374f1464707411bbf4895ccc7de776edc266edff94337a0616151c7cb713307d601f1826ab86413c4d2c2805bc7bdc07c921767babed
|
@@ -50,8 +50,6 @@ module Bowtie::Middleware
|
|
50
50
|
CONFIG_PROFILE_KEY = 'profile'
|
51
51
|
CONFIG_STATUS_KEY = 'status'
|
52
52
|
|
53
|
-
def branch; 'development' end
|
54
|
-
|
55
53
|
def policy_records(source)
|
56
54
|
records = Dir["#{source}/**/.bowtie.yml"].collect { |path|
|
57
55
|
policy_records_for_path(path.gsub(source, ''), File.read(path))
|
@@ -63,8 +61,7 @@ module Bowtie::Middleware
|
|
63
61
|
end
|
64
62
|
|
65
63
|
def default_permit_all
|
66
|
-
Policy.new(
|
67
|
-
'',
|
64
|
+
Policy.new('',
|
68
65
|
nil,
|
69
66
|
nil,
|
70
67
|
0,
|
@@ -76,9 +73,9 @@ module Bowtie::Middleware
|
|
76
73
|
base_path = "/#{base_path}" unless base_path.start_with? '/'
|
77
74
|
base_path = base_path[0..-2] if base_path.end_with? '/'
|
78
75
|
|
79
|
-
|
76
|
+
environment_config = YAML.load(content) || {}
|
80
77
|
|
81
|
-
permitted_section_configs =
|
78
|
+
permitted_section_configs = environment_config[CONFIG_BLOCK_KEY] || []
|
82
79
|
permitted_section_configs = [permitted_section_configs] unless permitted_section_configs.is_a? Array
|
83
80
|
|
84
81
|
policy_records_from_permitted_section_configs(base_path, permitted_section_configs)
|
@@ -109,8 +106,7 @@ module Bowtie::Middleware
|
|
109
106
|
|
110
107
|
methods.each do |method|
|
111
108
|
plans.each do |plan|
|
112
|
-
records << Policy.new(
|
113
|
-
policy_path,
|
109
|
+
records << Policy.new(policy_path,
|
114
110
|
method,
|
115
111
|
plan,
|
116
112
|
policy_path.length,
|
@@ -167,8 +163,7 @@ module Bowtie::Middleware
|
|
167
163
|
end
|
168
164
|
end
|
169
165
|
|
170
|
-
Policy = Struct.new(:
|
171
|
-
:path,
|
166
|
+
Policy = Struct.new(:path,
|
172
167
|
:request_method,
|
173
168
|
:plan,
|
174
169
|
:weight,
|
@@ -194,8 +189,7 @@ module Bowtie::Middleware
|
|
194
189
|
|
195
190
|
def applicable_for(rack_request)
|
196
191
|
applicable_to_request = all.select { |policy|
|
197
|
-
policy.
|
198
|
-
rack_request.path.start_with?(policy.path)
|
192
|
+
rack_request.path.start_with?(policy.path)
|
199
193
|
}.sort_by!(&:weight).reverse
|
200
194
|
|
201
195
|
heaviest = applicable_to_request.first
|
data/lib/bowtie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowtie-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Kassemi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|