oxidized-web 0.17.0 → 0.17.1

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.

Potentially problematic release.


This version of oxidized-web might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a14e46c410d51b9da6a86d6d67fc35bdaed177adfbb006b1e2df4ec12c958bc
4
- data.tar.gz: 7dc9144e706052817ca761a4e80151d40ee73fd7467c31894d2d5fa21c4767b0
3
+ metadata.gz: 1aff1246feb59461d9b7e559bdf8e9d3dbca3b850c0349e8dee7aed6f059aed4
4
+ data.tar.gz: b6653474dba5edcd452a4d146fe08c36abef240ac6a584668ca670d8e94eec43
5
5
  SHA512:
6
- metadata.gz: c5b12efffe62f84156e27d30405a2934a9340373bd4b6b5ad9e3df41d65258bc9ab65221c5f153b813b41b17835a673b576c746da3f497332a870aaadec3a26e
7
- data.tar.gz: 8fb63afdf4b7dc9dbca3e052b75efc2377506171764456353e1478be36ac82629be3f87445918a2471f13f143280b5cd021d8fa34b6ea834deccd74b95b891b5
6
+ metadata.gz: b53b5b69e72018995f7d03d58f3f1fbba72b49a48e4aa12d2690000ee646a59ca2e97526d9d7d717a6433d1a3989c9f8eb615f8bfdd6e9c78365bfb7e487f03a
7
+ data.tar.gz: e1c2ecd5a22e7822e4202ad1bdd3e5c1e6a077bf5f8be6adb5e858bce111da89882df3834dce5fb1c12ba3afd3040037662fa0b7a303c8ab863f8dc7e831a7a2
data/.rubocop.yml CHANGED
@@ -29,7 +29,7 @@ Metrics/MethodLength:
29
29
  Enabled: false
30
30
 
31
31
  Metrics/BlockLength:
32
- Max: 150
32
+ Enabled: false
33
33
 
34
34
  # Not using Rails, so no timezones
35
35
  Rails/TimeZone:
data/CHANGELOG.md CHANGED
@@ -3,9 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ ## [0.17.1 – 2025-08-01]
7
+ ### Changed
8
+ - Dependency on Oxidized 0.34.1 (@robertcheramy)
6
9
 
7
- ## [0.17.0 – 2025-07-18]
10
+ ### Fixed
11
+ - Hide node vars works with Oxidized > 0.34.1 (@robertcheramy)
8
12
 
13
+
14
+ ## [0.17.0 – 2025-07-18]
9
15
  ### Added
10
16
  - Documentation of the configuration (@robertcheramy)
11
17
 
@@ -20,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
20
26
  - Hide node vars when listed in the configuration entry hide_node_vars. Fixes: #344 (@robertcheramy)
21
27
  - /node/next/: Prefer JSON.parse over JSON.load (@robertcheramy)
22
28
 
29
+
23
30
  ## [0.16.0 - 2025-03-25]
24
31
  This release introduces the possibility for an extended configuration of
25
32
  oxidized-web in the oxidized configuration file. Oxidized versions after 0.32.2
data/docs/development.md CHANGED
@@ -91,13 +91,16 @@ Oxidized-web versions are numbered like major.minor.patch
91
91
  - minor is incremented when releasing new features.
92
92
  - patch is incremented when releasing fixes only.
93
93
 
94
+ ## Create a release branch
95
+ Name the release branch `release/0.xx.yy`
96
+
94
97
  ## Review changes
95
- Run `git diff 0.xx.yy..master` (where `0.xx.yy` is to be changed to the last
98
+ Run `git diff 0.xx.yy` (where `0.xx.yy` is to be changed to the previous
96
99
  release) and review all the changes that have been done. Have a specific look
97
100
  at changes you don't understand.
98
101
 
99
102
  It is nicer to read in a GUI, so you can use something like
100
- `git difftool --tool=kdiff3 -d 0.xx.yy..master` to see it in kdiff3.
103
+ `git difftool --tool=kdiff3 -d 0.xx.yy` to see it in kdiff3.
101
104
 
102
105
  ## Update the gem dependencies to the latest versions
103
106
  ```
@@ -118,18 +121,6 @@ Test again after updating!
118
121
  ## Make sure the file permissions are correct
119
122
  Run `bundle exec rake chmod`
120
123
 
121
- ## Create a release branch
122
- Name the release branch `release/0.xx.yy`
123
-
124
- Update CHANGELOG.md:
125
- - review it
126
- - add release notes
127
- - set the new version (replace `[Unreleased]` with `[0.xx.yy – 202Y-MM-DD]`)
128
-
129
- Change the version in `lib/oxidized/web/version.rb`
130
-
131
- Upload the branch to github, make a Pull Request for it.
132
-
133
124
  ## Test!
134
125
  Run `bundle exec rake` on the git repository to check the code against rubocop
135
126
  and run the defined tests in `/spec`.
@@ -139,11 +130,21 @@ Run Oxidized-web from git against the latest Oxidized version `bundle exec oxdiz
139
130
  When testing the web application, open the javascript console in the browser to
140
131
  see any errors.
141
132
 
133
+ ## Bump the version
134
+ Update CHANGELOG.md:
135
+ - review it
136
+ - add release notes
137
+ - set the new version (replace `[Unreleased]` with `[0.xx.yy – 202Y-MM-DD]`)
138
+
139
+ Change the version in `lib/oxidized/web/version.rb`
140
+
141
+ Upload the release branch to github, make a Pull Request for it.
142
+
142
143
  ## Release
143
144
  1. Merge the Pull Request into master with the commit message
144
- `chore(release): release version 0.3x.y`
145
+ `chore(release): release version 0.xx.y`
145
146
  2. `git pull` master
146
- 3. Tag the commit with `git tag -a 0.xx.yy -m "Release 0.xx.yy"`
147
+ 3. Tag the commit with `git tag -a 0.xx.yy -m "Release 0.xx.yy"` or `rake tag`
147
148
  4. Build the gem with ‘rake build’
148
149
  5. Run `git diff` to check if there have been more changes (there shouldn't)
149
150
  6. Install an test the gem locally
@@ -163,6 +164,8 @@ Make a release from the tag in github.
163
164
  - List new contributors (generated automatically)
164
165
  - Keep the Full Changelog (generated automatically)
165
166
 
167
+ Close the corresponding milestone in github.
168
+
166
169
  ## Release in rubygems
167
170
  Push the gem with ‘rake push’
168
171
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Oxidized
4
4
  module API
5
- WEB_VERSION = '0.17.0'
5
+ WEB_VERSION = '0.17.1'
6
6
  end
7
7
  end
@@ -331,8 +331,10 @@ module Oxidized
331
331
  def filter_node_vars(serialized_node)
332
332
  # Make a deep copy of the data, so we do not impact oxidized
333
333
  data = Marshal.load(Marshal.dump(serialized_node))
334
+ # Make sure we work on strings (Oxidized <= 0.34.1 uses symbols)
335
+ data[:vars] = data[:vars].transform_keys(&:to_s)
334
336
 
335
- hide_node_vars = settings.configuration[:hide_node_vars]
337
+ hide_node_vars = settings.configuration[:hide_node_vars].map(&:to_s)
336
338
  if data[:vars].is_a?(Hash) && hide_node_vars&.any?
337
339
  hide_node_vars.each do |key|
338
340
  data[:vars][key] = '<hidden>' if data[:vars].has_key?(key)
data/oxidized-web.gemspec CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.add_dependency 'haml', '>= 6.0.0', '< 6.4.0'
37
37
  s.add_dependency 'htmlentities', '>= 4.3.0', '< 4.4.0'
38
38
  s.add_dependency 'json', '>= 2.3.0', '< 2.14.0'
39
- s.add_dependency 'oxidized', '~> 0.34.0'
39
+ s.add_dependency 'oxidized', '~> 0.34.1'
40
40
  s.add_dependency 'puma', '~> 6.6.0'
41
41
  s.add_dependency 'sinatra', '~> 4.1.1'
42
42
  s.add_dependency 'sinatra-contrib', '~> 4.1.1'
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.add_development_dependency 'rack-test', '~> 2.1'
48
48
  s.add_development_dependency 'rails_best_practices', '~> 1.19'
49
49
  s.add_development_dependency 'rake', '~> 13.0'
50
- s.add_development_dependency 'rubocop', '~> 1.78.0'
50
+ s.add_development_dependency 'rubocop', '~> 1.79.1'
51
51
  s.add_development_dependency 'rubocop-minitest', '~> 0.38.0'
52
52
  s.add_development_dependency 'rubocop-rails', '~> 2.32.0'
53
53
  s.add_development_dependency 'rubocop-rake', '~> 0.7.1'
@@ -6,6 +6,28 @@ describe Oxidized::API::WebApp do
6
6
  Oxidized::API::WebApp
7
7
  end
8
8
 
9
+ def expected_json_body(hide_vars: false)
10
+ enable_val = hide_vars ? "&lt;hidden&gt;" : "secret_enable"
11
+ password_val = hide_vars ? "&lt;hidden&gt;" : "secret_password"
12
+
13
+ "<code>{\n &quot;name&quot;: &quot;sw5&quot;," \
14
+ "\n &quot;full_name&quot;: &quot;sw5.example.com&quot;," \
15
+ "\n &quot;ip&quot;: &quot;10.42.12.42&quot;," \
16
+ "\n &quot;group&quot;: null,\n &quot;model&quot;: &quot;ios&quot;," \
17
+ "\n &quot;last&quot;: {" \
18
+ "\n &quot;start&quot;: &quot;2025-02-05 19:49:00 +0100&quot;," \
19
+ "\n &quot;end&quot;: &quot;2025-02-05 19:49:10 +0100&quot;," \
20
+ "\n &quot;status&quot;: &quot;no_connection&quot;," \
21
+ "\n &quot;time&quot;: 10\n }," \
22
+ "\n &quot;vars&quot;: {" \
23
+ "\n &quot;oxi&quot;: &quot;dized&quot;," \
24
+ "\n &quot;enable&quot;: &quot;#{enable_val}&quot;," \
25
+ "\n &quot;username&quot;: &quot;oxidized&quot;," \
26
+ "\n &quot;password&quot;: &quot;#{password_val}&quot;" \
27
+ "\n },\n &quot;mtime&quot;: &quot;2025-02-05 19:49:11 +0100&quot;" \
28
+ "\n}</code>"
29
+ end
30
+
9
31
  before do
10
32
  @nodes = mock('Oxidized::Nodes')
11
33
  app.set(:nodes, @nodes)
@@ -30,71 +52,78 @@ describe Oxidized::API::WebApp do
30
52
  },
31
53
  mtime: Time.parse("2025-02-05 19:49:11 +0100")
32
54
  }
55
+
56
+ @nodes.expects(:show).with("sw5").returns(@serialized_node)
33
57
  end
34
58
 
35
59
  describe "get /node/show/:node" do
36
- it "shows the metadata of a node" do
37
- app.set(:configuration, { hide_node_vars: [] })
38
- @nodes.expects(:show).with("sw5").returns(@serialized_node)
39
-
40
- get '/node/show/sw5'
41
- _(last_response.ok?).must_equal true
42
- body = last_response.body
43
-
44
- _(body).must_match(/secret_enable/)
45
- _(body).must_match(/secret_password/)
46
- _(body.include?(
47
- "<code>{\n &quot;name&quot;: &quot;sw5&quot;," \
48
- "\n &quot;full_name&quot;: &quot;sw5.example.com&quot;," \
49
- "\n &quot;ip&quot;: &quot;10.42.12.42&quot;," \
50
- "\n &quot;group&quot;: null,\n &quot;model&quot;: &quot;ios&quot;," \
51
- "\n &quot;last&quot;: {" \
52
- "\n &quot;start&quot;: &quot;2025-02-05 19:49:00 +0100&quot;," \
53
- "\n &quot;end&quot;: &quot;2025-02-05 19:49:10 +0100&quot;," \
54
- "\n &quot;status&quot;: &quot;no_connection&quot;," \
55
- "\n &quot;time&quot;: 10\n }," \
56
- "\n &quot;vars&quot;: {" \
57
- "\n &quot;oxi&quot;: &quot;dized&quot;," \
58
- "\n &quot;enable&quot;: &quot;secret_enable&quot;," \
59
- "\n &quot;username&quot;: &quot;oxidized&quot;," \
60
- "\n &quot;password&quot;: &quot;secret_password&quot;" \
61
- "\n },\n &quot;mtime&quot;: &quot;2025-02-05 19:49:11 +0100&quot;" \
62
- "\n}</code>"
63
- )).must_equal true
60
+ describe "Oxidized <= 0.34.1" do
61
+ it "shows the metadata of a node" do
62
+ app.set(:configuration, { hide_node_vars: [] })
63
+
64
+ get '/node/show/sw5'
65
+ _(last_response.ok?).must_equal true
66
+ body = last_response.body
67
+
68
+ _(body).must_match(/secret_enable/)
69
+ _(body).must_match(/secret_password/)
70
+ _(body.include?(expected_json_body(hide_vars: false))).must_equal true
71
+ end
72
+
73
+ it "hides vars in hide_node_vars" do
74
+ app.set(:configuration, { hide_node_vars: %i[enable password] })
75
+
76
+ get '/node/show/sw5'
77
+ _(last_response.ok?).must_equal true
78
+ body = last_response.body
79
+
80
+ _(body).wont_match(/secret_enable/)
81
+ _(body).wont_match(/secret_password/)
82
+ _(body).must_match(/&lt;hidden&gt;/)
83
+ _(body.include?(expected_json_body(hide_vars: true))).must_equal true
84
+
85
+ # The note data is not changed (deep copy with Marshal)
86
+ _(@serialized_node[:vars][:enable]).must_equal "secret_enable"
87
+ end
64
88
  end
65
89
 
66
- it "hides vars in hide_node_vars" do
67
- app.set(:configuration, { hide_node_vars: %i[enable password] })
68
- @nodes.expects(:show).with("sw5").returns(@serialized_node)
69
-
70
- get '/node/show/sw5'
71
- _(last_response.ok?).must_equal true
72
- body = last_response.body
73
-
74
- _(body).wont_match(/secret_enable/)
75
- _(body).wont_match(/secret_password/)
76
- _(body).must_match(/&lt;hidden&gt;/)
77
- _(body.include?(
78
- "<code>{\n &quot;name&quot;: &quot;sw5&quot;," \
79
- "\n &quot;full_name&quot;: &quot;sw5.example.com&quot;," \
80
- "\n &quot;ip&quot;: &quot;10.42.12.42&quot;," \
81
- "\n &quot;group&quot;: null,\n &quot;model&quot;: &quot;ios&quot;," \
82
- "\n &quot;last&quot;: {" \
83
- "\n &quot;start&quot;: &quot;2025-02-05 19:49:00 +0100&quot;," \
84
- "\n &quot;end&quot;: &quot;2025-02-05 19:49:10 +0100&quot;," \
85
- "\n &quot;status&quot;: &quot;no_connection&quot;," \
86
- "\n &quot;time&quot;: 10\n }," \
87
- "\n &quot;vars&quot;: {" \
88
- "\n &quot;oxi&quot;: &quot;dized&quot;," \
89
- "\n &quot;enable&quot;: &quot;&lt;hidden&gt;&quot;," \
90
- "\n &quot;username&quot;: &quot;oxidized&quot;," \
91
- "\n &quot;password&quot;: &quot;&lt;hidden&gt;&quot;" \
92
- "\n },\n &quot;mtime&quot;: &quot;2025-02-05 19:49:11 +0100&quot;" \
93
- "\n}</code>"
94
- )).must_equal true
95
-
96
- # The note data is not changed (deep copy with Marshal)
97
- _(@serialized_node[:vars][:enable]).must_equal "secret_enable"
90
+ describe "Oxidized > 0.34.1" do
91
+ before do
92
+ @serialized_node[:vars] = {
93
+ "oxi" => "dized",
94
+ "enable" => "secret_enable",
95
+ "username" => "oxidized",
96
+ "password" => "secret_password"
97
+ }
98
+ end
99
+
100
+ it "shows the metadata of a node" do
101
+ app.set(:configuration, { hide_node_vars: [] })
102
+
103
+ get '/node/show/sw5'
104
+ _(last_response.ok?).must_equal true
105
+ body = last_response.body
106
+
107
+ _(body).must_match(/secret_enable/)
108
+ _(body).must_match(/secret_password/)
109
+ _(body.include?(expected_json_body(hide_vars: false))).must_equal true
110
+ end
111
+
112
+ it "hides vars in hide_node_vars" do
113
+ app.set(:configuration, { hide_node_vars: %w[enable password] })
114
+
115
+ get '/node/show/sw5'
116
+ _(last_response.ok?).must_equal true
117
+ body = last_response.body
118
+
119
+ _(body).wont_match(/secret_enable/)
120
+ _(body).wont_match(/secret_password/)
121
+ _(body).must_match(/&lt;hidden&gt;/)
122
+ _(body.include?(expected_json_body(hide_vars: true))).must_equal true
123
+
124
+ # The note data is not changed (deep copy with Marshal)
125
+ _(@serialized_node[:vars]["enable"]).must_equal "secret_enable"
126
+ end
98
127
  end
99
128
  end
100
129
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-07-18 00:00:00.000000000 Z
12
+ date: 2025-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: charlock_holmes
@@ -111,14 +111,14 @@ dependencies:
111
111
  requirements:
112
112
  - - "~>"
113
113
  - !ruby/object:Gem::Version
114
- version: 0.34.0
114
+ version: 0.34.1
115
115
  type: :runtime
116
116
  prerelease: false
117
117
  version_requirements: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - "~>"
120
120
  - !ruby/object:Gem::Version
121
- version: 0.34.0
121
+ version: 0.34.1
122
122
  - !ruby/object:Gem::Dependency
123
123
  name: puma
124
124
  requirement: !ruby/object:Gem::Requirement
@@ -251,14 +251,14 @@ dependencies:
251
251
  requirements:
252
252
  - - "~>"
253
253
  - !ruby/object:Gem::Version
254
- version: 1.78.0
254
+ version: 1.79.1
255
255
  type: :development
256
256
  prerelease: false
257
257
  version_requirements: !ruby/object:Gem::Requirement
258
258
  requirements:
259
259
  - - "~>"
260
260
  - !ruby/object:Gem::Version
261
- version: 1.78.0
261
+ version: 1.79.1
262
262
  - !ruby/object:Gem::Dependency
263
263
  name: rubocop-minitest
264
264
  requirement: !ruby/object:Gem::Requirement