junoser 0.7.0 → 0.7.2

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: d373ec94d7ebe3053b4f01d01d54beb15b49af4e2e8fbab4b29f9641632b5715
4
- data.tar.gz: 046c510a4c5072759810abd68c8df4ce25c7cab976806182cdf0020dbd5b3f6c
3
+ metadata.gz: 54f09e05dbba47b559c3a8ba68644a5648b646719830ca573fad81821b7aa6e6
4
+ data.tar.gz: d8c0cd5221c4d534bbf3b3986bef228e47c3db44cfe9d3dc9977e70a3ade15dd
5
5
  SHA512:
6
- metadata.gz: c8acdf3b078ddc961ba28f3be6f9c2b3870b2f3ee85a81b7bec28fee09a390709e0783e520c67ef3b30fe87b15a317d7dcb879bdadd3d3b3d3d101a3fdb05c32
7
- data.tar.gz: 9f4ff9fda7f65b1a318dcd43858874e7823e0008028071a0a2b20c951cdbdf04b6665e521044a572fd46f34626a345d543f2df9366524f55d07cf99dbfb55064
6
+ metadata.gz: 262a923cabcf89668f1b1cb73a773662971fc2b577abb314196fd27a458da801a7ac78740fe31b500652787af7a338fe3906fb569eb12f7363832353289dc3c1
7
+ data.tar.gz: 0b01ef6de4abefa8234a5cdfdae9320ad690ea90f9544fbeefb82198195f89eb82c66fb966305a4c813ff9f166cb60280a3de0f0523df5f3a6c02c68935f3dba
@@ -9,7 +9,7 @@ jobs:
9
9
  strategy:
10
10
  fail-fast: false
11
11
  matrix:
12
- ruby-version: ['3.3', '3.2', '3.1']
12
+ ruby-version: ['3.4', '3.3', '3.2']
13
13
  os: [ubuntu-latest]
14
14
  experimental: [false]
15
15
  include:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## [0.7.2] - 2025-04-22
2
+
3
+ ### Fixed
4
+
5
+ * A Nokogiri's [security vulnerability](https://github.com/codeout/junoser/security/dependabot/19)
6
+ * The argument of commands below should be a regular expression
7
+ * "system login class foo allow-commands-regexps"
8
+ * "system login class foo deny-commands-regexps"
9
+ * "system login class foo allow-configuration-regexps"
10
+ * "system login class foo deny-configuration-regexps"
11
+
12
+
13
+ ## [0.7.1] - 2025-02-03
14
+
15
+ ### Added
16
+
17
+ * Newly supported syntax for vSRX
18
+ * "system services web-management http"
19
+
20
+
1
21
  ## [0.7.0] - 2024-12-19
2
22
 
3
23
  ### Added
data/Gemfile.lock CHANGED
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junoser (0.7.0)
4
+ junoser (0.7.2)
5
5
  parslet
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  mini_portile2 (2.8.8)
11
- nokogiri (1.17.2)
11
+ nokogiri (1.18.8)
12
12
  mini_portile2 (~> 2.8.2)
13
13
  racc (~> 1.4)
14
14
  parslet (2.0.0)
15
- power_assert (2.0.4)
15
+ power_assert (2.0.5)
16
16
  racc (1.8.1)
17
17
  rake (13.2.1)
18
- test-unit (3.6.7)
18
+ test-unit (3.6.8)
19
19
  power_assert
20
20
 
21
21
  PLATFORMS
@@ -29,4 +29,4 @@ DEPENDENCIES
29
29
  test-unit
30
30
 
31
31
  BUNDLED WITH
32
- 2.5.16
32
+ 2.6.2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2024 Shintaro Kojima
3
+ Copyright (c) 2015-2025 Shintaro Kojima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -103,4 +103,4 @@ Or send a pull request to fix.
103
103
 
104
104
  ## Copyright and License
105
105
 
106
- Copyright (c) 2015-2024 Shintaro Kojima. Code released under the [MIT license](LICENSE.txt).
106
+ Copyright (c) 2015-2025 Shintaro Kojima. Code released under the [MIT license](LICENSE.txt).
@@ -29,17 +29,20 @@ module Junoser
29
29
  # set groups
30
30
  str.gsub! /"groups" \(.*\s*s\(\s*any\s*\)\s*\)/, <<-EOS.strip
31
31
  "groups" arg ( /* Configuration groups */
32
- "when" ( /* Specify additional conditions for groups */
33
- c(
34
- "chassis" arg /* Chassis id */,
35
- "member" arg /* Member of virtual chassis */,
36
- "model" arg /* Model name */,
37
- "node" arg /* Node of cluster */,
38
- "peers" arg /* Hosts on which this group should be effective */,
39
- "routing-engine" arg /* Routing Engine */,
40
- "time" ( /* Time at which group should be effective */
41
- "to" arg /* End time([yyyy-mm-dd.]hh:mm) */,
42
- arg
32
+ c(
33
+ this.configuration({ groups: false }),
34
+ "when" ( /* Specify additional conditions for groups */
35
+ c(
36
+ "chassis" arg /* Chassis id */,
37
+ "member" arg /* Member of virtual chassis */,
38
+ "model" arg /* Model name */,
39
+ "node" arg /* Node of cluster */,
40
+ "peers" arg /* Hosts on which this group should be effective */,
41
+ "routing-engine" arg /* Routing Engine */,
42
+ "time" ( /* Time at which group should be effective */
43
+ "to" arg /* End time([yyyy-mm-dd.]hh:mm) */,
44
+ arg
45
+ )
43
46
  )
44
47
  )
45
48
  )
@@ -91,8 +94,8 @@ module Junoser
91
94
  end
92
95
 
93
96
  def process_common_syntax(str)
94
- # rule(:foo) do -> foo(...args) {
95
- str.gsub!(/^rule\(:(\S+)\) do/) { "#$1(...args) { return_next_line" }
97
+ # rule(:foo) do -> foo(opts) {
98
+ str.gsub!(/^rule\(:(\S+)\) do/) { "#$1(opts) { return_next_line" }
96
99
  # end -> }
97
100
  str.gsub!(/^(\s*)end$/) { "#$1}" }
98
101
 
@@ -167,12 +170,12 @@ module Junoser
167
170
  end
168
171
 
169
172
  def process_structural_syntax(str)
170
- # "foo" ( /* doc */ -> "foo | doc": (...args) => {
173
+ # "foo" ( /* doc */ -> "foo | doc": (opts) => {
171
174
  str.gsub!(%r|^(\s*)"(\S+)" \( /\* (.*) \*/|) { "#$1\"#$2 | #$3\": {" }
172
- # "foo" ( -> "foo": (...args) => {
175
+ # "foo" ( -> "foo": (opts) => {
173
176
  str.gsub!(%r|^(\s*)"(\S+)" \($|) { "#$1\"#$2\": {" }
174
177
 
175
- # "foo" arg ( /* doc */ -> "foo | doc": (...args) => {
178
+ # "foo" arg ( /* doc */ -> "foo | doc": (opts) => {
176
179
  str.gsub!(%r|^(\s*)"(\S+)" arg \( /\* (.*) \*/|) { "#$1\"#$2 | #$3\": {" }
177
180
 
178
181
  str
@@ -286,6 +289,8 @@ module Junoser
286
289
 
287
290
  # "arg" -> "arg_1"
288
291
  lines.gsub('"arg":') { %["arg_#{sequence}":] }
292
+
293
+ conditional_groups(lines)
289
294
  end
290
295
 
291
296
  # } -> )
@@ -349,6 +354,17 @@ module Junoser
349
354
  lines
350
355
  end
351
356
 
357
+ def conditional_groups(lines)
358
+ # "null_13264": this.configuration(false),
359
+ # ->
360
+ # (opts === undefined || opts?.configuration !== false) && { "null_13264": this.configuration(false) },
361
+ #
362
+ # ref: process_lines()
363
+ lines.gsub(/("groups\(arg\) \| .*":) {/) {
364
+ "#{$1} opts?.groups !== false && {"
365
+ }
366
+ end
367
+
352
368
  def rule_header
353
369
  <<~EOS
354
370
  /* eslint-disable semi */
@@ -86876,6 +86876,16 @@ module Junoser
86876
86876
  )
86877
86877
  )
86878
86878
  ),
86879
+ # Ported from vSRX 18.4R1.8
86880
+ b(str("http"),
86881
+ c(
86882
+ a(str("port"), arg),
86883
+ b(str("interface"),
86884
+ interface_name
86885
+ )
86886
+ )
86887
+ ),
86888
+ # End of vSRX 18.4R1.8
86879
86889
  b(str("control"),
86880
86890
  c(
86881
86891
  a(str("max-threads"), arg)
@@ -111164,10 +111174,10 @@ module Junoser
111164
111174
  b(str("deny-configuration"),
111165
111175
  regular_expression
111166
111176
  ),
111167
- a(str("allow-commands-regexps"), arg),
111168
- a(str("deny-commands-regexps"), arg),
111169
- a(str("allow-configuration-regexps"), arg),
111170
- a(str("deny-configuration-regexps"), arg),
111177
+ a(str("allow-commands-regexps"), regular_expression),
111178
+ a(str("deny-commands-regexps"), regular_expression),
111179
+ a(str("allow-configuration-regexps"), regular_expression),
111180
+ a(str("deny-configuration-regexps"), regular_expression),
111171
111181
  str("configuration-breadcrumbs"),
111172
111182
  b(a(str("confirm-commands"), arg),
111173
111183
  c(
data/lib/junoser/ruler.rb CHANGED
@@ -296,6 +296,9 @@ module Junoser
296
296
  %[#{$1}#{$2}"enable",#{$2}]
297
297
  end
298
298
 
299
+ # Fix .xsd: arg should be regular_expression
300
+ str.gsub!(/^(\s*"(allow|deny)-(commands|configuration)-regexps") arg/) { "#{$1} regular_expression" }
301
+
299
302
  str
300
303
  end
301
304
 
@@ -1,3 +1,3 @@
1
1
  module Junoser
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junoser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-20 00:00:00.000000000 Z
10
+ date: 2025-04-22 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: parslet
@@ -141,7 +140,6 @@ files:
141
140
  homepage: https://github.com/codeout/junoser
142
141
  licenses: []
143
142
  metadata: {}
144
- post_install_message:
145
143
  rdoc_options: []
146
144
  require_paths:
147
145
  - lib
@@ -156,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
154
  - !ruby/object:Gem::Version
157
155
  version: '0'
158
156
  requirements: []
159
- rubygems_version: 3.5.16
160
- signing_key:
157
+ rubygems_version: 3.6.2
161
158
  specification_version: 4
162
159
  summary: PEG parser for JUNOS configuration.
163
160
  test_files: []