foreman_monitoring 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/controllers/concerns/foreman_monitoring/find_host_by_client_cert.rb +1 -0
- data/db/migrate/201910180900_rename_downtime_host_permission.rb +2 -2
- data/lib/foreman_monitoring/engine.rb +1 -1
- data/lib/foreman_monitoring/version.rb +1 -1
- data/test/controllers/api/v2/downtime_controller_test.rb +5 -5
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bc195afe4c0af30313894eaf37dcf99c36625fe510998783df94932111c9891
|
4
|
+
data.tar.gz: 8d37c47d99c8d48163242ce490159c59a6a4e6c2588709daac0bac841a450c5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf715511ef2835a64702b2f865c6380c178dd8c70b2038428ea3a0c9a72fefcef4715ec4c2bcca82fbf687c9ea5a463c5e041009fe7e795cb6aab6484020d6f3
|
7
|
+
data.tar.gz: 8c4c4cbaad0dffa2f7d338d19e116cc58c05272b262d36d5bf221137391577a414dcd3ba83c34d78c46207bf8298675529a988d42fd736961751687325b615b1
|
data/README.md
CHANGED
@@ -7,6 +7,7 @@ module ForemanMonitoring
|
|
7
7
|
module ClassMethods
|
8
8
|
def authorize_host_by_client_cert(actions, _options = {})
|
9
9
|
skip_before_action :require_login, :only => actions, :raise => false
|
10
|
+
skip_before_action :check_user_enabled, :only => actions, :raise => false
|
10
11
|
skip_before_action :authorize, :only => actions
|
11
12
|
skip_before_action :verify_authenticity_token, :only => actions
|
12
13
|
skip_before_action :set_taxonomy, :only => actions, :raise => false
|
@@ -3,13 +3,13 @@
|
|
3
3
|
class RenameDowntimeHostPermission < ActiveRecord::Migration[5.2]
|
4
4
|
def up
|
5
5
|
# rubocop:disable Rails/SkipsModelValidations
|
6
|
-
Permission.where(name: 'manage_host_downtimes').update_all(name: 'manage_downtime_hosts')
|
6
|
+
Permission.where(name: 'manage_host_downtimes').update_all(name: 'manage_downtime_hosts') if table_exists?(:permissions)
|
7
7
|
# rubocop:enable Rails/SkipsModelValidations
|
8
8
|
end
|
9
9
|
|
10
10
|
def down
|
11
11
|
# rubocop:disable Rails/SkipsModelValidations
|
12
|
-
Permission.where(name: 'manage_downtime_hosts').update_all(name: 'manage_host_downtimes')
|
12
|
+
Permission.where(name: 'manage_downtime_hosts').update_all(name: 'manage_host_downtimes') if table_exists?(:permissions)
|
13
13
|
# rubocop:enable Rails/SkipsModelValidations
|
14
14
|
end
|
15
15
|
end
|
@@ -30,7 +30,7 @@ module ForemanMonitoring
|
|
30
30
|
|
31
31
|
initializer 'foreman_monitoring.register_plugin', :before => :finisher_hook do |_app|
|
32
32
|
Foreman::Plugin.register :foreman_monitoring do
|
33
|
-
requires_foreman '>= 2.
|
33
|
+
requires_foreman '>= 2.2'
|
34
34
|
|
35
35
|
apipie_documented_controllers ["#{ForemanMonitoring::Engine.root}/app/controllers/api/v2/*.rb"]
|
36
36
|
|
@@ -8,7 +8,7 @@ class Api::V2::DowntimeControllerTest < ActionController::TestCase
|
|
8
8
|
context 'with user authentication' do
|
9
9
|
context '#create' do
|
10
10
|
test 'should deny access' do
|
11
|
-
|
11
|
+
post :create
|
12
12
|
assert_response :forbidden
|
13
13
|
end
|
14
14
|
end
|
@@ -29,7 +29,7 @@ class Api::V2::DowntimeControllerTest < ActionController::TestCase
|
|
29
29
|
|
30
30
|
context '#create' do
|
31
31
|
test 'should create downtime' do
|
32
|
-
|
32
|
+
post :create
|
33
33
|
assert_response :success
|
34
34
|
end
|
35
35
|
end
|
@@ -37,13 +37,13 @@ class Api::V2::DowntimeControllerTest < ActionController::TestCase
|
|
37
37
|
context '#create with duration' do
|
38
38
|
test 'should create downtime with given duration' do
|
39
39
|
Host::Managed.any_instance.expects(:downtime_host).with { |params| params[:end_time] - params[:start_time] == 3600 }
|
40
|
-
|
40
|
+
post :create, params: { duration: 3600 }
|
41
41
|
assert_response :success
|
42
42
|
end
|
43
43
|
|
44
44
|
test 'should create downtime with given duration as string' do
|
45
45
|
Host::Managed.any_instance.expects(:downtime_host).with { |params| params[:end_time] - params[:start_time] == 3600 }
|
46
|
-
|
46
|
+
post :create, params: { duration: '3600' }
|
47
47
|
assert_response :success
|
48
48
|
end
|
49
49
|
end
|
@@ -51,7 +51,7 @@ class Api::V2::DowntimeControllerTest < ActionController::TestCase
|
|
51
51
|
context '#create with reason' do
|
52
52
|
test 'should create downtime with given reason' do
|
53
53
|
Host::Managed.any_instance.expects(:downtime_host).with { |params| params[:comment] == 'In testing' }
|
54
|
-
|
54
|
+
post :create, params: { reason: 'In testing' }
|
55
55
|
assert_response :success
|
56
56
|
end
|
57
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_monitoring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Goebel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -156,7 +156,7 @@ homepage: https://github.com/theforeman/foreman_monitoring
|
|
156
156
|
licenses:
|
157
157
|
- GPL-3.0
|
158
158
|
metadata: {}
|
159
|
-
post_install_message:
|
159
|
+
post_install_message:
|
160
160
|
rdoc_options: []
|
161
161
|
require_paths:
|
162
162
|
- lib
|
@@ -171,20 +171,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
175
|
-
signing_key:
|
174
|
+
rubygems_version: 3.0.3
|
175
|
+
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Foreman plugin for monitoring system integration.
|
178
178
|
test_files:
|
179
|
-
- test/
|
180
|
-
- test/unit/monitoring_result_test.rb
|
181
|
-
- test/unit/host_status/monitoring_status_test.rb
|
182
|
-
- test/unit/monitoring_test.rb
|
183
|
-
- test/factories/smart_proxy.rb
|
179
|
+
- test/factories/host.rb
|
184
180
|
- test/factories/monitoring_results.rb
|
181
|
+
- test/factories/smart_proxy.rb
|
185
182
|
- test/factories/feature.rb
|
186
|
-
- test/factories/host.rb
|
187
183
|
- test/lib/proxy_api/monitoring_test.rb
|
188
|
-
- test/test_plugin_helper.rb
|
189
|
-
- test/controllers/api/v2/downtime_controller_test.rb
|
190
184
|
- test/functional/hosts_controller_test.rb
|
185
|
+
- test/controllers/api/v2/downtime_controller_test.rb
|
186
|
+
- test/test_plugin_helper.rb
|
187
|
+
- test/unit/monitoring_result_test.rb
|
188
|
+
- test/unit/host_test.rb
|
189
|
+
- test/unit/monitoring_test.rb
|
190
|
+
- test/unit/host_status/monitoring_status_test.rb
|