junoser 0.3.8 → 0.3.9

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: a59ddeec41d5ea106a1c46995501305667b3777bf875499cb8c39cb41e40744d
4
- data.tar.gz: 2ba6e1ca647f9bf8b2533bc52926afbffc2b09a73eb2be8f56ff57db05c1f76d
3
+ metadata.gz: 4593e83820c87e14eb51c1bc781a7ef739a30fd81ddbb0438a144b637897d8bc
4
+ data.tar.gz: 9334a3f8c869085ac0d435f48b0cbc3add246b105f49215d72b355a8d2880dc6
5
5
  SHA512:
6
- metadata.gz: a889917be31856fa914e95ed76652bdec895f1b4f0c12c813838cb6f5428fac68d051ac99aa9de110e9010176baab733c3c701b270c864f55e3cb306aea48823
7
- data.tar.gz: 1a6c01cbfbfd03145d89a1ba5bd09a3ae6b39c229e339e16125da383be95edbd7f18e97ef85f363bc2d6d9719de77c3ec2fcf969c9bb9882fb94df8ccf5ff941
6
+ metadata.gz: c7c4846a31f13cb84d6c82d08c6dd07b21cfa4941799bfff38f82e353db29bc8ffb8c8663b7b29cb658bc37eba9b49802d09c15c5c07ada303bdf7fee1654ca8
7
+ data.tar.gz: 1802d0a8ba430e735d4f5f6c96264adf71396c30010a7fc8d620ad5ccb040b15595bd9e0f88f5db5ccd6c4fc980887d7f25f74a29ff539a0477467b8c4c2ba09
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.3.9] - 2019-11-17
2
+
3
+ ### Fixed
4
+
5
+ * security policies
6
+ * "junoser -s" and "junoser -d" unexpectedly raises errors
7
+
1
8
  ## [0.3.8] - 2019-11-04
2
9
 
3
10
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junoser (0.3.8)
4
+ junoser (0.3.9)
5
5
  parslet
6
6
 
7
7
  GEM
data/lib/junoser/cli.rb CHANGED
@@ -18,11 +18,23 @@ module Junoser
18
18
  end
19
19
 
20
20
  def display_set(io_or_string)
21
- Junoser::Display::Set.new(io_or_string).transform
21
+ config = Junoser::Input.new(io_or_string).read
22
+
23
+ if Junoser::Display.display_set?(config)
24
+ config
25
+ else
26
+ Junoser::Display::Set.new(config).transform
27
+ end
22
28
  end
23
29
 
24
30
  def struct(io_or_string)
25
- Junoser::Display::Structure.new(io_or_string).transform
31
+ config = Junoser::Input.new(io_or_string).read
32
+
33
+ if Junoser::Display.display_set?(config)
34
+ Junoser::Display::Structure.new(config).transform
35
+ else
36
+ config
37
+ end
26
38
  end
27
39
 
28
40
 
@@ -165,6 +165,12 @@ module Junoser
165
165
  def process_reserved_word(str)
166
166
  # ieee-802.3ad -> 802.3ad
167
167
  str.gsub! 'ieee-802.3ad', '802.3ad'
168
+
169
+ # "policy | Define a policy context from this zone" -> "from-zone | Define a policy context from this zone"
170
+ str.gsub! 'policy | Define a policy context from this zone', 'from-zone | Define a policy context from this zone'
171
+ # "to-zone-name | Destination zone" -> "to-zone | Destination zone"
172
+ str.gsub! 'to-zone-name | Destination zone', 'to-zone | Destination zone'
173
+
168
174
  fix_route_filter(str)
169
175
 
170
176
  str
@@ -2862,7 +2862,6 @@ module Junoser
2862
2862
  arg
2863
2863
  )
2864
2864
  ).as(:oneline),
2865
-
2866
2865
  # Ported from vSRX 18.3R1.9
2867
2866
  b(str("security"),
2868
2867
  c(
@@ -4891,7 +4890,6 @@ module Junoser
4891
4890
  )
4892
4891
  ),
4893
4892
  # End of vSRX 18.3R1.9
4894
-
4895
4893
  b(str("interfaces"),
4896
4894
  c(
4897
4895
  b(a(str("pic-set"), arg),
@@ -97908,15 +97906,8 @@ module Junoser
97908
97906
  a(str("flag"), enum(str("configuration") | str("routing-socket") | str("compilation") | str("ipc") | str("rules") | str("lookup") | str("all"))).as(:oneline)
97909
97907
  )
97910
97908
  ),
97911
- b(str("policy"),
97912
- s(
97913
- arg,
97914
- a(str("to-zone-name"), arg),
97915
- c(
97916
- b(str("policy"),
97917
- policy_type
97918
- )
97919
- )
97909
+ b(s(str("from-zone"), arg, str("to-zone"), arg),
97910
+ b(str("policy"), policy_type
97920
97911
  )
97921
97912
  ),
97922
97913
  b(str("global"),
data/lib/junoser/ruler.rb CHANGED
@@ -161,6 +161,12 @@ module Junoser
161
161
  ' "path" (quote | arg)'], $1)
162
162
  end
163
163
 
164
+ str.gsub!(/^(\s*)"policy" \(\s*s\(\s*arg,\s*"to-zone-name" arg,\s*c\(\s*"policy" \(\s*policy_type\s*\)\s*\)/) do
165
+ format(['b(s("from-zone", arg, "to-zone", arg),',
166
+ ' b("policy", policy_type',
167
+ ], $1)
168
+ end
169
+
164
170
  str
165
171
  end
166
172
 
@@ -1,3 +1,3 @@
1
1
  module Junoser
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junoser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2019-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet