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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e703d5ad965ed3aecba3fee0dc31a7a2c80a84eab893392484555fda8ba8ab1
4
- data.tar.gz: 6dce2771bea3df536cb244aadfbad6483387d71157c4b70d5cbe0256b27f508c
3
+ metadata.gz: 6bc195afe4c0af30313894eaf37dcf99c36625fe510998783df94932111c9891
4
+ data.tar.gz: 8d37c47d99c8d48163242ce490159c59a6a4e6c2588709daac0bac841a450c5a
5
5
  SHA512:
6
- metadata.gz: e3c24e7c223b0103333d21717636f338176cb2756028d60943c8e6276ffaa366de039dec2b5afd527b5f50464737194b6cc6d5e357f9696d6b56aff167b7fc6e
7
- data.tar.gz: ca91aa5af43494a254fbe03bd13cb4e4e30dccfdab8e47befb8252f97b2cce1bd8ab850739993d1675d194f3253a8b5825b248f6d95cc75b6b7c4915252356eb
6
+ metadata.gz: cf715511ef2835a64702b2f865c6380c178dd8c70b2038428ea3a0c9a72fefcef4715ec4c2bcca82fbf687c9ea5a463c5e041009fe7e795cb6aab6484020d6f3
7
+ data.tar.gz: 8c4c4cbaad0dffa2f7d338d19e116cc58c05272b262d36d5bf221137391577a414dcd3ba83c34d78c46207bf8298675529a988d42fd736961751687325b615b1
data/README.md CHANGED
@@ -34,6 +34,8 @@ touch ~foreman/tmp/restart.txt
34
34
  | --------------- | --------------:|
35
35
  | >= 1.15 | ~> 0.1 |
36
36
  | >= 1.17 | ~> 1.0 |
37
+ | >= 2.0 | ~> 2.0 |
38
+ | >= 2.2 | ~> 2.1 |
37
39
 
38
40
  # Usage
39
41
 
@@ -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.0'
33
+ requires_foreman '>= 2.2'
34
34
 
35
35
  apipie_documented_controllers ["#{ForemanMonitoring::Engine.root}/app/controllers/api/v2/*.rb"]
36
36
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanMonitoring
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
@@ -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
- put :create
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
- put :create
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
- put :create, params: { duration: 3600 }
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
- put :create, params: { duration: '3600' }
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
- put :create, params: { reason: 'In testing' }
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.0.0
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-08-11 00:00:00.000000000 Z
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.1.2
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/unit/host_test.rb
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