katello 4.18.0 → 4.19.0.rc1
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 katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/locale/bn/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/ca/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/cs/katello.js +53 -350
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +54 -351
- data/app/assets/javascripts/katello/locale/de/katello.js +56 -353
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/el/katello.js +54 -351
- data/app/assets/javascripts/katello/locale/en/katello.js +53 -350
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +53 -350
- data/app/assets/javascripts/katello/locale/en_US/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/es/katello.js +56 -353
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/fr/katello.js +138 -435
- data/app/assets/javascripts/katello/locale/gl/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/gu/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/hi/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/id/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/it/katello.js +53 -350
- data/app/assets/javascripts/katello/locale/ja/katello.js +142 -439
- data/app/assets/javascripts/katello/locale/ka/katello.js +56 -353
- data/app/assets/javascripts/katello/locale/kn/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/ko/katello.js +135 -432
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/mr/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/or/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/pa/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/pl/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/pt/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +56 -353
- data/app/assets/javascripts/katello/locale/ro/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/ru/katello.js +54 -351
- data/app/assets/javascripts/katello/locale/sl/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/ta/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/te/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/tr/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/vi/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/zh/katello.js +52 -349
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +135 -432
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +54 -351
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +46 -13
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +3 -65
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +56 -34
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_views_controller.rb +18 -3
- data/app/controllers/katello/api/v2/debs_controller.rb +21 -11
- data/app/controllers/katello/api/v2/docker_tags_controller.rb +7 -0
- data/app/controllers/katello/api/v2/errata_controller.rb +4 -4
- data/app/controllers/katello/api/v2/flatpak_remote_repositories_controller.rb +21 -19
- data/app/controllers/katello/api/v2/host_debs_controller.rb +16 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -60
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +10 -53
- data/app/controllers/katello/api/v2/repositories_controller.rb +0 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +3 -0
- data/app/lib/actions/candlepin/activation_key/create.rb +0 -2
- data/app/lib/actions/candlepin/activation_key/update.rb +0 -2
- data/app/lib/actions/candlepin/product/content_create.rb +3 -5
- data/app/lib/actions/candlepin/product/content_update.rb +2 -3
- data/app/lib/actions/helpers/rolling_cv_repos.rb +1 -1
- data/app/lib/actions/katello/activation_key/create.rb +0 -1
- data/app/lib/actions/katello/activation_key/update.rb +0 -2
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -6
- data/app/lib/actions/katello/content_credential/update.rb +1 -1
- data/app/lib/actions/katello/content_view/add_rolling_repo_clone.rb +18 -24
- data/app/lib/actions/katello/content_view/create.rb +9 -4
- data/app/lib/actions/katello/content_view/publish.rb +7 -7
- data/app/lib/actions/katello/content_view/refresh_rolling_repo.rb +6 -1
- data/app/lib/actions/katello/content_view/remove_rolling_repo_clone.rb +16 -11
- data/app/lib/actions/katello/content_view/update.rb +34 -7
- data/app/lib/actions/katello/product/content_create.rb +2 -2
- data/app/lib/actions/katello/product/content_destroy.rb +1 -1
- data/app/lib/actions/katello/repository/check_matching_content.rb +1 -1
- data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
- data/app/lib/actions/katello/repository/create.rb +1 -1
- data/app/lib/actions/katello/repository/destroy.rb +4 -4
- data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -2
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_publication.rb +3 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +45 -24
- data/app/lib/actions/pulp3/repository/save_versions.rb +2 -1
- data/app/lib/katello/resources/candlepin/activation_key.rb +3 -4
- data/app/lib/katello/resources/candlepin/upstream_job.rb +9 -1
- data/app/lib/katello/resources/candlepin.rb +4 -0
- data/app/models/katello/authorization/repository.rb +17 -4
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -7
- data/app/models/katello/content_view_deb_filter.rb +10 -0
- data/app/models/katello/content_view_deb_filter_rule.rb +7 -0
- data/app/models/katello/deb.rb +10 -12
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/glue/provider.rb +14 -3
- data/app/models/katello/host/content_facet.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +1 -7
- data/app/models/katello/product_content.rb +2 -2
- data/app/models/katello/repository.rb +4 -23
- data/app/models/katello/root_repository.rb +2 -5
- data/app/services/katello/candlepin/event_handler.rb +0 -33
- data/app/services/katello/candlepin/message_handler.rb +0 -41
- data/app/services/katello/content_unit_indexer.rb +59 -13
- data/app/services/katello/product_content_finder.rb +16 -7
- data/app/services/katello/pulp3/alternate_content_source.rb +2 -2
- data/app/services/katello/pulp3/ansible_collection.rb +1 -0
- data/app/services/katello/pulp3/api/content_guard.rb +5 -5
- data/app/services/katello/pulp3/api/core.rb +10 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +25 -10
- data/app/services/katello/pulp3/deb.rb +1 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_manifest_list.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/file_unit.rb +1 -0
- data/app/services/katello/pulp3/generic_content_unit.rb +1 -0
- data/app/services/katello/pulp3/module_stream.rb +1 -0
- data/app/services/katello/pulp3/package_group.rb +1 -0
- data/app/services/katello/pulp3/repository/apt.rb +30 -13
- data/app/services/katello/pulp3/repository.rb +59 -10
- data/app/services/katello/pulp3/rpm.rb +3 -2
- data/app/services/katello/pulp3/srpm.rb +3 -2
- data/app/services/katello/pulp3/task_group.rb +1 -1
- data/app/services/katello/registration_manager.rb +19 -17
- data/app/services/katello/repository_type_manager.rb +7 -5
- data/app/services/katello/smart_proxy_helper.rb +1 -6
- data/app/views/foreman/job_templates/upload_profile.erb +5 -0
- data/app/views/katello/api/v2/activation_keys/base.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/debs/thindex.json.rabl +6 -0
- data/app/views/katello/api/v2/docker_tags/_base.json.rabl +32 -0
- data/app/views/katello/api/v2/docker_tags/show.json.rabl +0 -5
- data/app/views/katello/api/v2/flatpak_remotes/index.json.rabl +6 -0
- data/app/views/katello/api/v2/host_debs/installed_debs.json.rabl +6 -0
- data/app/views/katello/api/v2/hosts_bulk_actions/applicable_errata.json.rabl +1 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/applicable_erratum.json.rabl +9 -0
- data/app/views/katello/api/v2/hosts_bulk_actions/installable_errata.json.rabl +1 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/{erratum.json.rabl → installable_erratum.json.rabl} +3 -3
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/config/initializers/monkeys.rb +1 -0
- data/config/routes/api/v2.rb +2 -2
- data/config/routes/overrides.rb +2 -7
- data/config/routes.rb +2 -0
- data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +1 -1
- data/db/migrate/20250912000000_add_pulp_prn_fields.rb +73 -0
- data/db/migrate/20250912000001_populate_pulp_prn_fields.rb +403 -0
- data/db/migrate/20251009142516_remove_auto_attach_from_activation_keys.rb +5 -0
- data/db/migrate/20251009142517_remove_autoheal_from_subscription_facets.rb +5 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/el.po +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +6 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +4 -4
- data/lib/katello/permission_creator.rb +2 -2
- data/lib/katello/permissions/host_permissions.rb +0 -6
- data/lib/katello/plugin.rb +16 -8
- data/lib/katello/tasks/jenkins.rake +1 -1
- data/lib/katello/tasks/upgrades/4.19/enable_structured_apt_for_deb.rake +87 -0
- data/lib/katello/tasks/upgrades/4.19/populate_repository_version_prns.rake +32 -0
- data/lib/katello/version.rb +1 -1
- data/lib/monkeys/fix_rpm_repository_gpgcheck.rb +38 -0
- data/locale/bn/LC_MESSAGES/katello.mo +0 -0
- data/locale/bn/katello.po +52 -349
- data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/bn_IN/katello.po +52 -349
- data/locale/ca/LC_MESSAGES/katello.mo +0 -0
- data/locale/ca/katello.po +52 -349
- data/locale/cs/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs/katello.po +54 -350
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po +54 -351
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +56 -353
- data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
- data/locale/de_AT/katello.po +52 -349
- data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
- data/locale/de_DE/katello.po +52 -349
- data/locale/el/LC_MESSAGES/katello.mo +0 -0
- data/locale/el/katello.po +55 -352
- data/locale/en/LC_MESSAGES/katello.mo +0 -0
- data/locale/en/katello.po +54 -350
- data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_GB/katello.po +53 -350
- data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_US/katello.po +52 -349
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +56 -353
- data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
- data/locale/et_EE/katello.po +52 -349
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +139 -435
- data/locale/gl/LC_MESSAGES/katello.mo +0 -0
- data/locale/gl/katello.po +52 -349
- data/locale/gu/LC_MESSAGES/katello.mo +0 -0
- data/locale/gu/katello.po +52 -349
- data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
- data/locale/he_IL/katello.po +52 -349
- data/locale/hi/LC_MESSAGES/katello.mo +0 -0
- data/locale/hi/katello.po +52 -349
- data/locale/id/LC_MESSAGES/katello.mo +0 -0
- data/locale/id/katello.po +52 -349
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +53 -350
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +143 -439
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +56 -353
- data/locale/katello.pot +695 -1152
- data/locale/kn/LC_MESSAGES/katello.mo +0 -0
- data/locale/kn/katello.po +52 -349
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +136 -432
- data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/ml_IN/katello.po +52 -349
- data/locale/mr/LC_MESSAGES/katello.mo +0 -0
- data/locale/mr/katello.po +52 -349
- data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
- data/locale/nl_NL/katello.po +52 -349
- data/locale/or/LC_MESSAGES/katello.mo +0 -0
- data/locale/or/katello.po +52 -349
- data/locale/pa/LC_MESSAGES/katello.mo +0 -0
- data/locale/pa/katello.po +52 -349
- data/locale/pl/LC_MESSAGES/katello.mo +0 -0
- data/locale/pl/katello.po +52 -349
- data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
- data/locale/pl_PL/katello.po +52 -349
- data/locale/pt/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt/katello.po +52 -349
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +56 -353
- data/locale/ro/LC_MESSAGES/katello.mo +0 -0
- data/locale/ro/katello.po +52 -349
- data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
- data/locale/ro_RO/katello.po +52 -349
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +54 -351
- data/locale/sl/LC_MESSAGES/katello.mo +0 -0
- data/locale/sl/katello.po +52 -349
- data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
- data/locale/sv_SE/katello.po +52 -349
- data/locale/ta/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta/katello.po +52 -349
- data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta_IN/katello.po +52 -349
- data/locale/te/LC_MESSAGES/katello.mo +0 -0
- data/locale/te/katello.po +52 -349
- data/locale/tr/LC_MESSAGES/katello.mo +0 -0
- data/locale/tr/katello.po +52 -349
- data/locale/vi/LC_MESSAGES/katello.mo +0 -0
- data/locale/vi/katello.po +52 -349
- data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
- data/locale/vi_VN/katello.po +52 -349
- data/locale/zh/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh/katello.po +52 -349
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +136 -432
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +54 -351
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +2 -2
- data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +0 -2
- data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeEditModal.test.js +0 -2
- data/webpack/components/extensions/Hosts/ActionsBar/index.js +1 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkActionsConstants.js +7 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js +388 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/__tests__/BulkChangeHostCollectionsModal.test.js +640 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/actions.js +28 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js +71 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +1 -1
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +10 -3
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +51 -24
- data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +7 -0
- data/webpack/containers/Application/config.js +11 -1
- data/webpack/global_index.js +3 -0
- data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesConstants.js +1 -1
- data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesPage.js +7 -43
- data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImagesPage.test.js +1 -1
- data/webpack/scenes/ContainerImages/ContainerImagesPage.js +86 -0
- data/webpack/scenes/ContainerImages/LabelsAnnotationsModal.js +105 -0
- data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetails.js +218 -0
- data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsActions.js +15 -0
- data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsSelectors.js +16 -0
- data/webpack/scenes/ContainerImages/Synced/Details/__tests__/ManifestDetails.test.js +395 -0
- data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestDetails.fixtures.json +43 -0
- data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestList.fixtures.json +58 -0
- data/webpack/scenes/ContainerImages/Synced/Details/index.js +4 -0
- data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.js +359 -0
- data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.scss +21 -0
- data/webpack/scenes/ContainerImages/Synced/__tests__/LabelsAnnotationsModal.test.js +69 -0
- data/webpack/scenes/ContainerImages/Synced/__tests__/SyncedContainerImagesPage.test.js +335 -0
- data/webpack/scenes/ContainerImages/Synced/__tests__/syncedContainerImages.fixtures.json +105 -0
- data/webpack/scenes/ContainerImages/TableEmptyState.js +67 -0
- data/webpack/scenes/ContainerImages/containerImagesHelpers.js +48 -0
- data/webpack/scenes/ContainerImages/index.js +4 -0
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +29 -3
- data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -0
- data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +45 -1
- data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -1
- data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +59 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +1 -0
- data/webpack/scenes/ContentViews/Details/Filters/Rules/DebPackage/AddEditDebPackageRuleModal.js +164 -24
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVDebFilterContent.test.js +268 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterDetail.fixtures.json +95 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterRules.fixtures.json +31 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVDebFilterRules.fixtures.json +10 -0
- data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -1
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetail.test.js +15 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetails.fixtures.json +1 -0
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +9 -0
- data/webpack/scenes/FlatpakRemotes/CreateEdit/CreateFlatpakRemoteModal.js +5 -3
- data/webpack/scenes/FlatpakRemotes/CreateEdit/EditFlatpakRemotesModal.js +1 -1
- data/webpack/scenes/FlatpakRemotes/CreateEdit/FlatpakRemoteform.js +35 -3
- data/webpack/scenes/FlatpakRemotes/Details/FlatpakRemoteDetails.js +1 -1
- data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.css +3 -0
- data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.js +63 -132
- data/webpack/scenes/FlatpakRemotes/FlatpakRemotesPage.js +67 -143
- data/webpack/scenes/SmartProxy/ExpandableCvDetails.js +10 -2
- data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +13 -2
- data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +1 -0
- data/webpack/scenes/SmartProxy/SmartProxyExpandableTable.js +8 -2
- data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +67 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -2
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
- metadata +83 -55
- data/app/lib/actions/katello/host/attach_subscriptions.rb +0 -59
- data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -22
- data/app/lib/actions/katello/host/remove_subscriptions.rb +0 -50
- data/app/lib/actions/katello/organization/simple_content_access/disable.rb +0 -25
- data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -25
- data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +0 -42
- data/lib/katello/tasks/migrate_structure_content_for_deb.rake +0 -105
- data/lib/katello/tasks/upgrades/4.2/remove_checksum_values.rake +0 -17
- data/locale/action_names.rb +0 -186
- /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImages.fixtures.js +0 -0
- /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/index.js +0 -0
|
@@ -7,6 +7,7 @@ module Katello
|
|
|
7
7
|
skip_before_action :authorize
|
|
8
8
|
before_action :optional_authorize, only: [:token, :catalog]
|
|
9
9
|
before_action :registry_authorize, except: [:token, :v1_search, :catalog, :static_index]
|
|
10
|
+
before_action :static_index_authorize, only: [:static_index]
|
|
10
11
|
before_action :authorize_repository_read, only: [:pull_manifest, :tags_list, :check_blob, :pull_blob]
|
|
11
12
|
before_action :container_push_prop_validation, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
|
|
12
13
|
before_action :create_container_repo_if_needed, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
|
|
@@ -63,7 +64,7 @@ module Katello
|
|
|
63
64
|
"scope=\"repository:registry:pull,push\""
|
|
64
65
|
end
|
|
65
66
|
|
|
66
|
-
def
|
|
67
|
+
def authenticate_from_request(token, redirect_on_failure = true)
|
|
67
68
|
if token
|
|
68
69
|
token_type, token = token.split
|
|
69
70
|
if token_type == 'Bearer' && token
|
|
@@ -94,7 +95,7 @@ module Katello
|
|
|
94
95
|
if @repository && (@repository.environment.registry_unauthenticated_pull || ssl_client_authorized?(@repository.organization.label))
|
|
95
96
|
true
|
|
96
97
|
elsif params['action'] == 'catalog'
|
|
97
|
-
|
|
98
|
+
authenticate_from_request(request.headers['Authorization'], false)
|
|
98
99
|
elsif (params['action'] == 'token' && params['scope'].blank? && params['account'].blank?)
|
|
99
100
|
true
|
|
100
101
|
else
|
|
@@ -106,13 +107,26 @@ module Katello
|
|
|
106
107
|
@repository = find_readable_repository
|
|
107
108
|
return true if ['GET', 'HEAD'].include?(request.method) && @repository && !require_user_authorization?
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
return true if authenticate_from_request(request.headers['Authorization'])
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
unauthorized
|
|
113
|
+
end
|
|
112
114
|
|
|
115
|
+
def static_index_authorize
|
|
116
|
+
authenticate_from_request(request.headers['Authorization'])
|
|
117
|
+
find_host_by_ip unless @host
|
|
118
|
+
true
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def find_host_by_ip
|
|
122
|
+
host_ip = request.remote_ip
|
|
123
|
+
@host = ::Host.joins(:primary_interface).where("nics.ip = :host_ip OR nics.ip6 = :host_ip", host_ip: host_ip)&.first
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def unauthorized
|
|
113
127
|
redirect_authorization_headers
|
|
114
128
|
render_error('unauthorized', :status => :unauthorized)
|
|
115
|
-
|
|
129
|
+
false
|
|
116
130
|
end
|
|
117
131
|
|
|
118
132
|
def container_push_prop_validation(props = nil)
|
|
@@ -416,7 +430,12 @@ module Katello
|
|
|
416
430
|
)
|
|
417
431
|
end
|
|
418
432
|
|
|
419
|
-
|
|
433
|
+
# Fetch version PRN from Pulp API
|
|
434
|
+
# FIXME: Remove this workaround when https://github.com/pulp/pulpcore/issues/7008 is resolved
|
|
435
|
+
version_response = pulp_api.repository_versions_api.read(latest_version_href, {fields: 'prn'})
|
|
436
|
+
latest_version_prn = version_response&.prn
|
|
437
|
+
|
|
438
|
+
instance_repo.update!(version_href: latest_version_href, version_prn: latest_version_prn)
|
|
420
439
|
# The Pulp repository should not change after first creation
|
|
421
440
|
if root_repository.repository_references.empty?
|
|
422
441
|
::Katello::Pulp3::RepositoryReference.where(root_repository_id: instance_repo.root_id,
|
|
@@ -432,6 +451,7 @@ module Katello
|
|
|
432
451
|
instance_repo = root_repository&.library_instance
|
|
433
452
|
distribution_api_response = pulp_api.container_push_distribution_for_repository(pulp_repo_href)
|
|
434
453
|
pulp_distribution_href = distribution_api_response&.pulp_href
|
|
454
|
+
pulp_distribution_prn = distribution_api_response&.prn
|
|
435
455
|
|
|
436
456
|
if pulp_distribution_href.empty?
|
|
437
457
|
return render_podman_error(
|
|
@@ -445,11 +465,12 @@ module Katello
|
|
|
445
465
|
repository_id: instance_repo.id).first
|
|
446
466
|
if dist
|
|
447
467
|
if dist.href != pulp_distribution_href
|
|
448
|
-
dist.update(href: pulp_distribution_href)
|
|
468
|
+
dist.update(href: pulp_distribution_href, prn: pulp_distribution_prn)
|
|
449
469
|
end
|
|
450
470
|
else
|
|
451
471
|
::Katello::Pulp3::DistributionReference.create!(path: @container_path_input,
|
|
452
472
|
href: pulp_distribution_href,
|
|
473
|
+
prn: pulp_distribution_prn,
|
|
453
474
|
repository_id: instance_repo.id)
|
|
454
475
|
end
|
|
455
476
|
end
|
|
@@ -574,7 +595,11 @@ module Katello
|
|
|
574
595
|
return yield
|
|
575
596
|
rescue RestClient::Exception => exception
|
|
576
597
|
if [301, 302, 307].include?(exception.response.code)
|
|
577
|
-
|
|
598
|
+
# Handle aliased hostname on original request
|
|
599
|
+
redirect_location = URI(exception.response.headers[:location])
|
|
600
|
+
redirect_location.host = request.host if request.host.present?
|
|
601
|
+
|
|
602
|
+
redirect_to redirect_location.to_s, allow_other_host: true
|
|
578
603
|
nil
|
|
579
604
|
else
|
|
580
605
|
raise exception
|
|
@@ -847,12 +872,20 @@ module Katello
|
|
|
847
872
|
end
|
|
848
873
|
|
|
849
874
|
def static_index
|
|
850
|
-
host_ip = request.remote_ip
|
|
851
|
-
@host ||= ::Host.joins(:primary_interface).where("nics.ip = :host_ip OR nics.ip6 = :host_ip", host_ip: host_ip)&.first
|
|
852
|
-
flatpak_index = (redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers) })
|
|
853
|
-
flatpak_index_json = JSON.parse(flatpak_index)
|
|
854
875
|
repos = Repository.readable_docker_catalog(@host)
|
|
855
|
-
|
|
876
|
+
return render json: { 'Registry' => request_url, 'Results' => [] } if repos.empty?
|
|
877
|
+
|
|
878
|
+
available_container_repo_names = repos.map(&:container_repository_name).compact
|
|
879
|
+
|
|
880
|
+
flatpak_index = (redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers) })
|
|
881
|
+
|
|
882
|
+
begin
|
|
883
|
+
flatpak_index_json = JSON.parse(flatpak_index)
|
|
884
|
+
rescue JSON::ParserError => e
|
|
885
|
+
Rails.logger.error("Failed to parse flatpak index JSON: #{e.message}")
|
|
886
|
+
return render json: { 'Registry' => request_url, 'Results' => [] }
|
|
887
|
+
end
|
|
888
|
+
|
|
856
889
|
flatpak_index_json['Results'] = flatpak_index_json['Results'].select do |result|
|
|
857
890
|
available_container_repo_names.include?(result['Name'])
|
|
858
891
|
end
|
|
@@ -447,7 +447,7 @@ module Katello
|
|
|
447
447
|
end
|
|
448
448
|
|
|
449
449
|
def rhsm_params
|
|
450
|
-
params.slice(:name, :type, :facts, :installedProducts, :
|
|
450
|
+
params.slice(:name, :type, :facts, :installedProducts, :releaseVer, :usage, :role, :serviceLevel, :uuid, :capabilities, :guestIds, :lastCheckin).to_h
|
|
451
451
|
end
|
|
452
452
|
|
|
453
453
|
def logger
|
|
@@ -7,13 +7,11 @@ module Katello
|
|
|
7
7
|
before_action :find_optional_organization, :only => [:index, :create, :show]
|
|
8
8
|
before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :available_releases,
|
|
9
9
|
:available_host_collections, :add_host_collections, :remove_host_collections,
|
|
10
|
-
:content_override, :
|
|
11
|
-
:subscriptions]
|
|
10
|
+
:content_override, :subscriptions]
|
|
12
11
|
before_action :find_content_view_environments, :only => [:create, :update]
|
|
13
|
-
before_action :verify_simple_content_access_disabled, :only => [:add_subscriptions]
|
|
14
12
|
before_action :validate_release_version, :only => [:create, :update]
|
|
15
13
|
|
|
16
|
-
wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level
|
|
14
|
+
wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level purpose_role purpose_usage content_view_environments))
|
|
17
15
|
|
|
18
16
|
def_param_group :activation_key do
|
|
19
17
|
param :organization_id, :number, :desc => N_("organization identifier"), :required => true
|
|
@@ -22,7 +20,6 @@ module Katello
|
|
|
22
20
|
param :unlimited_hosts, :bool, :desc => N_("can the activation key have unlimited hosts")
|
|
23
21
|
param :release_version, String, :desc => N_("content release version")
|
|
24
22
|
param :service_level, String, :desc => N_("service level")
|
|
25
|
-
param :auto_attach, :bool, :desc => N_("auto attach subscriptions upon registration"), deprecated: true
|
|
26
23
|
param :purpose_usage, String, :desc => N_("Sets the system purpose usage")
|
|
27
24
|
param :purpose_role, String, :desc => N_("Sets the system purpose usage")
|
|
28
25
|
|
|
@@ -125,8 +122,7 @@ module Katello
|
|
|
125
122
|
@new_activation_key.reload
|
|
126
123
|
sync_task(::Actions::Katello::ActivationKey::Update, @new_activation_key,
|
|
127
124
|
:service_level => @activation_key.service_level,
|
|
128
|
-
:release_version => @activation_key.release_version
|
|
129
|
-
:auto_attach => @activation_key.auto_attach
|
|
125
|
+
:release_version => @activation_key.release_version
|
|
130
126
|
)
|
|
131
127
|
@activation_key.pools.each do |pool|
|
|
132
128
|
@new_activation_key.subscribe(pool[:id])
|
|
@@ -181,46 +177,6 @@ module Katello
|
|
|
181
177
|
respond_for_show(:resource => @activation_key)
|
|
182
178
|
end
|
|
183
179
|
|
|
184
|
-
def deprecate_entitlement_mode_endpoint
|
|
185
|
-
::Foreman::Deprecation.api_deprecation_warning(N_("This endpoint is deprecated and will be removed in an upcoming release. Simple Content Access is the only supported content access mode."))
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
api :PUT, "/activation_keys/:id/add_subscriptions", N_("Attach a subscription"), deprecated: true
|
|
189
|
-
param :id, :number, :desc => N_("ID of the activation key"), :required => true
|
|
190
|
-
param :subscription_id, :number, :desc => N_("Subscription identifier"), :required => false
|
|
191
|
-
param :quantity, :number, :desc => N_("Quantity of this subscription to add"), :required => false
|
|
192
|
-
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => false do
|
|
193
|
-
param :id, String, :desc => N_("Subscription Pool uuid"), :required => false
|
|
194
|
-
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => false
|
|
195
|
-
end
|
|
196
|
-
def add_subscriptions
|
|
197
|
-
deprecate_entitlement_mode_endpoint
|
|
198
|
-
if params[:subscriptions]
|
|
199
|
-
params[:subscriptions].each { |subscription| @activation_key.subscribe(subscription[:id], subscription[:quantity]) }
|
|
200
|
-
elsif params[:subscription_id]
|
|
201
|
-
@activation_key.subscribe(params[:subscription_id], params[:quantity])
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
respond_for_index(:collection => subscription_index, :template => 'subscriptions')
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
api :PUT, "/activation_keys/:id/remove_subscriptions", N_("Unattach a subscription"), deprecated: true
|
|
208
|
-
param :id, :number, :desc => N_("ID of the activation key"), :required => true
|
|
209
|
-
param :subscription_id, String, :desc => N_("Subscription ID"), :required => false
|
|
210
|
-
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => false do
|
|
211
|
-
param :id, String, :desc => N_("Subscription Pool uuid"), :required => false
|
|
212
|
-
end
|
|
213
|
-
def remove_subscriptions
|
|
214
|
-
deprecate_entitlement_mode_endpoint
|
|
215
|
-
if params[:subscriptions]
|
|
216
|
-
params[:subscriptions].each { |subscription| @activation_key.unsubscribe(subscription[:id]) }
|
|
217
|
-
elsif params[:subscription_id]
|
|
218
|
-
@activation_key.unsubscribe(params[:subscription_id])
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
respond_for_index(:collection => subscription_index, :template => 'subscriptions')
|
|
222
|
-
end
|
|
223
|
-
|
|
224
180
|
api :PUT, "/activation_keys/:id/content_override", N_("Override content for activation_key")
|
|
225
181
|
param :id, :number, :desc => N_("ID of the activation key"), :required => true
|
|
226
182
|
param :content_overrides, Array, :desc => N_("Array of Content override parameters to be added in bulk") do
|
|
@@ -273,17 +229,6 @@ module Katello
|
|
|
273
229
|
|
|
274
230
|
private
|
|
275
231
|
|
|
276
|
-
def subscription_index
|
|
277
|
-
subs = @activation_key.subscriptions
|
|
278
|
-
{
|
|
279
|
-
:results => subs,
|
|
280
|
-
:subtotal => subs.count,
|
|
281
|
-
:total => subs.count,
|
|
282
|
-
:page => 1,
|
|
283
|
-
:per_page => subs.count,
|
|
284
|
-
}
|
|
285
|
-
end
|
|
286
|
-
|
|
287
232
|
def find_cve_for_single
|
|
288
233
|
environment_id = params.dig(:environment, :id) || params[:environment_id]
|
|
289
234
|
content_view_id = params.dig(:content_view, :id) || params[:content_view_id]
|
|
@@ -379,7 +324,6 @@ module Katello
|
|
|
379
324
|
:content_view_id,
|
|
380
325
|
:release_version,
|
|
381
326
|
:service_level,
|
|
382
|
-
:auto_attach,
|
|
383
327
|
:max_hosts,
|
|
384
328
|
:unlimited_hosts,
|
|
385
329
|
:purpose_role,
|
|
@@ -408,12 +352,6 @@ module Katello
|
|
|
408
352
|
key_params
|
|
409
353
|
end
|
|
410
354
|
|
|
411
|
-
def verify_simple_content_access_disabled
|
|
412
|
-
if @activation_key.organization.simple_content_access?
|
|
413
|
-
fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
|
|
414
|
-
end
|
|
415
|
-
end
|
|
416
|
-
|
|
417
355
|
def validate_release_version
|
|
418
356
|
@organization ||= find_organization
|
|
419
357
|
if params[:release_version].present? && !@organization.library.available_releases.include?(params[:release_version])
|
|
@@ -43,52 +43,74 @@ module Katello
|
|
|
43
43
|
|
|
44
44
|
private
|
|
45
45
|
|
|
46
|
-
def
|
|
46
|
+
def find_library_export_view
|
|
47
47
|
if params[:from_history_id].present?
|
|
48
48
|
find_incremental_history_from_id
|
|
49
49
|
@view = @history&.content_view_version&.content_view
|
|
50
50
|
else
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
# Determine format for finding existing view
|
|
52
|
+
format = params[:format] || ::Katello::Pulp3::ContentViewVersion::Export::UNDEFINED
|
|
53
|
+
|
|
54
|
+
# Try to find existing views based on format
|
|
55
|
+
views = []
|
|
56
|
+
if format != ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
|
|
57
|
+
importable_view = ::Katello::Pulp3::ContentViewVersion::Export.find_export_view(
|
|
58
|
+
destination_server: params[:destination_server],
|
|
59
|
+
organization: @organization,
|
|
60
|
+
name: ::Katello::ContentView::EXPORT_LIBRARY,
|
|
61
|
+
generated_for: :library_export
|
|
62
|
+
)
|
|
63
|
+
views << importable_view if importable_view
|
|
57
64
|
end
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
|
|
66
|
+
if format != ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE
|
|
67
|
+
syncable_view = ::Katello::Pulp3::ContentViewVersion::Export.find_export_view(
|
|
68
|
+
destination_server: params[:destination_server],
|
|
69
|
+
organization: @organization,
|
|
70
|
+
name: "#{::Katello::ContentView::EXPORT_LIBRARY}-SYNCABLE",
|
|
71
|
+
generated_for: :library_export_syncable
|
|
72
|
+
)
|
|
73
|
+
views << syncable_view if syncable_view
|
|
62
74
|
end
|
|
63
|
-
|
|
75
|
+
|
|
76
|
+
@view = views.compact.max_by(&:updated_at)
|
|
64
77
|
end
|
|
65
78
|
check_for_blank_view
|
|
66
79
|
end
|
|
67
80
|
|
|
68
|
-
def find_library_export_view
|
|
69
|
-
find_export_view_helper(
|
|
70
|
-
::Katello::ContentView::EXPORT_LIBRARY,
|
|
71
|
-
"#{::Katello::ContentView::EXPORT_LIBRARY}-SYNCABLE",
|
|
72
|
-
@organization,
|
|
73
|
-
:library_export,
|
|
74
|
-
:library_export_syncable
|
|
75
|
-
)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
81
|
def find_repository_export_view
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
:
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
if params[:from_history_id].present?
|
|
83
|
+
find_incremental_history_from_id
|
|
84
|
+
@view = @history&.content_view_version&.content_view
|
|
85
|
+
else
|
|
86
|
+
# Determine format for finding existing view
|
|
87
|
+
format = params[:format] || ::Katello::Pulp3::ContentViewVersion::Export::UNDEFINED
|
|
88
|
+
|
|
89
|
+
# Try to find existing views based on format
|
|
90
|
+
views = []
|
|
91
|
+
if format != ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
|
|
92
|
+
importable_view = ::Katello::Pulp3::ContentViewVersion::Export.find_export_view(
|
|
93
|
+
destination_server: nil,
|
|
94
|
+
organization: @repository.organization,
|
|
95
|
+
name: "Export-#{@repository.label}-#{@repository.library_instance_or_self.id}",
|
|
96
|
+
generated_for: :repository_export
|
|
97
|
+
)
|
|
98
|
+
views << importable_view if importable_view
|
|
99
|
+
end
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
if format != ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE
|
|
102
|
+
syncable_view = ::Katello::Pulp3::ContentViewVersion::Export.find_export_view(
|
|
103
|
+
destination_server: nil,
|
|
104
|
+
organization: @repository.organization,
|
|
105
|
+
name: "Export-SYNCABLE-#{@repository.label}-#{@repository.library_instance_or_self.id}",
|
|
106
|
+
generated_for: :repository_export_syncable
|
|
107
|
+
)
|
|
108
|
+
views << syncable_view if syncable_view
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
@view = views.compact.max_by(&:updated_at)
|
|
112
|
+
end
|
|
113
|
+
check_for_blank_view
|
|
92
114
|
end
|
|
93
115
|
|
|
94
116
|
def check_for_blank_view
|
|
@@ -95,7 +95,7 @@ module Katello
|
|
|
95
95
|
update_params = rule_params
|
|
96
96
|
update_params[:name] = update_params[:name].first if update_params[:name]
|
|
97
97
|
|
|
98
|
-
if @rule.filter.content_type
|
|
98
|
+
if [ContentViewPackageFilter::CONTENT_TYPE, ContentViewDebFilter::CONTENT_TYPE].include?(@rule.filter.content_type)
|
|
99
99
|
update_params[:version] = "" unless rule_params[:version]
|
|
100
100
|
update_params[:min_version] = "" unless rule_params[:min_version]
|
|
101
101
|
update_params[:max_version] = "" unless rule_params[:max_version]
|
|
@@ -21,6 +21,7 @@ module Katello
|
|
|
21
21
|
param :description, String, :desc => N_("Description for the content view")
|
|
22
22
|
param :repository_ids, Array, :desc => N_("List of repository ids")
|
|
23
23
|
param :component_ids, Array, :desc => N_("List of component content view version ids for composite views")
|
|
24
|
+
param :environment_ids, Array, :desc => N_("List of lifecycle environments for rolling content views")
|
|
24
25
|
param :auto_publish, :bool, :desc => N_("Enable/Disable auto publish of composite view")
|
|
25
26
|
param :solve_dependencies, :bool, :desc => N_("Solve RPM dependencies by default on Content View publish, defaults to false")
|
|
26
27
|
param :import_only, :bool, :desc => N_("Designate this Content View for importing from upstream servers only. Defaults to false")
|
|
@@ -42,6 +43,7 @@ module Katello
|
|
|
42
43
|
{
|
|
43
44
|
:component_ids => Katello::ContentViewVersion,
|
|
44
45
|
:repository_ids => Katello::Repository,
|
|
46
|
+
:environment_ids => Katello::KTEnvironment,
|
|
45
47
|
}
|
|
46
48
|
end
|
|
47
49
|
|
|
@@ -87,11 +89,12 @@ module Katello
|
|
|
87
89
|
param :rolling, :bool, :desc => N_("Rolling content view")
|
|
88
90
|
param_group :content_view
|
|
89
91
|
def create
|
|
92
|
+
validate_environment_ids!(params[:rolling])
|
|
90
93
|
@content_view = ContentView.create!(view_params) do |view|
|
|
91
94
|
view.organization = @organization
|
|
92
95
|
view.label ||= labelize_params(params[:content_view])
|
|
93
96
|
end
|
|
94
|
-
sync_task(::Actions::Katello::ContentView::Create, @content_view)
|
|
97
|
+
sync_task(::Actions::Katello::ContentView::Create, @content_view, sanitized_environment_ids)
|
|
95
98
|
|
|
96
99
|
respond :resource => @content_view
|
|
97
100
|
end
|
|
@@ -101,7 +104,8 @@ module Katello
|
|
|
101
104
|
param :name, String, :desc => N_("New name for the content view")
|
|
102
105
|
param_group :content_view
|
|
103
106
|
def update
|
|
104
|
-
|
|
107
|
+
validate_environment_ids!(@content_view.rolling?)
|
|
108
|
+
sync_task(::Actions::Katello::ContentView::Update, @content_view, view_params, sanitized_environment_ids)
|
|
105
109
|
respond :resource => @content_view.reload
|
|
106
110
|
end
|
|
107
111
|
|
|
@@ -299,12 +303,23 @@ module Katello
|
|
|
299
303
|
if (!@content_view || !@content_view.composite?)
|
|
300
304
|
attrs.push({:repository_ids => []}, :repository_ids)
|
|
301
305
|
end
|
|
302
|
-
result =
|
|
306
|
+
result = {}
|
|
307
|
+
result = params.require(:content_view).permit(*attrs).to_h unless action_name == "update" && @content_view.rolling? && params[:content_view].empty?
|
|
303
308
|
# sanitize repository_ids to be a list of integers
|
|
304
309
|
result[:repository_ids] = result[:repository_ids].compact.map(&:to_i) if result[:repository_ids].present?
|
|
305
310
|
result
|
|
306
311
|
end
|
|
307
312
|
|
|
313
|
+
def sanitized_environment_ids
|
|
314
|
+
params[:environment_ids]&.compact&.map(&:to_i)
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
def validate_environment_ids!(rolling)
|
|
318
|
+
if params[:environment_ids] && !rolling
|
|
319
|
+
fail HttpErrors::BadRequest, _("It's not possible to provide environment_ids for anything other than a rolling content view.")
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
308
323
|
def find_environment
|
|
309
324
|
return if !params.key?(:environment_id) && params[:action] == "index"
|
|
310
325
|
@environment = KTEnvironment.readable.find(params[:environment_id])
|
|
@@ -13,15 +13,15 @@ module Katello
|
|
|
13
13
|
def auto_complete(search)
|
|
14
14
|
page_size = Katello::Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
|
|
15
15
|
debs = Deb.in_repositories(@repositories)
|
|
16
|
-
col =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
render :
|
|
16
|
+
col = case search
|
|
17
|
+
when 'name' then "#{Deb.table_name}.name"
|
|
18
|
+
when 'arch' then "#{Deb.table_name}.architecture"
|
|
19
|
+
end
|
|
20
|
+
return render json: [] if col.blank?
|
|
21
|
+
|
|
22
|
+
scope = debs.select(col).group(col).order(col).limit(page_size)
|
|
23
|
+
scope = scope.where("#{col} ILIKE ?", "%#{params[:term]}%") if params[:term].present?
|
|
24
|
+
render json: scope.pluck(Arel.sql(col))
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def auto_complete_name
|
|
@@ -29,7 +29,7 @@ module Katello
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def auto_complete_arch
|
|
32
|
-
auto_complete('
|
|
32
|
+
auto_complete('arch')
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
api :GET, "/debs", N_("List deb packages")
|
|
@@ -52,6 +52,16 @@ module Katello
|
|
|
52
52
|
super
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
def thindex
|
|
56
|
+
sort_by, sort_order, options = sort_options
|
|
57
|
+
|
|
58
|
+
options[:select] = "DISTINCT ON (#{Deb.table_name}.name) #{Deb.table_name}.id, #{Deb.table_name}.name"
|
|
59
|
+
final_relation = custom_index_relation(Deb.all)
|
|
60
|
+
|
|
61
|
+
result = scoped_search(final_relation, sort_by, sort_order, options)
|
|
62
|
+
respond_for_index(:collection => result, :template => "thindex")
|
|
63
|
+
end
|
|
64
|
+
|
|
55
65
|
def final_custom_index_relation(collection)
|
|
56
66
|
# :packages_restrict_latest is intended to filter the result set after all
|
|
57
67
|
# other constraints have been applied, including the scoped_search
|
|
@@ -95,7 +105,7 @@ module Katello
|
|
|
95
105
|
collection = collection.installable_for_hosts(@hosts)
|
|
96
106
|
elsif not_installed && params[:host_id]
|
|
97
107
|
host = @hosts.first
|
|
98
|
-
collection = Katello::Deb.
|
|
108
|
+
collection = Katello::Deb.deb_installable_for_host(host)
|
|
99
109
|
elsif applicable
|
|
100
110
|
collection = collection.applicable_to_hosts(@hosts)
|
|
101
111
|
end
|
|
@@ -46,6 +46,13 @@ module Katello
|
|
|
46
46
|
|
|
47
47
|
private
|
|
48
48
|
|
|
49
|
+
def custom_index_relation(collection)
|
|
50
|
+
collection.includes(
|
|
51
|
+
schema1: { docker_taggable: :docker_manifests },
|
|
52
|
+
schema2: { docker_taggable: :docker_manifests }
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
49
56
|
def find_repositories
|
|
50
57
|
@repositories = Repository.readable.where(:id => params[:repoids])
|
|
51
58
|
end
|
|
@@ -55,8 +55,8 @@ module Katello
|
|
|
55
55
|
collection = collection.applicable_to_hosts(hosts)
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
|
-
date_type = params[:date_type].present? ? params[:date_type] : ContentViewErratumFilterRule::UPDATED
|
|
59
|
-
unless ContentViewErratumFilterRule::DATE_TYPES.include?(date_type)
|
|
58
|
+
@date_type = params[:date_type].present? ? params[:date_type] : ContentViewErratumFilterRule::UPDATED
|
|
59
|
+
unless ContentViewErratumFilterRule::DATE_TYPES.include?(@date_type)
|
|
60
60
|
msg = _("Invalid params provided - date_type must be one of %s" % ContentViewErratumFilterRule::DATE_TYPES.join(","))
|
|
61
61
|
fail HttpErrors::UnprocessableEntity, msg
|
|
62
62
|
end
|
|
@@ -65,8 +65,8 @@ module Katello
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def custom_index_relation_handle_type_and_time(collection)
|
|
68
|
-
collection = collection.where("#{date_type} >= ?", params[:start_date]) if params[:start_date]
|
|
69
|
-
collection = collection.where("#{date_type} <= ?", params[:end_date]) if params[:end_date]
|
|
68
|
+
collection = collection.where("#{@date_type} >= ?", params[:start_date]) if params[:start_date]
|
|
69
|
+
collection = collection.where("#{@date_type} <= ?", params[:end_date]) if params[:end_date]
|
|
70
70
|
if params[:types]
|
|
71
71
|
include_other = params[:types]&.include?('other')
|
|
72
72
|
params[:types]&.delete('other')
|
|
@@ -4,7 +4,7 @@ module Katello
|
|
|
4
4
|
|
|
5
5
|
before_action :find_remote_repository, :except => [:index, :auto_complete_search]
|
|
6
6
|
before_action :find_optional_organization, :only => [:index, :auto_complete_search]
|
|
7
|
-
before_action :
|
|
7
|
+
before_action :find_and_validate_product_for_mirroring, :only => [:mirror]
|
|
8
8
|
|
|
9
9
|
resource_description do
|
|
10
10
|
name 'Flatpak Remote Repositories'
|
|
@@ -56,7 +56,6 @@ module Katello
|
|
|
56
56
|
param :product_name, String, :desc => N_("Name of the product to mirror the remote repository to")
|
|
57
57
|
param :organization_id, :number, :desc => N_("organization identifier")
|
|
58
58
|
def mirror
|
|
59
|
-
validate_product_for_mirroring
|
|
60
59
|
task = async_task(::Actions::Katello::Flatpak::MirrorRemoteRepository, @flatpak_remote_repository, @product)
|
|
61
60
|
respond_for_async :resource => task
|
|
62
61
|
end
|
|
@@ -75,10 +74,17 @@ module Katello
|
|
|
75
74
|
@flatpak_remote_repository
|
|
76
75
|
end
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
protected
|
|
78
|
+
|
|
79
|
+
def rejected_autocomplete_items
|
|
80
|
+
['flatpak_remote_id', 'flatpak_remote']
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
private
|
|
84
|
+
|
|
85
|
+
def find_and_validate_product_for_mirroring
|
|
79
86
|
if params[:product_id]
|
|
80
|
-
@product = Product.editable.find(params[:product_id])
|
|
81
|
-
throw_resource_not_found(name: 'product', id: params[:product_id]) unless @product
|
|
87
|
+
@product = Product.editable.find(params[:product_id]) # will throw not found if id is invalid
|
|
82
88
|
elsif params[:product_name] && params[:organization_id]
|
|
83
89
|
@product = Product.editable.find_by(name: params[:product_name], organization_id: params[:organization_id])
|
|
84
90
|
unless @product
|
|
@@ -86,22 +92,18 @@ module Katello
|
|
|
86
92
|
{ name: params[:product_name], org_id: params[:organization_id] }
|
|
87
93
|
fail HttpErrors::NotFound, msg
|
|
88
94
|
end
|
|
95
|
+
elsif params[:product_name]
|
|
96
|
+
msg = _("Organization must be specified when providing product by name.")
|
|
97
|
+
fail HttpErrors::BadRequest, msg
|
|
98
|
+
else
|
|
99
|
+
msg = _("Product must be specified.")
|
|
100
|
+
fail HttpErrors::BadRequest, msg
|
|
89
101
|
end
|
|
90
|
-
@product
|
|
91
|
-
end
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
private
|
|
100
|
-
|
|
101
|
-
def validate_product_for_mirroring
|
|
102
|
-
return unless @product&.redhat?
|
|
103
|
-
msg = _("Flatpak repositories cannot be mirrored into Red Hat products. Please select a custom product.")
|
|
104
|
-
fail HttpErrors::UnprocessableEntity, msg
|
|
103
|
+
if @product.redhat?
|
|
104
|
+
msg = _("Flatpak repositories cannot be mirrored into Red Hat products. Please select a custom product.")
|
|
105
|
+
fail HttpErrors::UnprocessableEntity, msg
|
|
106
|
+
end
|
|
105
107
|
end
|
|
106
108
|
end
|
|
107
109
|
end
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
module Katello
|
|
2
2
|
class Api::V2::HostDebsController < Api::V2::ApiController
|
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
|
4
|
+
include Katello::Concerns::Api::V2::RepositoryContentController
|
|
4
5
|
|
|
5
|
-
before_action :find_host
|
|
6
|
+
before_action :find_host, only: [:index]
|
|
6
7
|
|
|
7
8
|
resource_description do
|
|
8
9
|
api_version 'v2'
|
|
9
10
|
api_base_url "/api"
|
|
10
11
|
end
|
|
11
12
|
|
|
13
|
+
api :GET, "/host_debs/installed_debs", N_("Return a list of installed debs distinct by name")
|
|
14
|
+
param_group :search, ::Katello::Api::V2::ApiController
|
|
15
|
+
def installed_debs
|
|
16
|
+
_sort_by, _sort_order, options = sort_options
|
|
17
|
+
sort_by = 'name'
|
|
18
|
+
sort_order = 'asc'
|
|
19
|
+
|
|
20
|
+
options[:select] = "DISTINCT ON (#{::Katello::InstalledDeb.table_name}.name) #{::Katello::InstalledDeb.table_name}.id, #{::Katello::InstalledDeb.table_name}.name"
|
|
21
|
+
final_relation = ::Katello::InstalledDeb.all
|
|
22
|
+
|
|
23
|
+
result = scoped_search(final_relation, sort_by, sort_order, options)
|
|
24
|
+
respond_for_index(:collection => result, :template => "installed_debs")
|
|
25
|
+
end
|
|
26
|
+
|
|
12
27
|
api :GET, "/hosts/:host_id/debs", N_("List deb packages installed on the host")
|
|
13
28
|
param :host_id, :number, :required => true, :desc => N_("ID of the host")
|
|
14
29
|
param :include_latest_upgradable, :boolean, :desc => N_("Also include the latest upgradable package version for each host package")
|