junoser 0.4.1 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test-linux.yaml +30 -0
- data/.pre-commit-config.yaml +7 -0
- data/CHANGELOG.md +30 -1
- data/Gemfile.lock +9 -9
- data/README.md +1 -1
- data/Rakefile +10 -1
- data/commitlint.config.js +5 -0
- data/example/mx-19.3R3-S1.3.rb +161 -297
- data/example/vsrx-18.3R1.9.rb +1305 -1305
- data/lib/junoser/js_ruler.rb +2 -0
- data/lib/junoser/parser.rb +172 -308
- data/lib/junoser/ruler.rb +11 -0
- data/lib/junoser/version.rb +1 -1
- data/lib/junoser/xsd/base.rb +4 -2
- metadata +6 -4
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c6e7f0c484d2690412ecf2bc8f3154fe0ff7228c61ace8ec588ea56e234d078
|
4
|
+
data.tar.gz: 85278e68967cded8e04f1e182996b9a10dc286410dd147ba50b2f0b09a982918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a22aa17e1ffbbe6d1a34b345fdeecfe4a3e3013b4b5d9b44458d596a3243d7692edc9a90f020493d74cc1403ce74f23ec1636271d4e6e38aaa6a86d3151b7eb
|
7
|
+
data.tar.gz: f56ed2f48e4cc775d8110b80822794471d77049d8b89106474e1daf04d05aabf1a92cdbf992c4a6c863f55bcd947e2c35bb2c8070b3d75cbd1adceb54ae513e6
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Test on Ubuntu
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ${{ matrix.os }}
|
8
|
+
continue-on-error: ${{ matrix.experimental }}
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
ruby-version: ['3.0', '2.7', '2.6']
|
13
|
+
os: [ubuntu-latest]
|
14
|
+
experimental: [false]
|
15
|
+
include:
|
16
|
+
- ruby-version: head
|
17
|
+
os: ubuntu-latest
|
18
|
+
experimental: true
|
19
|
+
|
20
|
+
name: Test with ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby-version }}
|
27
|
+
- name: Install dependencies
|
28
|
+
run: bundle install
|
29
|
+
- name: Run tests
|
30
|
+
run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
+
## [0.4.4] - 2022-02-26
|
2
|
+
|
3
|
+
### Fixed
|
4
|
+
|
5
|
+
* "snmp name" instead of "snmp system-name"
|
6
|
+
|
7
|
+
|
8
|
+
## [0.4.3] - 2021-09-28
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
* A Nokogiri's [security vulnerability](https://github.com/advisories/GHSA-2rr5-8q37-2w7h)
|
13
|
+
|
14
|
+
|
15
|
+
## [0.4.2] - 2021-08-30
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
* Newly supported syntax
|
20
|
+
* "virtual-chassis vcp-snmp-statistics"
|
21
|
+
* "application_object"
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
* Keywords "tls", "group", "dest-nat-rule-match", "src-nat-rule-match", and "static-nat-rule-match" might be marked as invalid in some hierarchies
|
26
|
+
* "applications application xxx term xxx"
|
27
|
+
* "security"
|
28
|
+
|
29
|
+
|
1
30
|
## [0.4.1] - 2021-06-06
|
2
31
|
|
3
32
|
### Added
|
@@ -7,7 +36,7 @@
|
|
7
36
|
|
8
37
|
### Fixed
|
9
38
|
|
10
|
-
* "scpf-link", "https", "inet6", "icmp6", "icmpv6", "ospf3", and "snmptrap"
|
39
|
+
* Keywords "scpf-link", "https", "inet6", "icmp6", "icmpv6", "ospf3", and "snmptrap" might be marked as invalid in some hierarchies
|
11
40
|
* "policy-options community xxx members"
|
12
41
|
* "policy-options route-distinguisher xxx members"
|
13
42
|
* "routing-options confederation members"
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
junoser (0.4.
|
4
|
+
junoser (0.4.4)
|
5
5
|
parslet
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
mini_portile2 (2.
|
11
|
-
nokogiri (1.
|
12
|
-
mini_portile2 (~> 2.
|
10
|
+
mini_portile2 (2.8.0)
|
11
|
+
nokogiri (1.13.3)
|
12
|
+
mini_portile2 (~> 2.8.0)
|
13
13
|
racc (~> 1.4)
|
14
14
|
parslet (2.0.0)
|
15
|
-
power_assert (2.0.
|
16
|
-
racc (1.
|
17
|
-
rake (13.0.
|
18
|
-
test-unit (3.
|
15
|
+
power_assert (2.0.1)
|
16
|
+
racc (1.6.0)
|
17
|
+
rake (13.0.6)
|
18
|
+
test-unit (3.5.3)
|
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.2.
|
32
|
+
2.2.26
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Junoser
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Test on Ubuntu](https://github.com/codeout/junoser/actions/workflows/test-linux.yaml/badge.svg)](https://github.com/codeout/junoser/actions/workflows/test-linux.yaml)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/codeout/junoser.png)](https://codeclimate.com/github/codeout/junoser)
|
5
5
|
[![Inline docs](http://inch-ci.org/github/codeout/junoser.svg)](http://inch-ci.org/github/codeout/junoser)
|
6
6
|
|
data/Rakefile
CHANGED
@@ -19,12 +19,22 @@ def open_files(input, output, &block)
|
|
19
19
|
o.close
|
20
20
|
end
|
21
21
|
|
22
|
+
def move_wildcards(element)
|
23
|
+
['ipaddr', 'ipv6addr', 'ipprefix'].each do |pattern|
|
24
|
+
element.xpath(%[.//xsd:element[@type="#{pattern}"]/xsd:annotation/xsd:appinfo/flag[text()="nokeyword"]/../../..]).each do |wildcard|
|
25
|
+
parent = wildcard.parent
|
26
|
+
removed = wildcard.remove
|
27
|
+
parent << removed
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
22
31
|
|
23
32
|
namespace :build do
|
24
33
|
desc 'Build an intermediate config hierarchy'
|
25
34
|
task :config do
|
26
35
|
open_files(xsd_path, rule_path) do |input, output|
|
27
36
|
Nokogiri::XML(input).root.remove_unused.xpath('/xsd:schema/*').each do |e|
|
37
|
+
move_wildcards e # Move wildcard elements to the end of siblings as they capture keywords unexpectedly
|
28
38
|
output.puts e.to_config
|
29
39
|
end
|
30
40
|
end
|
@@ -56,7 +66,6 @@ task 'find-srx-methods' do
|
|
56
66
|
end
|
57
67
|
end
|
58
68
|
|
59
|
-
|
60
69
|
Rake::TestTask.new do |t|
|
61
70
|
t.libs << 'test'
|
62
71
|
|