katello 3.17.0 → 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
- data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
- data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
- data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
- data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
- data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
- data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_controller.rb +9 -9
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
- data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
- data/app/helpers/katello/katello_urls_helper.rb +5 -2
- data/app/lib/actions/candlepin/product/content_create.rb +2 -0
- data/app/lib/actions/candlepin/product/content_update.rb +2 -0
- data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +9 -9
- data/app/lib/actions/katello/content_view_version/import.rb +8 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
- data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
- data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
- data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
- data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
- data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
- data/app/lib/actions/katello/product/content_create.rb +7 -6
- data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
- data/app/lib/actions/katello/repository/import_upload.rb +4 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +3 -1
- data/app/lib/actions/katello/repository/update.rb +5 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
- data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
- data/app/lib/actions/pulp3/content_migration.rb +10 -0
- data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
- data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
- data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
- data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
- data/app/lib/actions/pulp3/import_migration.rb +6 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
- data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/delete.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
- data/app/lib/katello/resources/candlepin/owner.rb +5 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
- data/app/lib/katello/resources/registry.rb +3 -3
- data/app/models/katello/authorization/activation_key.rb +4 -0
- data/app/models/katello/authorization/content_view.rb +13 -0
- data/app/models/katello/authorization/content_view_component.rb +15 -0
- data/app/models/katello/authorization/content_view_filter.rb +15 -0
- data/app/models/katello/authorization/content_view_version.rb +25 -2
- data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
- data/app/models/katello/authorization/gpg_key.rb +12 -4
- data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
- data/app/models/katello/authorization/organization.rb +8 -0
- data/app/models/katello/authorization/sync_plan.rb +16 -0
- data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +4 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
- data/app/models/katello/content_migration_progress.rb +4 -0
- data/app/models/katello/content_view.rb +30 -4
- data/app/models/katello/content_view_component.rb +2 -0
- data/app/models/katello/content_view_filter.rb +5 -0
- data/app/models/katello/content_view_history.rb +2 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +8 -0
- data/app/models/katello/content_view_repository.rb +13 -1
- data/app/models/katello/content_view_version_export_history.rb +8 -1
- data/app/models/katello/glue/candlepin/pool.rb +9 -14
- data/app/models/katello/glue/pulp/repo.rb +8 -0
- data/app/models/katello/gpg_key.rb +1 -1
- data/app/models/katello/ping.rb +8 -3
- data/app/models/katello/repository.rb +33 -0
- data/app/models/katello/root_repository.rb +26 -1
- data/app/models/katello/smart_proxy_sync_history.rb +8 -0
- data/app/services/katello/candlepin/event_handler.rb +2 -0
- data/app/services/katello/candlepin/message_handler.rb +34 -0
- data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
- data/app/services/katello/host_status_manager.rb +9 -0
- data/app/services/katello/pulp3/api/apt.rb +57 -0
- data/app/services/katello/pulp3/api/core.rb +8 -0
- data/app/services/katello/pulp3/api/docker.rb +4 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
- data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
- data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
- data/app/services/katello/pulp3/deb.rb +38 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/migration.rb +51 -10
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
- data/app/services/katello/pulp3/repository.rb +10 -4
- data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
- data/app/services/katello/pulp3/repository/apt.rb +63 -0
- data/app/services/katello/pulp3/repository/docker.rb +9 -0
- data/app/services/katello/pulp3/repository/yum.rb +14 -9
- data/app/services/katello/pulp3/repository_mirror.rb +9 -4
- data/app/services/katello/pulp3/task.rb +4 -0
- data/app/services/katello/pulp3/task_group.rb +4 -0
- data/app/services/katello/repository_type.rb +2 -1
- data/app/services/katello/smart_proxy_helper.rb +9 -0
- data/app/views/dashboard/_subscription_widget.html.erb +0 -5
- data/app/views/foreman/hosts/_registration.html.erb +12 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/app/views/katello/layouts/react.html.erb +3 -2
- data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
- data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
- data/config/routes/api/v2.rb +24 -2
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
- data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
- data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
- data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
- data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
- data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
- data/lib/katello/engine.rb +2 -0
- data/lib/katello/permission_creator.rb +98 -69
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +10 -2
- data/lib/katello/repository_types/deb.rb +9 -1
- data/lib/katello/tasks/pulp3_migration.rake +17 -3
- data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
- data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
- data/lib/katello/tasks/reset.rake +2 -1
- data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +51 -44
- data/locale/bn/katello.po +279 -55
- data/locale/cs/katello.po +278 -51
- data/locale/de/katello.po +279 -52
- data/locale/en/katello.po +278 -49
- data/locale/es/katello.po +279 -51
- data/locale/fr/katello.po +279 -51
- data/locale/gu/katello.po +279 -55
- data/locale/hi/katello.po +279 -55
- data/locale/it/katello.po +279 -51
- data/locale/ja/katello.po +279 -52
- data/locale/katello.pot +1379 -971
- data/locale/kn/katello.po +279 -55
- data/locale/ko/katello.po +279 -51
- data/locale/mr/katello.po +279 -55
- data/locale/or/katello.po +279 -55
- data/locale/pa/katello.po +279 -55
- data/locale/pt/katello.po +278 -52
- data/locale/pt_BR/katello.po +279 -51
- data/locale/ru/katello.po +279 -51
- data/locale/ta/katello.po +279 -55
- data/locale/te/katello.po +279 -55
- data/locale/zh_CN/katello.po +279 -51
- data/locale/zh_TW/katello.po +279 -52
- data/webpack/components/ActionableDetail.js +2 -1
- data/webpack/components/Search/Search.js +1 -1
- data/webpack/components/Table/MainTable.js +6 -2
- data/webpack/components/Table/TableWrapper.js +46 -9
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
- data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
- data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
- metadata +74 -13
- data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -37,7 +37,7 @@ module Katello
|
|
37
37
|
before_action :find_organization, :only => [:create, :paths, :auto_complete_search]
|
38
38
|
before_action :find_optional_organization, :only => [:index, :show, :update, :destroy]
|
39
39
|
before_action :find_prior, :only => [:create]
|
40
|
-
before_action :
|
40
|
+
before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :repositories]
|
41
41
|
before_action :find_content_view, :only => [:repositories]
|
42
42
|
before_action :find_path, :only => [:create]
|
43
43
|
|
@@ -154,16 +154,16 @@ module Katello
|
|
154
154
|
respond_for_index(:collection => collection, :template => :paths)
|
155
155
|
end
|
156
156
|
|
157
|
-
|
157
|
+
def resource_name
|
158
|
+
'environment'
|
159
|
+
end
|
158
160
|
|
159
|
-
def
|
160
|
-
|
161
|
-
@environment = KTEnvironment.find(identifier)
|
162
|
-
fail HttpErrors::NotFound, _("Couldn't find environment '%s'") % identifier.to_s if @environment.nil?
|
163
|
-
@organization = @environment.organization
|
164
|
-
@environment
|
161
|
+
def resource_class
|
162
|
+
Katello::KTEnvironment
|
165
163
|
end
|
166
164
|
|
165
|
+
protected
|
166
|
+
|
167
167
|
def find_prior
|
168
168
|
prior = params[:environment][:prior] || params.require(:environment).require(:prior_id)
|
169
169
|
@prior = KTEnvironment.readable.find(prior)
|
@@ -52,13 +52,13 @@ module Katello
|
|
52
52
|
respond_for_create(:resource => gpg_key)
|
53
53
|
end
|
54
54
|
|
55
|
-
api :GET, "/gpg_keys/:id", N_("Show a gpg key")
|
55
|
+
api :GET, "/gpg_keys/:id", N_("Show a gpg key"), :deprecated => true
|
56
56
|
param :id, :number, :desc => N_("gpg key numeric identifier"), :required => true
|
57
57
|
def show
|
58
58
|
respond_for_show(:resource => @gpg_key)
|
59
59
|
end
|
60
60
|
|
61
|
-
api :PUT, "/gpg_keys/:id", N_("Update a repository")
|
61
|
+
api :PUT, "/gpg_keys/:id", N_("Update a repository"), :deprecated => true
|
62
62
|
param :id, :number, :desc => N_("gpg key numeric identifier"), :required => true
|
63
63
|
param_group :gpg_key
|
64
64
|
def update
|
@@ -67,20 +67,20 @@ module Katello
|
|
67
67
|
respond_for_show(:resource => @gpg_key)
|
68
68
|
end
|
69
69
|
|
70
|
-
api :DELETE, "/gpg_keys/:id", N_("Destroy a gpg key")
|
70
|
+
api :DELETE, "/gpg_keys/:id", N_("Destroy a gpg key"), :deprecated => true
|
71
71
|
param :id, :number, :desc => N_("gpg key numeric identifier"), :required => true
|
72
72
|
def destroy
|
73
73
|
@gpg_key.destroy
|
74
74
|
respond_for_destroy
|
75
75
|
end
|
76
76
|
|
77
|
-
api :GET, "/gpg_keys/:id/content", N_("Return the content of a gpg key, used directly by yum")
|
77
|
+
api :GET, "/gpg_keys/:id/content", N_("Return the content of a gpg key, used directly by yum"), :deprecated => true
|
78
78
|
param :id, :number, :required => true
|
79
79
|
def content
|
80
80
|
render(:plain => @gpg_key.content, :layout => false)
|
81
81
|
end
|
82
82
|
|
83
|
-
api :POST, "/gpg_keys/:id/content", N_("Upload gpg key contents")
|
83
|
+
api :POST, "/gpg_keys/:id/content", N_("Upload gpg key contents"), :deprecated => true
|
84
84
|
param :id, :number, :desc => N_("gpg key numeric identifier"), :required => true
|
85
85
|
param :content, File, :desc => N_("file contents"), :required => true
|
86
86
|
def set_content
|
@@ -1,10 +1,17 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::HostCollectionsController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
|
-
before_action :
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
before_action :find_authorized_katello_resource, :only => [
|
5
|
+
:copy,
|
6
|
+
:show,
|
7
|
+
:update,
|
8
|
+
:destroy,
|
9
|
+
:add_hosts,
|
10
|
+
:remove_hosts,
|
11
|
+
:hosts
|
12
|
+
]
|
13
|
+
before_action :find_readable_activation_key, :only => [:index]
|
14
|
+
before_action :find_editable_host, :only => [:index]
|
8
15
|
before_action :find_optional_organization, :only => [:index]
|
9
16
|
before_action :find_organization, :only => [:create, :auto_complete_search]
|
10
17
|
|
@@ -175,14 +182,6 @@ module Katello
|
|
175
182
|
|
176
183
|
private
|
177
184
|
|
178
|
-
def find_host_collection
|
179
|
-
@organization = @host.organization if @host
|
180
|
-
@organization = @activation_key.organization if @activation_key
|
181
|
-
id = params[:host_collection_id] || params[:id]
|
182
|
-
@host_collection = HostCollection.where(:id => id).first
|
183
|
-
fail HttpErrors::NotFound, _("Couldn't find host collection '%s'") % id if @host_collection.nil?
|
184
|
-
end
|
185
|
-
|
186
185
|
def host_collection_params
|
187
186
|
attrs = [:name,
|
188
187
|
:description,
|
@@ -199,14 +198,18 @@ module Katello
|
|
199
198
|
result
|
200
199
|
end
|
201
200
|
|
202
|
-
def
|
201
|
+
def find_editable_host
|
203
202
|
@host = resource_finder(::Host::Managed.authorized("edit_hosts"), params[:host_id]) if params[:host_id]
|
204
203
|
@organization = @host.organization if @host
|
205
204
|
end
|
206
205
|
|
207
|
-
def
|
208
|
-
@activation_key = ActivationKey.find_by
|
209
|
-
|
206
|
+
def find_readable_activation_key
|
207
|
+
@activation_key = ActivationKey.readable.find_by(:id => params[:activation_key_id]) if params[:activation_key_id]
|
208
|
+
if params[:activation_key_id] && @activation_key.nil?
|
209
|
+
throw_resource_not_found(name: 'activation_key', id: params[:activation_key_id])
|
210
|
+
else
|
211
|
+
@organization = @activation_key&.organization
|
212
|
+
end
|
210
213
|
end
|
211
214
|
end
|
212
215
|
end
|
@@ -125,13 +125,13 @@ module Katello
|
|
125
125
|
|
126
126
|
def find_host
|
127
127
|
@host = resource_finder(::Host::Managed.authorized("view_hosts"), params[:host_id])
|
128
|
-
|
128
|
+
throw_resource_not_found(name: 'host', id: params[:host_id]) if @host.nil?
|
129
129
|
@host
|
130
130
|
end
|
131
131
|
|
132
132
|
def find_host_editable
|
133
133
|
@host = resource_finder(::Host::Managed.authorized("edit_hosts"), params[:host_id])
|
134
|
-
|
134
|
+
throw_resource_not_found(name: 'host', id: params[:host_id]) if @host.nil?
|
135
135
|
@host
|
136
136
|
end
|
137
137
|
|
@@ -7,11 +7,12 @@ module Katello
|
|
7
7
|
before_action :find_host_collections, :only => [:bulk_add_host_collections, :bulk_remove_host_collections]
|
8
8
|
before_action :find_environment, :only => [:environment_content_view]
|
9
9
|
before_action :find_content_view, :only => [:environment_content_view]
|
10
|
-
before_action :find_editable_hosts, :except => [:destroy_hosts, :
|
10
|
+
before_action :find_editable_hosts, :except => [:destroy_hosts, :resolve_traces]
|
11
11
|
before_action :find_deletable_hosts, :only => [:destroy_hosts]
|
12
12
|
before_action :find_readable_hosts, :only => [:applicable_errata, :installable_errata, :available_incremental_updates]
|
13
13
|
before_action :find_errata, :only => [:available_incremental_updates]
|
14
14
|
before_action :find_organization, :only => [:add_subscriptions]
|
15
|
+
before_action :find_traces, :only => [:resolve_traces]
|
15
16
|
before_action :deprecate_katello_agent, :only => [:install_content, :update_content, :remove_content]
|
16
17
|
|
17
18
|
before_action :validate_content_action, :only => [:install_content, :update_content, :remove_content]
|
@@ -241,12 +242,28 @@ module Katello
|
|
241
242
|
param_group :bulk_params
|
242
243
|
param :trace_ids, Array, :required => true, :desc => N_("Array of Trace IDs")
|
243
244
|
def resolve_traces
|
244
|
-
|
245
|
-
result = Katello::HostTraceManager.resolve_traces(traces)
|
245
|
+
result = Katello::HostTraceManager.resolve_traces(@traces)
|
246
246
|
|
247
247
|
render json: result
|
248
248
|
end
|
249
249
|
|
250
|
+
api :PUT, "/hosts/bulk/system_purpose", N_("Assign system purpose attributes on one or more hosts")
|
251
|
+
param_group :bulk_params
|
252
|
+
param :service_level, String, :desc => N_("Service level of host")
|
253
|
+
param :purpose_role, String, :desc => N_("Role of host")
|
254
|
+
param :purpose_usage, String, :desc => N_("Usage of host")
|
255
|
+
param :purpose_addons, Array, :desc => N_("Sets the system add-ons")
|
256
|
+
def system_purpose
|
257
|
+
task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::UpdateSystemPurpose,
|
258
|
+
@hosts,
|
259
|
+
params[:service_level],
|
260
|
+
params[:purpose_role],
|
261
|
+
params[:purpose_usage],
|
262
|
+
params[:purpose_addons])
|
263
|
+
|
264
|
+
respond_for_async :resource => task
|
265
|
+
end
|
266
|
+
|
250
267
|
api :POST, "/hosts/bulk/available_incremental_updates", N_("Given a set of hosts and errata, lists the content view versions" \
|
251
268
|
" and environments that need updating.")
|
252
269
|
param_group :bulk_params
|
@@ -297,7 +314,9 @@ module Katello
|
|
297
314
|
end
|
298
315
|
|
299
316
|
def find_host_collections
|
300
|
-
|
317
|
+
throw_resources_not_found(name: 'host collection', expected_ids: params[:host_collection_ids]) do
|
318
|
+
@host_collections = HostCollection.editable.where(id: params[:host_collection_ids])
|
319
|
+
end
|
301
320
|
end
|
302
321
|
|
303
322
|
def find_readable_hosts
|
@@ -360,11 +379,21 @@ module Katello
|
|
360
379
|
end
|
361
380
|
|
362
381
|
def find_environment
|
363
|
-
@environment = KTEnvironment.find(params[:environment_id])
|
382
|
+
@environment = KTEnvironment.editable.find(params[:environment_id])
|
383
|
+
throw_resource_not_found(name: 'lifecycle environment', id: params[:environment_id]) unless @environment
|
384
|
+
@environment
|
364
385
|
end
|
365
386
|
|
366
387
|
def find_content_view
|
367
|
-
@view = ContentView.find(params[:content_view_id])
|
388
|
+
@view = ContentView.editable.find(params[:content_view_id])
|
389
|
+
throw_resource_not_found(name: 'content view', id: params[:content_view_id]) unless @view
|
390
|
+
@view
|
391
|
+
end
|
392
|
+
|
393
|
+
def find_traces
|
394
|
+
throw_resources_not_found(name: 'host trace', expected_ids: params[:trace_ids]) do
|
395
|
+
@traces = Katello::HostTracer.resolvable.where(id: params[:trace_ids])
|
396
|
+
end
|
368
397
|
end
|
369
398
|
|
370
399
|
def disable_erratum_hosts_count
|
@@ -4,7 +4,7 @@ module Katello
|
|
4
4
|
|
5
5
|
before_action :find_activation_key, :only => [:index]
|
6
6
|
before_action :find_organization, :only => [:create, :index, :auto_complete_search]
|
7
|
-
before_action :
|
7
|
+
before_action :find_authorized_katello_resource, :only => [:update, :destroy, :sync]
|
8
8
|
before_action :find_organization_from_product, :only => [:update]
|
9
9
|
before_action :authorize_gpg_key, :only => [:update, :create]
|
10
10
|
before_action :authorize_ssl_ca_cert, :only => [:update, :create]
|
@@ -131,14 +131,14 @@ module Katello
|
|
131
131
|
protected
|
132
132
|
|
133
133
|
def find_product(options = {})
|
134
|
-
@product = Product.includes(options[:includes] || []).find_by(:id => params[:id])
|
135
|
-
|
134
|
+
@product = Product.includes(options[:includes] || []).readable.find_by(:id => params[:id])
|
135
|
+
throw_resource_not_found(name: 'product', id: params[:id]) if @product.nil?
|
136
136
|
end
|
137
137
|
|
138
138
|
def find_activation_key
|
139
139
|
if params[:activation_key_id]
|
140
|
-
@activation_key = ActivationKey.find_by(:id => params[:activation_key_id])
|
141
|
-
|
140
|
+
@activation_key = ActivationKey.readable.find_by(:id => params[:activation_key_id])
|
141
|
+
throw_resource_not_found(name: 'Activation Key', id: params[:activation_key_id]) if @activation_key.nil?
|
142
142
|
@organization = @activation_key.organization
|
143
143
|
end
|
144
144
|
end
|
@@ -151,7 +151,7 @@ module Katello
|
|
151
151
|
gpg_key_id = product_params[:gpg_key_id]
|
152
152
|
if gpg_key_id
|
153
153
|
gpg_key = GpgKey.readable.where(:id => gpg_key_id, :organization_id => @organization).first
|
154
|
-
|
154
|
+
throw_resource_not_found(name: 'gpg key', id: gpg_key_id) if gpg_key.nil?
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
@@ -159,7 +159,7 @@ module Katello
|
|
159
159
|
ssl_ca_cert_id = product_params[:ssl_ca_cert_id]
|
160
160
|
if ssl_ca_cert_id
|
161
161
|
ssl_ca_cert = GpgKey.readable.where(:id => ssl_ca_cert_id, :organization_id => @organization).first
|
162
|
-
|
162
|
+
throw_resource_not_found(name: 'ssl ca cert', id: ssl_ca_cert_id) if ssl_ca_cert.nil?
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
@@ -167,7 +167,7 @@ module Katello
|
|
167
167
|
ssl_client_cert_id = product_params[:ssl_client_cert_id]
|
168
168
|
if ssl_client_cert_id
|
169
169
|
ssl_client_cert = GpgKey.readable.where(:id => ssl_client_cert_id, :organization_id => @organization).first
|
170
|
-
|
170
|
+
throw_resource_not_found(name: 'ssl client cert', id: ssl_client_cert_id) if ssl_client_cert.nil?
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
@@ -175,7 +175,7 @@ module Katello
|
|
175
175
|
ssl_client_key_id = product_params[:ssl_client_key_id]
|
176
176
|
if ssl_client_key_id
|
177
177
|
ssl_client_key = GpgKey.readable.where(:id => ssl_client_key_id, :organization_id => @organization).first
|
178
|
-
|
178
|
+
throw_resource_not_found(name: 'ssl client key', id: ssl_client_key_id) if ssl_client_key.nil?
|
179
179
|
end
|
180
180
|
end
|
181
181
|
|
@@ -35,6 +35,8 @@ module Katello
|
|
35
35
|
|
36
36
|
def_param_group :repo do
|
37
37
|
param :url, String, :desc => N_("repository source url")
|
38
|
+
param :os_versions, Array,
|
39
|
+
:desc => N_("Identifies whether the repository should be disabled on a client with a non-matching OS version. Pass [] to enable regardless of OS version. Maximum length 1; allowed tags are: %s") % Katello::RootRepository::ALLOWED_OS_VERSIONS.join(', ')
|
38
40
|
param :gpg_key_id, :number, :desc => N_("id of the gpg key that will be assigned to the new repository")
|
39
41
|
param :ssl_ca_cert_id, :number, :desc => N_("Identifier of the content credential containing the SSL CA Cert")
|
40
42
|
param :ssl_client_cert_id, :number, :desc => N_("Identifier of the content credential containing the SSL Client Cert")
|
@@ -42,7 +44,7 @@ module Katello
|
|
42
44
|
param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP")
|
43
45
|
param :checksum_type, String, :desc => N_("Checksum of the repository, currently 'sha1' & 'sha256' are supported")
|
44
46
|
param :docker_upstream_name, String, :desc => N_("Name of the upstream docker repository")
|
45
|
-
param :docker_tags_whitelist, Array, :desc => N_("Comma
|
47
|
+
param :docker_tags_whitelist, Array, :desc => N_("Comma-separated list of tags to sync for Container Image repository")
|
46
48
|
param :download_policy, ["immediate", "on_demand", "background"], :desc => N_("download policy for yum repos (either 'immediate', 'on_demand', or 'background (deprecated)')")
|
47
49
|
param :download_concurrency, :number, :desc => N_("Used to determine download concurrency of the repository in pulp3. Use value less than 20. Defaults to 10")
|
48
50
|
param :mirror_on_sync, :bool, :desc => N_("true if this repository when synced has to be mirrored from the source and stale rpms removed")
|
@@ -51,9 +53,9 @@ module Katello
|
|
51
53
|
param :upstream_password, String, :desc => N_("Password of the upstream repository user used for authentication")
|
52
54
|
param :ostree_upstream_sync_policy, ::Katello::RootRepository::OSTREE_UPSTREAM_SYNC_POLICIES, :desc => N_("policies for syncing upstream ostree repositories")
|
53
55
|
param :ostree_upstream_sync_depth, :number, :desc => N_("if a custom sync policy is chosen for ostree repositories then a 'depth' value must be provided")
|
54
|
-
param :deb_releases, String, :desc => N_("comma
|
55
|
-
param :deb_components, String, :desc => N_("comma
|
56
|
-
param :deb_architectures, String, :desc => N_("comma
|
56
|
+
param :deb_releases, String, :desc => N_("comma-separated list of releases to be synced from deb-archive")
|
57
|
+
param :deb_components, String, :desc => N_("comma-separated list of repo components to be synced from deb-archive")
|
58
|
+
param :deb_architectures, String, :desc => N_("comma-separated list of architectures to be synced from deb-archive")
|
57
59
|
param :ignore_global_proxy, :bool, :desc => N_("if true, will ignore the globally configured proxy when syncing"), :deprecated => true
|
58
60
|
param :ignorable_content, Array, :desc => N_("List of content units to ignore while syncing a yum repository. Must be subset of %s") % RootRepository::IGNORABLE_CONTENT_UNIT_TYPES.join(",")
|
59
61
|
param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
|
@@ -93,6 +95,7 @@ module Katello
|
|
93
95
|
param :available_for, String, :desc => N_("interpret specified object to return only Repositories that can be associated with specified object. Only 'content_view' & 'content_view_version' are supported."),
|
94
96
|
:required => false
|
95
97
|
param :with_content, RepositoryTypeManager.enabled_content_types, :desc => N_("only repositories having at least one of the specified content type ex: rpm , erratum")
|
98
|
+
param :download_policy, ::Runcible::Models::YumImporter::DOWNLOAD_POLICIES, :desc => N_("limit to only repositories with this download policy")
|
96
99
|
param_group :search, Api::V2::ApiController
|
97
100
|
add_scoped_search_description_for(Repository)
|
98
101
|
def index
|
@@ -136,6 +139,7 @@ module Katello
|
|
136
139
|
def index_relation_product(query)
|
137
140
|
query = query.joins(:root => :product).where("#{Product.table_name}.organization_id" => @organization) if @organization
|
138
141
|
query = query.joins(:root).where("#{RootRepository.table_name}.product_id" => @product.id) if @product
|
142
|
+
query = query.joins(:root).where("#{RootRepository.table_name}.download_policy" => params[:download_policy]) if params[:download_policy]
|
139
143
|
query
|
140
144
|
end
|
141
145
|
|
@@ -476,7 +480,7 @@ module Katello
|
|
476
480
|
|
477
481
|
def repository_params
|
478
482
|
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username, :download_concurrency,
|
479
|
-
:ostree_upstream_sync_depth, :ostree_upstream_sync_policy,
|
483
|
+
:ostree_upstream_sync_depth, :ostree_upstream_sync_policy, {:os_versions => []},
|
480
484
|
:deb_releases, :deb_components, :deb_architectures, :description, :http_proxy_policy, :http_proxy_id,
|
481
485
|
{:ignorable_content => []}
|
482
486
|
]
|
@@ -527,6 +531,7 @@ module Katello
|
|
527
531
|
root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
|
528
532
|
root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
|
529
533
|
root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
|
534
|
+
root.os_versions = repo_params.fetch(:os_versions, []) if root.yum?
|
530
535
|
|
531
536
|
if root.ostree?
|
532
537
|
root.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
|
@@ -4,8 +4,11 @@ module Katello
|
|
4
4
|
|
5
5
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
6
6
|
|
7
|
-
before_action :
|
7
|
+
before_action :set_readable_product_scope, only: [:index, :show, :available_repositories, :auto_complete_search]
|
8
|
+
before_action :set_editable_product_scope, only: [:enable, :disable]
|
9
|
+
before_action :find_product
|
8
10
|
before_action :custom_product?
|
11
|
+
before_action :find_organization
|
9
12
|
before_action :find_product_content, :except => [:index, :auto_complete_search]
|
10
13
|
|
11
14
|
resource_description do
|
@@ -102,7 +105,8 @@ module Katello
|
|
102
105
|
|
103
106
|
def index_relation
|
104
107
|
if @product.nil?
|
105
|
-
|
108
|
+
authorized_product_contents = Katello::ProductContent.joins(:product).merge(@product_scope)
|
109
|
+
relation = @organization.product_contents.merge(authorized_product_contents).displayable
|
106
110
|
else
|
107
111
|
relation = @product.displayable_product_contents
|
108
112
|
end
|
@@ -125,25 +129,31 @@ module Katello
|
|
125
129
|
if @product.present?
|
126
130
|
@product_content = @product.product_content_by_id(params[:id])
|
127
131
|
else
|
128
|
-
content = Katello::Content.
|
129
|
-
|
132
|
+
content = Katello::Content.where(cp_content_id: params[:id], organization: @organization)
|
133
|
+
authorized_product_contents = Katello::ProductContent.joins(:product).merge(@product_scope)
|
134
|
+
@product_content = authorized_product_contents.joins(:content).merge(content).first
|
135
|
+
@product = @product_content&.product
|
130
136
|
end
|
131
|
-
|
132
|
-
@product = @product_content.product if @product.nil?
|
137
|
+
throw_resource_not_found(name: 'repository set', id: params[:id]) if @product_content.nil?
|
133
138
|
end
|
134
139
|
|
135
|
-
def
|
140
|
+
def find_product
|
136
141
|
if params[:product_id]
|
137
|
-
|
138
|
-
|
139
|
-
@organization = find_organization
|
142
|
+
@product = @product_scope.find_by(id: params[:product_id])
|
143
|
+
throw_resource_not_found(name: 'product', id: params[:product_id]) if @product.nil?
|
140
144
|
end
|
141
145
|
end
|
142
146
|
|
143
|
-
def
|
144
|
-
@
|
145
|
-
|
146
|
-
|
147
|
+
def set_readable_product_scope
|
148
|
+
@product_scope = Katello::Product.readable
|
149
|
+
end
|
150
|
+
|
151
|
+
def set_editable_product_scope
|
152
|
+
@product_scope = Katello::Product.editable
|
153
|
+
end
|
154
|
+
|
155
|
+
def find_organization
|
156
|
+
@organization = @product&.organization || super
|
147
157
|
end
|
148
158
|
|
149
159
|
def custom_product?
|
@@ -19,7 +19,7 @@ module Katello
|
|
19
19
|
|
20
20
|
api :GET, "/organizations/:organization_id/subscriptions", N_("List organization subscriptions")
|
21
21
|
api :GET, "/activation_keys/:activation_key_id/subscriptions", N_("List an activation key's subscriptions")
|
22
|
-
api :GET, "/subscriptions"
|
22
|
+
api :GET, "/subscriptions", N_("List subscriptions")
|
23
23
|
param_group :search, Api::V2::ApiController
|
24
24
|
param :organization_id, :number, :desc => N_("Organization ID"), :required => false
|
25
25
|
param :host_id, String, :desc => N_("id of a host"), :required => false
|