foreman_scc_manager 3.1.0 → 4.0.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: 669ea1e4a29dacb7bb510a0ef50d72565e318210e4234bf91835030cccb68e09
4
- data.tar.gz: 4e93f9ad2068857d52192850a0ec32096d6b27a2bbda17c47e8b375f75244277
3
+ metadata.gz: b29c4b97a8544a564b8a29e145d3ea818ab6a59f4bf0fcd4c6bbd322028aaddf
4
+ data.tar.gz: b778dd3e956f9246d0f19e1dc88b19e0a06d0d01d091fa4046fa1ba719da3e6c
5
5
  SHA512:
6
- metadata.gz: c50116ce7db1bfe958e41a27ebc0e14a96355b21ecbab1e0449b297a87562030043f2fe5750be8a15151a9e1df8e9970f6b4a8caa607f7e53e713443f2e507ed
7
- data.tar.gz: 2a38bafa3ecf2ba0340dbb2fdd074971ba9e24f47708e67531833359f63175063bb00044136ca569c8f51c15c6f9f23ebdbe95ffcc988e9765b6b222ea1c8880
6
+ metadata.gz: 474687d7b4181867f0a00cfe6a576c84198e4cf8784a4bd94119cb18cb2b3870cd8fc1e3f6a63207731f31321405260b49d00fb0999bf8255138a268accb012f
7
+ data.tar.gz: dce03a040429f9202de34c3861bd32cc349aed0ded288d10899e4933efb1889d8dea3466d574d3e5e58e7ec665266491e699525ff4d8f99c95f5bad80d7d9384
data/README.md CHANGED
@@ -26,14 +26,11 @@ foreman-installer
26
26
 
27
27
  | Foreman Version | Katello Version | Plugin Version |
28
28
  | --------------- | --------------- | -------------- |
29
+ | 3.13 | 4.15 | ~> 4.0.0 |
30
+ | 3.7 | 4.9 | ~> 3.0.0 |
29
31
  | 3.3 | 4.5 | ~> 2.0.0 |
30
32
  | 3.1 | 4.3 | ~> 1.8.20\* |
31
33
  | 3.0 | 4.2 | ~> 1.8.20 |
32
- | 2.5 | 4.1 | ~> 1.8.20 |
33
- | 2.3 | 3.18 | ~> 1.8.9 |
34
- | 2.1 | 3.16 | ~> 1.8.5 |
35
- | 2.0 | 3.16 | ~> 1.8.4 |
36
- | 1.24 | 3.14 | ~> 1.8.0 |
37
34
 
38
35
  \* If you are using foreman_scc_manager in version 1.8.20 and then upgrade to Katello 4.3, you need to manually run the following rake task on your Foreman instance: `foreman-rake foreman_scc_manager:setup_authentication_tokens`.
39
36
 
@@ -51,7 +48,7 @@ Fork and send a Pull Request. Thanks!
51
48
 
52
49
  ## Copyright
53
50
 
54
- Copyright (c) 2023 ATIX AG - https://atix.de
51
+ Copyright (c) 2024 ATIX AG - https://atix.de
55
52
 
56
53
  This program is free software: you can redistribute it and/or modify
57
54
  it under the terms of the GNU General Public License as published by
@@ -1,9 +1,7 @@
1
- module Concerns
2
- module RecurringLogicExtensions
3
- extend ActiveSupport::Concern
1
+ module RecurringLogicExtensions
2
+ extend ActiveSupport::Concern
4
3
 
5
- included do
6
- has_one :scc_account, :inverse_of => :foreman_tasks_recurring_logic, :class_name => 'SccAccount'
7
- end
4
+ included do
5
+ has_one :scc_account, :inverse_of => :foreman_tasks_recurring_logic, :class_name => 'SccAccount'
8
6
  end
9
7
  end
@@ -38,6 +38,8 @@ class SccAccount < ApplicationRecord
38
38
  validates :mirroring_policy, :inclusion => { :in => SCC_MIRRORING_POLICIES }, :allow_blank => false
39
39
  validate :sync_date_is_valid_datetime
40
40
 
41
+ alias_attribute :recurring_logic_id, :foreman_tasks_recurring_logic_id
42
+
41
43
  after_initialize :init
42
44
  before_destroy :cancel_recurring_logic
43
45
 
@@ -4,13 +4,8 @@ module ForemanSccManager
4
4
  class Engine < ::Rails::Engine
5
5
  engine_name 'foreman_scc_manager'
6
6
 
7
- config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
8
- config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
9
- config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
10
- config.autoload_paths += Dir["#{config.root}/app/overrides"]
11
-
12
7
  config.to_prepare do
13
- ForemanTasks::RecurringLogic.include Concerns::RecurringLogicExtensions
8
+ ForemanTasks::RecurringLogic.include RecurringLogicExtensions
14
9
  end
15
10
 
16
11
  # Add any db migrations
@@ -20,84 +15,86 @@ module ForemanSccManager
20
15
  end
21
16
  end
22
17
 
23
- initializer 'foreman_scc_manager.register_plugin', :before => :finisher_hook do |_app|
24
- Foreman::Plugin.register :foreman_scc_manager do
25
- requires_foreman '>= 3.7'
26
- requires_foreman_plugin 'katello', '>= 3.16.0'
27
- register_gettext
28
-
29
- precompile_assets 'foreman_scc_manager/scc_accounts.js'
30
-
31
- apipie_documented_controllers ["#{ForemanSccManager::Engine.root}/app/controllers/api/v2/*.rb"]
32
-
33
- # Add permissions
34
- security_block :foreman_scc_manager do
35
- permission :view_scc_accounts,
36
- { :scc_accounts => [:show, :index, :auto_complete_search],
37
- :'api/v2/scc_accounts' => [:show, :index, :auto_complete_search] },
38
- :resource_type => 'SccAccount'
39
-
40
- permission :use_scc_accounts,
41
- { :scc_accounts => [:bulk_subscribe],
42
- :'api/v2/scc_accounts' => [:bulk_subscribe, :bulk_subscribe_with_repos] },
43
- :resource_type => 'SccAccount'
44
-
45
- permission :new_scc_accounts,
46
- { :scc_accounts => [:new, :create],
47
- :'api/v2/scc_accounts' => [:create] },
48
- :resource_type => 'SccAccount'
49
-
50
- permission :edit_scc_accounts,
51
- { :scc_accounts => [:edit, :update],
52
- :'api/v2/scc_accounts' => [:update] },
53
- :resource_type => 'SccAccount'
54
-
55
- permission :delete_scc_accounts,
56
- { :scc_accounts => [:destroy],
57
- :'api/v2/scc_accounts' => [:destroy] },
58
- :resource_type => 'SccAccount'
59
-
60
- permission :sync_scc_accounts,
61
- { :scc_accounts => [:sync],
62
- :'api/v2/scc_accounts' => [:sync] },
63
- :resource_type => 'SccAccount'
64
-
65
- permission :test_connection_scc_accounts,
66
- { :scc_accounts => [:test_connection],
67
- :'api/v2/scc_accounts' => [:test_connection] },
68
- :resource_type => 'SccAccount'
69
-
70
- permission :view_scc_products,
71
- { :scc_products => [:index, :show],
72
- :'api/v2/scc_products' => [:index, :show] },
73
- :resource_type => 'SccProduct'
74
-
75
- permission :subscribe_scc_products,
76
- { :scc_products => [:subscribe, :unsubscribe],
77
- :'api/v2/scc_products' => [:subscribe, :unsibscribe] },
78
- :resource_type => 'SccProduct'
18
+ initializer 'foreman_scc_manager.register_plugin', :before => :finisher_hook do |app|
19
+ app.reloader.to_prepare do
20
+ Foreman::Plugin.register :foreman_scc_manager do
21
+ requires_foreman '>= 3.13'
22
+ requires_foreman_plugin 'katello', '>= 3.16.0'
23
+ register_gettext
24
+
25
+ precompile_assets 'foreman_scc_manager/scc_accounts.js'
26
+
27
+ apipie_documented_controllers ["#{ForemanSccManager::Engine.root}/app/controllers/api/v2/*.rb"]
28
+
29
+ # Add permissions
30
+ security_block :foreman_scc_manager do
31
+ permission :view_scc_accounts,
32
+ { :scc_accounts => [:show, :index, :auto_complete_search],
33
+ :'api/v2/scc_accounts' => [:show, :index, :auto_complete_search] },
34
+ :resource_type => 'SccAccount'
35
+
36
+ permission :use_scc_accounts,
37
+ { :scc_accounts => [:bulk_subscribe],
38
+ :'api/v2/scc_accounts' => [:bulk_subscribe, :bulk_subscribe_with_repos] },
39
+ :resource_type => 'SccAccount'
40
+
41
+ permission :new_scc_accounts,
42
+ { :scc_accounts => [:new, :create],
43
+ :'api/v2/scc_accounts' => [:create] },
44
+ :resource_type => 'SccAccount'
45
+
46
+ permission :edit_scc_accounts,
47
+ { :scc_accounts => [:edit, :update],
48
+ :'api/v2/scc_accounts' => [:update] },
49
+ :resource_type => 'SccAccount'
50
+
51
+ permission :delete_scc_accounts,
52
+ { :scc_accounts => [:destroy],
53
+ :'api/v2/scc_accounts' => [:destroy] },
54
+ :resource_type => 'SccAccount'
55
+
56
+ permission :sync_scc_accounts,
57
+ { :scc_accounts => [:sync],
58
+ :'api/v2/scc_accounts' => [:sync] },
59
+ :resource_type => 'SccAccount'
60
+
61
+ permission :test_connection_scc_accounts,
62
+ { :scc_accounts => [:test_connection],
63
+ :'api/v2/scc_accounts' => [:test_connection] },
64
+ :resource_type => 'SccAccount'
65
+
66
+ permission :view_scc_products,
67
+ { :scc_products => [:index, :show],
68
+ :'api/v2/scc_products' => [:index, :show] },
69
+ :resource_type => 'SccProduct'
70
+
71
+ permission :subscribe_scc_products,
72
+ { :scc_products => [:subscribe, :unsubscribe],
73
+ :'api/v2/scc_products' => [:subscribe, :unsibscribe] },
74
+ :resource_type => 'SccProduct'
75
+ end
76
+
77
+ # Add a new role called 'SccManager' if it doesn't exist
78
+ role 'SccManager',
79
+ %i[view_scc_accounts use_scc_accounts new_scc_accounts edit_scc_accounts
80
+ delete_scc_accounts sync_scc_accounts test_connection_scc_accounts
81
+ view_scc_products subscribe_scc_products],
82
+ 'Role granting permissons to manage SUSE Subscriptions'
83
+
84
+ role 'SccViewer',
85
+ %i[view_scc_accounts use_scc_accounts sync_scc_accounts
86
+ create_products view_products subscribe_scc_products view_scc_products],
87
+ 'Role granting permissons to view and use SUSE Subscriptions'
88
+
89
+ add_all_permissions_to_default_roles
90
+
91
+ # add menu entry
92
+ menu :top_menu, :scc_manager,
93
+ url_hash: { controller: :scc_accounts, action: :index },
94
+ caption: _('SUSE Subscriptions'),
95
+ parent: :content_menu,
96
+ after: :red_hat_subscriptions
79
97
  end
80
-
81
- # Add a new role called 'SccManager' if it doesn't exist
82
- role 'SccManager',
83
- %i[view_scc_accounts use_scc_accounts new_scc_accounts edit_scc_accounts
84
- delete_scc_accounts sync_scc_accounts test_connection_scc_accounts
85
- view_scc_products subscribe_scc_products],
86
- 'Role granting permissons to manage SUSE Subscriptions'
87
-
88
- role 'SccViewer',
89
- %i[view_scc_accounts use_scc_accounts sync_scc_accounts
90
- create_products view_products subscribe_scc_products view_scc_products],
91
- 'Role granting permissons to view and use SUSE Subscriptions'
92
-
93
- add_all_permissions_to_default_roles
94
-
95
- # add menu entry
96
- menu :top_menu, :scc_manager,
97
- url_hash: { controller: :scc_accounts, action: :index },
98
- caption: _('SUSE Subscriptions'),
99
- parent: :content_menu,
100
- after: :red_hat_subscriptions
101
98
  end
102
99
  end
103
100
 
@@ -1,3 +1,3 @@
1
1
  module ForemanSccManager
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '4.0.0'.freeze
3
3
  end
@@ -251,7 +251,7 @@ class Api::V2::SccAccountsControllerTest < ActionController::TestCase
251
251
  put :update, params: { id: account.id, scc_account: { :base_url => '', :sync_date => Time.now, :interval => 'weekly' } }
252
252
 
253
253
  assert_response :unprocessable_entity
254
- assert_error_message "Base url can't be blank"
254
+ assert_error_message "Base URL can't be blank"
255
255
  end
256
256
 
257
257
  test 'new account SCC server connection-test' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_scc_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-02 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: coffee-rails
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 5.0.0
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 5.0.0
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: katello
63
77
  requirement: !ruby/object:Gem::Requirement
@@ -223,7 +237,7 @@ homepage: https://www.orcharhino.com/
223
237
  licenses:
224
238
  - GPL-3.0
225
239
  metadata: {}
226
- post_install_message:
240
+ post_install_message:
227
241
  rdoc_options: []
228
242
  require_paths:
229
243
  - lib
@@ -238,27 +252,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
252
  - !ruby/object:Gem::Version
239
253
  version: '0'
240
254
  requirements: []
241
- rubygems_version: 3.1.2
242
- signing_key:
255
+ rubygems_version: 3.3.27
256
+ signing_key:
243
257
  specification_version: 4
244
258
  summary: Suse Customer Center plugin for Foreman
245
259
  test_files:
246
- - test/support/fixtures_support.rb
247
- - test/unit/foreman_scc_manager_test.rb
248
260
  - test/actions/sync_test.rb
249
- - test/test_plugin_helper.rb
261
+ - test/controllers/api/v2/scc_accounts_test.rb
262
+ - test/controllers/api/v2/scc_products_test.rb
263
+ - test/controllers/scc_accounts_controller_test.rb
250
264
  - test/factories/foreman_scc_manager_factories.rb
251
- - test/models/scc_product_test.rb
252
- - test/models/scc_account_test.rb
253
265
  - test/features/sync_test.rb
254
- - test/fixtures/models/scc_repositories.yml
255
- - test/fixtures/models/katello_root_repositories.yml
256
- - test/fixtures/models/scc_accounts.yml
257
- - test/fixtures/models/scc_products.yml
258
266
  - test/fixtures/files/data_products_page1.json
259
- - test/fixtures/files/data_subscriptions.json
260
267
  - test/fixtures/files/data_products_page2.json
261
268
  - test/fixtures/files/data_repositories.json
262
- - test/controllers/scc_accounts_controller_test.rb
263
- - test/controllers/api/v2/scc_products_test.rb
264
- - test/controllers/api/v2/scc_accounts_test.rb
269
+ - test/fixtures/files/data_subscriptions.json
270
+ - test/fixtures/models/katello_root_repositories.yml
271
+ - test/fixtures/models/scc_accounts.yml
272
+ - test/fixtures/models/scc_products.yml
273
+ - test/fixtures/models/scc_repositories.yml
274
+ - test/models/scc_account_test.rb
275
+ - test/models/scc_product_test.rb
276
+ - test/support/fixtures_support.rb
277
+ - test/test_plugin_helper.rb
278
+ - test/unit/foreman_scc_manager_test.rb