katello 3.17.0.rc1 → 3.17.0.rc2
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 +5 -3
- data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +1 -1
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -2
- data/app/controllers/katello/api/v2/api_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +5 -5
- data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +47 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +50 -19
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +0 -5
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +15 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +24 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/{associations_permission_check.rb → authorization.rb} +20 -2
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +11 -5
- data/app/helpers/katello/content_view_helper.rb +1 -1
- data/app/lib/actions/candlepin/product/content_add.rb +1 -2
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync.rb +2 -2
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +17 -3
- data/app/lib/actions/katello/content_view/capsule_sync.rb +1 -1
- data/app/lib/actions/katello/content_view/destroy.rb +2 -2
- data/app/lib/actions/katello/content_view/incremental_updates.rb +1 -1
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -0
- data/app/lib/actions/katello/content_view/publish.rb +12 -7
- data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +1 -1
- data/app/lib/actions/katello/content_view_puppet_environment/create.rb +2 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +4 -4
- data/app/lib/actions/katello/organization/manifest_delete.rb +1 -0
- data/app/lib/actions/katello/organization/manifest_import.rb +1 -0
- data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -0
- data/app/lib/actions/katello/product/content_create.rb +3 -3
- data/app/lib/actions/katello/product/destroy.rb +25 -4
- data/app/lib/actions/katello/repository/clone_contents.rb +3 -3
- data/app/lib/actions/katello/repository/clone_to_environment.rb +2 -2
- data/app/lib/actions/katello/repository/clone_to_version.rb +1 -1
- data/app/lib/actions/katello/repository/create.rb +1 -1
- data/app/lib/actions/katello/repository/destroy.rb +10 -4
- data/app/lib/actions/katello/repository/export.rb +3 -3
- data/app/lib/actions/katello/repository/finish_upload.rb +2 -2
- data/app/lib/actions/katello/repository/import_upload.rb +3 -3
- data/app/lib/actions/katello/repository/metadata_generate.rb +1 -1
- data/app/lib/actions/katello/repository/multi_clone_contents.rb +6 -10
- data/app/lib/actions/katello/repository/purge_empty_content.rb +1 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +35 -25
- data/app/lib/actions/katello/repository/update.rb +30 -19
- data/app/lib/actions/katello/repository/update_http_proxy_details.rb +1 -1
- data/app/lib/actions/katello/repository/update_metadata_sync.rb +1 -1
- data/app/lib/actions/katello/repository/upload_files.rb +2 -2
- data/app/lib/actions/katello/repository/verify_checksum.rb +28 -0
- data/app/lib/actions/pulp/content_view_puppet_environment/copy_contents.rb +1 -1
- data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +1 -1
- data/app/lib/actions/pulp/orchestration/repository/sync.rb +2 -1
- data/app/lib/actions/pulp/repository/copy_all_units.rb +1 -1
- data/app/lib/actions/pulp/repository/copy_units.rb +1 -1
- data/app/lib/actions/pulp/repository/create.rb +1 -1
- data/app/lib/actions/pulp/repository/destroy.rb +1 -1
- data/app/lib/actions/pulp/repository/remove_units.rb +2 -2
- data/app/lib/actions/pulp/repository/sync.rb +3 -2
- data/app/lib/actions/pulp3/capsule_content/sync.rb +3 -1
- data/app/lib/actions/pulp3/content_guard/refresh_all_distributions.rb +19 -0
- data/app/lib/actions/pulp3/content_migration.rb +3 -3
- data/app/lib/actions/pulp3/content_view_version/create_exporter.rb +20 -0
- data/app/lib/actions/pulp3/content_view_version/destroy_exporter.rb +16 -0
- data/app/lib/actions/pulp3/content_view_version/export.rb +19 -0
- data/app/lib/actions/pulp3/import_migration.rb +3 -3
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +69 -0
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +1 -2
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +22 -0
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +0 -1
- data/app/lib/actions/pulp3/repository/multi_copy_units.rb +2 -2
- data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +85 -0
- data/app/lib/actions/pulp3/repository/refresh_distribution.rb +11 -5
- data/app/lib/actions/pulp3/repository/repair.rb +29 -0
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
- data/app/lib/actions/pulp3/repository/save_version.rb +20 -16
- data/app/lib/actions/pulp3/repository/save_versions.rb +1 -1
- data/app/lib/actions/pulp3/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb +6 -2
- data/app/lib/actions/pulp3/repository/upload_file.rb +2 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -3
- data/app/lib/katello/concerns/permission_extensions.rb +14 -0
- data/app/lib/katello/foreman.rb +1 -1
- data/app/lib/katello/resources/candlepin/product.rb +0 -11
- data/app/lib/katello/resources/registry.rb +3 -3
- data/app/models/katello/authorization/content_view_version_export_history.rb +11 -0
- data/app/models/katello/authorization/product.rb +4 -0
- data/app/models/katello/authorization/repository.rb +8 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +2 -1
- data/app/models/katello/concerns/organization_extensions.rb +6 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +2 -2
- data/app/models/katello/concerns/redhat_extensions.rb +4 -2
- data/app/models/katello/concerns/smart_proxy_extensions.rb +33 -16
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -1
- data/app/models/katello/content_view.rb +1 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_environment.rb +1 -1
- data/app/models/katello/content_view_version.rb +3 -1
- data/app/models/katello/content_view_version_export_history.rb +22 -0
- data/app/models/katello/docker_meta_tag.rb +1 -1
- data/app/models/katello/errata_status.rb +21 -12
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/glue/candlepin/owner.rb +4 -2
- data/app/models/katello/glue/pulp/repo.rb +3 -1
- data/app/models/katello/host/content_facet.rb +8 -0
- data/app/models/katello/kt_environment.rb +1 -1
- data/app/models/katello/package_group.rb +1 -1
- data/app/models/katello/ping.rb +8 -3
- data/app/models/katello/pulp3/content_guard.rb +1 -1
- data/app/models/katello/purpose_status.rb +2 -2
- data/app/models/katello/repository.rb +23 -15
- data/app/models/katello/rhsm_fact_parser.rb +1 -1
- data/app/models/katello/root_repository.rb +2 -15
- data/app/models/katello/sync_plan.rb +8 -0
- data/app/models/setting/content.rb +3 -1
- data/app/services/cert/certs.rb +10 -2
- data/app/services/katello/candlepin/event_handler.rb +1 -0
- data/app/services/katello/host_status_manager.rb +7 -0
- data/app/services/katello/pulp/content.rb +1 -1
- data/app/services/katello/pulp/repository.rb +7 -7
- data/app/services/katello/pulp/repository/deb.rb +2 -2
- data/app/services/katello/pulp/repository/docker.rb +5 -5
- data/app/services/katello/pulp/repository/file.rb +2 -2
- data/app/services/katello/pulp/repository/ostree.rb +2 -2
- data/app/services/katello/pulp/repository/puppet.rb +2 -2
- data/app/services/katello/pulp/repository/yum.rb +5 -6
- data/app/services/katello/pulp/smart_proxy_repository.rb +1 -1
- data/app/services/katello/pulp3/ansible_collection.rb +2 -2
- data/app/services/katello/pulp3/api/core.rb +16 -0
- data/app/services/katello/pulp3/content.rb +3 -3
- data/app/services/katello/pulp3/content_view_version/export.rb +71 -0
- data/app/services/katello/pulp3/distribution.rb +2 -2
- data/app/services/katello/pulp3/docker_blob.rb +2 -2
- data/app/services/katello/pulp3/docker_manifest.rb +2 -2
- data/app/services/katello/pulp3/docker_manifest_list.rb +2 -2
- data/app/services/katello/pulp3/docker_tag.rb +2 -2
- data/app/services/katello/pulp3/erratum.rb +2 -2
- data/app/services/katello/pulp3/file_unit.rb +2 -2
- data/app/services/katello/pulp3/migration.rb +139 -34
- data/app/services/katello/pulp3/migration_plan.rb +50 -14
- data/app/services/katello/pulp3/migration_switchover.rb +41 -9
- data/app/services/katello/pulp3/module_stream.rb +2 -2
- data/app/services/katello/pulp3/package_group.rb +2 -2
- data/app/services/katello/pulp3/repository.rb +9 -9
- data/app/services/katello/pulp3/repository/docker.rb +18 -10
- data/app/services/katello/pulp3/repository/yum.rb +25 -13
- data/app/services/katello/pulp3/repository_mirror.rb +2 -1
- data/app/services/katello/pulp3/rpm.rb +2 -2
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -2
- data/app/services/katello/pulp3/smart_proxy_repository.rb +1 -1
- data/app/services/katello/pulp3/srpm.rb +2 -2
- data/app/services/katello/pulp3/task_group.rb +1 -1
- data/app/services/katello/pulp3/yum_metadata_file.rb +2 -2
- data/app/services/katello/registration_manager.rb +9 -3
- data/app/services/katello/repository_type.rb +1 -1
- data/app/services/katello/smart_proxy_helper.rb +14 -17
- data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +10 -2
- data/app/views/katello/api/v2/content_view_repositories/show_all.json.rabl +8 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/index.json.rabl +7 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +13 -0
- data/app/views/katello/api/v2/package_groups/show.json.rabl +1 -1
- data/app/views/katello/api/v2/packages/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
- data/app/views/katello/api/v2/srpms/show.json.rabl +1 -1
- data/app/views/katello/api/v2/sync_plans/show.json.rabl +2 -1
- data/config/routes/api/rhsm.rb +1 -0
- data/config/routes/api/v2.rb +8 -1
- data/db/migrate/20200818040551_add_content_view_version_export_history.rb +13 -0
- data/db/migrate/20200818192230_update_system_purpose_status.rb +12 -0
- data/db/migrate/20200820145217_add_download_concurrency_to_katello_root_repositories.rb +5 -0
- data/db/migrate/20200910140340_remove_distribution_uuid.rb +5 -0
- data/db/migrate/20200914200906_remove_auto_enabled.rb +5 -0
- data/engines/bastion/app/assets/javascripts/bastion/bastion.js +1 -0
- data/engines/bastion/app/assets/javascripts/bastion/routing.module.js +1 -1
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-ui-router/stateEvents.js +300 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-applicable.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-traces.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-host-collections.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-host-collections.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-available-content-views.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-content-views-list.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-docker-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-ostree-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-docker-repositories-list.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-ostree-repositories-list.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-errata-filter.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-package-group-filter.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-names.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-versions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-content-views.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-content-views.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/files.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/host-collections.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +57 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +45 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +42 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +45 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +11 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization-selector.controller.js +5 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-sync-plan-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +16 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-content-views.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-repositories.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +4 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.controller.js +1 -1
- data/lib/katello/engine.rb +2 -0
- data/lib/katello/permission_creator.rb +14 -9
- data/lib/katello/tasks/clean_published_repo_directories.rake +3 -3
- data/lib/katello/tasks/pulp3_content_switchover.rake +24 -6
- data/lib/katello/tasks/pulp3_migration.rake +4 -2
- data/lib/katello/tasks/pulp3_post_migration_check.rake +2 -2
- data/lib/katello/tasks/reimport.rake +1 -1
- data/lib/katello/tasks/repository.rake +15 -2
- data/lib/katello/tasks/unify_hosts.rake +1 -0
- data/lib/katello/tasks/upgrades/3.11/update_puppet_repos.rake +3 -3
- data/lib/katello/tasks/upgrades/3.12/remove_pulp2_notifier.rake +2 -2
- data/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake +2 -2
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +47 -47
- data/locale/katello.pot +160 -160
- data/webpack/containers/Application/config.js +4 -4
- data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +22 -32
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +0 -14
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -5
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +15 -6
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +0 -1
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +24 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +114 -26
- metadata +67 -33
- data/app/lib/actions/candlepin/product/content_update_enablement.rb +0 -18
- data/app/lib/actions/katello/repository/content_update.rb +0 -41
- data/app/lib/actions/katello/repository/update_cv_repo_cert_guard.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c7f446fd8f4d3af288f0bbbf1f5b56bdac0f903d0c55fc332221d2cf2830384
|
4
|
+
data.tar.gz: 621fc49c5e82b6698a805c7a9b29143bad8b4b17690b94cd6cae3a65de1f33d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e88e27186ae85ae6787743e2295b1076e9b6af862a531fc6aec29de59c18a378aa377725b0f7687594fcb8e9d891e6dc3d19e03f26aed3f1e9009eb03c03877d
|
7
|
+
data.tar.gz: 71d88ce6981546419a0f01f22a634727fdf36e11d164b69366aeabf00eb8ac1490935123c66e0733896ffc158b68b62d61817e4f03329f29cf6873fd1075da58
|
@@ -10,8 +10,8 @@ module Katello
|
|
10
10
|
before_action :registry_authorize, except: [:token, :v1_search, :catalog]
|
11
11
|
before_action :authorize_repository_read, only: [:pull_manifest, :tags_list]
|
12
12
|
before_action :authorize_repository_write, only: [:push_manifest]
|
13
|
-
skip_before_action :
|
14
|
-
|
13
|
+
skip_before_action :check_media_type, only: [:start_upload_blob, :upload_blob, :finish_upload_blob,
|
14
|
+
:chunk_upload_blob, :push_manifest]
|
15
15
|
|
16
16
|
wrap_parameters false
|
17
17
|
|
@@ -200,7 +200,9 @@ module Katello
|
|
200
200
|
end
|
201
201
|
|
202
202
|
def pull_blob
|
203
|
-
|
203
|
+
headers = {}
|
204
|
+
headers['Accept'] = request.headers['Accept'] if request.headers['Accept']
|
205
|
+
r = Resources::Registry::Proxy.get(@_request.fullpath, headers)
|
204
206
|
render json: r
|
205
207
|
end
|
206
208
|
|
@@ -10,7 +10,7 @@ module Katello
|
|
10
10
|
before_action :find_host, :only => [:upload_package_profile, :upload_profiles, :deb_package_profile]
|
11
11
|
before_action :authorize_client_or_user, :only => [:upload_package_profile, :upload_profiles, :deb_package_profile]
|
12
12
|
|
13
|
-
skip_before_action :
|
13
|
+
skip_before_action :check_media_type
|
14
14
|
|
15
15
|
#api :PUT, "/consumers/:id/packages", N_("Update installed packages")
|
16
16
|
#api :PUT, "/consumers/:id/profile", N_("Update installed packages")
|
@@ -26,7 +26,7 @@ module Katello
|
|
26
26
|
before_action :set_organization_id, :except => [:hypervisors_update, :async_hypervisors_update]
|
27
27
|
before_action :find_hypervisor_organization, :only => [:async_hypervisors_update, :hypervisors_update]
|
28
28
|
|
29
|
-
before_action :
|
29
|
+
before_action :check_media_type, :except => :async_hypervisors_update
|
30
30
|
|
31
31
|
prepend_before_action :convert_owner_to_organization_id, :except => [:hypervisors_update, :async_hypervisors_update], :if => lambda { params.key?(:owner) }
|
32
32
|
prepend_before_action :convert_organization_label_to_id, :only => [:rhsm_index, :consumer_activate, :consumer_create], :if => lambda { params.key?(:organization_id) }
|
@@ -480,7 +480,7 @@ module Katello
|
|
480
480
|
else
|
481
481
|
User.consumer? || ::User.current.can?(:view_organizations, self)
|
482
482
|
end
|
483
|
-
when "rhsm_proxy_owner_servicelevels_path"
|
483
|
+
when "rhsm_proxy_owner_servicelevels_path", "rhsm_proxy_owner_system_purpose_path"
|
484
484
|
(User.consumer? || ::User.current.can?(:view_organizations, self))
|
485
485
|
when "rhsm_proxy_consumer_accessible_content_path", "rhsm_proxy_consumer_certificates_path",
|
486
486
|
"rhsm_proxy_consumer_releases_path", "rhsm_proxy_certificate_serials_path",
|
@@ -5,7 +5,7 @@ module Katello
|
|
5
5
|
include Api::V2::Rendering
|
6
6
|
include Api::V2::ErrorHandling
|
7
7
|
include ::Foreman::Controller::CsvResponder
|
8
|
-
include Concerns::Api::V2::
|
8
|
+
include Concerns::Api::V2::Authorization
|
9
9
|
|
10
10
|
# support for session (thread-local) variables must be the last filter in this class
|
11
11
|
include Foreman::ThreadSession::Cleaner
|
@@ -4,7 +4,7 @@ module Katello
|
|
4
4
|
before_action :authorize
|
5
5
|
before_action :find_organization, :only => [:create, :index, :auto_complete_search]
|
6
6
|
before_action :find_content_credential, :only => [:show, :update, :destroy, :content, :set_content]
|
7
|
-
skip_before_action :
|
7
|
+
skip_before_action :check_media_type, :only => [:create, :content, :set_content]
|
8
8
|
|
9
9
|
def resource_class
|
10
10
|
Katello::GpgKey
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::ContentUploadsController < Api::V2::ApiController
|
3
3
|
before_action :find_repository
|
4
|
-
skip_before_action :
|
4
|
+
skip_before_action :check_media_type, :only => [:update]
|
5
5
|
|
6
6
|
include ::Foreman::Controller::FilterParameters
|
7
7
|
filter_parameters :content
|
@@ -13,8 +13,8 @@ module Katello
|
|
13
13
|
param :content_type, RepositoryTypeManager.uploadable_content_types.map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree', 'puppet_module', 'rpm', 'srpm')")
|
14
14
|
def create
|
15
15
|
content_type = params[:content_type] || ::Katello::RepositoryTypeManager.find(@repository.content_type).default_managed_content_type.label
|
16
|
-
unit_type_id = SmartProxy.
|
17
|
-
render :json => @repository.backend_content_service(::SmartProxy.
|
16
|
+
unit_type_id = SmartProxy.pulp_primary.content_service(content_type).content_type
|
17
|
+
render :json => @repository.backend_content_service(::SmartProxy.pulp_primary).create_upload(params[:size], params[:checksum], unit_type_id)
|
18
18
|
end
|
19
19
|
|
20
20
|
api :PUT, "/repositories/:repository_id/content_uploads/:id", N_("Upload a chunk of the file's content")
|
@@ -24,7 +24,7 @@ module Katello
|
|
24
24
|
param :offset, :number, :required => true, :desc => N_("The offset in the file where the content starts")
|
25
25
|
param :content, File, :required => true, :desc => N_("The actual file contents")
|
26
26
|
def update
|
27
|
-
@repository.backend_content_service(::SmartProxy.
|
27
|
+
@repository.backend_content_service(::SmartProxy.pulp_primary)
|
28
28
|
.upload_chunk(params[:id], params[:offset], params[:content], params[:size])
|
29
29
|
head :no_content
|
30
30
|
end
|
@@ -33,7 +33,7 @@ module Katello
|
|
33
33
|
param :repository_id, :number, :required => true, :desc => N_("Repository id")
|
34
34
|
param :id, String, :required => true, :desc => N_("Upload request id")
|
35
35
|
def destroy
|
36
|
-
@repository.backend_content_service(::SmartProxy.
|
36
|
+
@repository.backend_content_service(::SmartProxy.pulp_primary).delete_upload(params[:id])
|
37
37
|
head :no_content
|
38
38
|
end
|
39
39
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::ContentViewRepositoriesController < Api::V2::ApiController
|
3
|
+
# There are other Content View Repository related endpoints that are in RepositoriesController
|
4
|
+
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
|
+
|
6
|
+
before_action :find_content_view
|
7
|
+
before_action :find_organization_from_cv
|
8
|
+
|
9
|
+
# content_views/:id/repositories/show_all
|
10
|
+
# Shows all repositories, added and available to add, for a content view
|
11
|
+
# Undocumented endpoint since the functionality exists in separate calls already.
|
12
|
+
# This was created for ease of pagination and search for the UI
|
13
|
+
param :id, :number, desc: N_("Content View id"), required: true
|
14
|
+
def show_all
|
15
|
+
kr = Katello::Repository.table_name
|
16
|
+
krr = Katello::RootRepository.table_name
|
17
|
+
kcvr = Katello::ContentViewRepository.table_name
|
18
|
+
join_query = <<-SQL
|
19
|
+
LEFT OUTER JOIN #{kcvr}
|
20
|
+
ON #{kr}.id = #{kcvr}.repository_id
|
21
|
+
AND #{kcvr}.content_view_id = #{@content_view.id}
|
22
|
+
SQL
|
23
|
+
order_query = <<-SQL
|
24
|
+
CAST (#{kcvr}.repository_id as BOOLEAN) ASC, #{krr}.name
|
25
|
+
SQL
|
26
|
+
|
27
|
+
query = Katello::Repository.readable.in_default_view.in_organization(@organization)
|
28
|
+
# Use custom sort to perform the join and order since we need to order by specific content_view
|
29
|
+
# and the ORDER BY query needs access to the katello_content_view_repositories table
|
30
|
+
custom_sort = ->(sort_query) { sort_query.joins(:root).joins(join_query).order(order_query) }
|
31
|
+
options = { resource_class: Katello::Repository, custom_sort: custom_sort }
|
32
|
+
repos = scoped_search(query, nil, nil, options)
|
33
|
+
|
34
|
+
respond_for_index(:collection => repos)
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def find_content_view
|
40
|
+
@content_view = ContentView.find(params[:content_view_id])
|
41
|
+
end
|
42
|
+
|
43
|
+
def find_organization_from_cv
|
44
|
+
@organization = @content_view.organization
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -82,33 +82,64 @@ module Katello
|
|
82
82
|
respond_for_async :resource => task
|
83
83
|
end
|
84
84
|
|
85
|
+
api :GET, "/content_view_versions/export_histories", N_("Show the export history for a content view version")
|
86
|
+
param :content_view_version_id, :number, :desc => N_("Content view version identifier"), :required => false
|
87
|
+
param :content_view_id, :number, :desc => N_("Content view identifier"), :required => false
|
88
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
89
|
+
param :organization_id, :number, :desc => N_("Organization identifier"), :required => false
|
90
|
+
param_group :search, Api::V2::ApiController
|
91
|
+
add_scoped_search_description_for(ContentViewVersionExportHistory)
|
92
|
+
def export_histories
|
93
|
+
history = ContentViewVersionExportHistory.readable
|
94
|
+
history = history.where(:content_view_version_id => params[:content_view_version_id]) unless params[:content_view_version_id].blank?
|
95
|
+
history = history.where(:destination_server => params[:destination_server]) unless params[:destination_server].blank?
|
96
|
+
history = history.with_organization_id(params[:organization_id]) unless params[:organization_id].blank?
|
97
|
+
history = history.with_content_view_id(params[:content_view_id]) unless params[:content_view_id].blank?
|
98
|
+
respond_for_index(:collection => scoped_search(history, 'id', 'asc', resource_class: ContentViewVersionExportHistory),
|
99
|
+
:template => '../../../api/v2/content_view_version_export_histories/index')
|
100
|
+
end
|
101
|
+
|
85
102
|
api :POST, "/content_view_versions/:id/export", N_("Export a content view version"), :deprecated => true
|
86
103
|
param :id, :number, :desc => N_("Content view version identifier"), :required => true
|
87
|
-
param :
|
88
|
-
param :
|
89
|
-
param :
|
104
|
+
param :destination_server, String, :desc => N_("Destination Server name, required for Pulp3")
|
105
|
+
param :export_to_iso, :bool, :desc => N_("Export to ISO format. Relevant only for Pulp 2 repositories"), :required => false
|
106
|
+
param :iso_mb_size, :number, :desc => N_("maximum size of each ISO in MB. Relevant only for Pulp 2 repositories"), :required => false
|
107
|
+
param :since, Date, :desc => N_("Optional date of last export (ex: 2010-01-01T12:00:00Z). Relevant only for Pulp 2 repositories"), :required => false
|
90
108
|
def export
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
109
|
+
if SmartProxy.pulp_primary.pulp3_repository_type_support?(Katello::Repository::YUM_TYPE)
|
110
|
+
invalid_params = [:export_to_iso, :iso_mb_size, :since].reject { |param| params[param].blank? }
|
111
|
+
unless invalid_params.empty?
|
112
|
+
fail HttpErrors::BadRequest, _("Invalid parameters provided - %{params}. These are only relevant for Pulp 2 repositories" % { params: invalid_params.join(', ')})
|
113
|
+
end
|
95
114
|
|
96
|
-
|
97
|
-
|
98
|
-
|
115
|
+
if params[:destination_server].blank?
|
116
|
+
fail HttpErrors::BadRequest, _("Destination Server Name required for Pulp3 repositories")
|
117
|
+
end
|
118
|
+
|
119
|
+
task = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::Export, @version, destination_server: params[:destination_server])
|
120
|
+
else
|
121
|
+
::Foreman::Deprecation.api_deprecation_warning("Export is being deprecated and will be removed in a future version of Katello. Use hammer content-view version export instead.")
|
122
|
+
if params[:export_to_iso].blank? && params[:iso_mb_size].present?
|
123
|
+
fail HttpErrors::BadRequest, _("ISO export must be enabled when specifying ISO size")
|
124
|
+
end
|
99
125
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
126
|
+
if (repos = @version.content_view.on_demand_repositories).any?
|
127
|
+
fail HttpErrors::BadRequest, _("This content view has on demand repositories that cannot be exported: %{repos}" % {repos: repos.pluck(:label).join(", ")})
|
128
|
+
end
|
129
|
+
|
130
|
+
if params[:since].present?
|
131
|
+
begin
|
132
|
+
params[:since].to_datetime
|
133
|
+
rescue
|
134
|
+
raise HttpErrors::BadRequest, _("Invalid date provided.")
|
135
|
+
end
|
105
136
|
end
|
137
|
+
task = async_task(::Actions::Katello::ContentViewVersion::Export, @version,
|
138
|
+
::Foreman::Cast.to_bool(params[:export_to_iso]),
|
139
|
+
params[:since].try(:to_datetime),
|
140
|
+
params[:iso_mb_size])
|
106
141
|
end
|
107
142
|
|
108
|
-
task = async_task(::Actions::Katello::ContentViewVersion::Export, @version,
|
109
|
-
::Foreman::Cast.to_bool(params[:export_to_iso]),
|
110
|
-
params[:since].try(:to_datetime),
|
111
|
-
params[:iso_mb_size])
|
112
143
|
respond_for_async :resource => task
|
113
144
|
end
|
114
145
|
|
@@ -5,7 +5,7 @@ module Katello
|
|
5
5
|
before_action :authorize
|
6
6
|
before_action :find_organization, :only => [:create, :index, :auto_complete_search]
|
7
7
|
before_action :find_gpg_key, :only => [:show, :update, :destroy, :content, :set_content]
|
8
|
-
skip_before_action :
|
8
|
+
skip_before_action :check_media_type, :only => [:create, :content, :set_content]
|
9
9
|
|
10
10
|
def_param_group :gpg_key do
|
11
11
|
param :name, :identifier, :action_aware => true, :required => true, :desc => N_("identifier of the gpg key")
|
@@ -2,11 +2,6 @@ module Katello
|
|
2
2
|
class Api::V2::HostTracerController < Api::V2::ApiController
|
3
3
|
before_action :find_host, :only => :index
|
4
4
|
|
5
|
-
resource_description do
|
6
|
-
api_version 'v2'
|
7
|
-
api_base_url "/api"
|
8
|
-
end
|
9
|
-
|
10
5
|
api :GET, "/hosts/:host_id/traces", N_("List services that need restarting on the host")
|
11
6
|
param :host_id, :number, :required => true, :desc => N_("ID of the host")
|
12
7
|
def index
|
@@ -50,6 +50,21 @@ module Katello
|
|
50
50
|
respond_for_async :resource => task
|
51
51
|
end
|
52
52
|
|
53
|
+
api :PUT, "/products/bulk/verify_checksum", N_("Verify checksum for one or more products")
|
54
|
+
param :ids, Array, :desc => N_("List of product ids"), :required => true
|
55
|
+
def verify_checksum_products
|
56
|
+
repairable_products = @products.syncable
|
57
|
+
repairable_roots = RootRepository.where(:product_id => repairable_products).
|
58
|
+
where(:content_type => ::Katello::Repository::YUM_TYPE).has_url.select { |r| r.library_instance }.uniq
|
59
|
+
|
60
|
+
repairable_repositories = Katello::Repository.where(:root_id => repairable_roots)
|
61
|
+
task = async_task(::Actions::BulkAction,
|
62
|
+
::Actions::Katello::Repository::VerifyChecksum,
|
63
|
+
repairable_repositories)
|
64
|
+
|
65
|
+
respond_for_async :resource => task
|
66
|
+
end
|
67
|
+
|
53
68
|
api :PUT, "/products/bulk/http_proxy", N_("Update the HTTP proxy configuration on the repositories of one or more products.")
|
54
69
|
param :ids, Array, :desc => N_("List of product ids"), :required => true
|
55
70
|
param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policy for HTTP proxy for content sync")
|
@@ -13,9 +13,10 @@ module Katello
|
|
13
13
|
before_action :find_product, :only => [:index, :auto_complete_search]
|
14
14
|
before_action :find_product_for_create, :only => [:create]
|
15
15
|
before_action :find_organization_from_product, :only => [:create]
|
16
|
-
before_action :
|
17
|
-
|
18
|
-
|
16
|
+
before_action :find_unauthorized_katello_resource, :only => [:gpg_key_content]
|
17
|
+
before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :sync, :export,
|
18
|
+
:remove_content, :upload_content, :republish,
|
19
|
+
:import_uploads, :verify_checksum]
|
19
20
|
before_action :find_content, :only => :remove_content
|
20
21
|
before_action :find_organization_from_repo, :only => [:update]
|
21
22
|
before_action :error_on_rh_product, :only => [:create]
|
@@ -26,7 +27,7 @@ module Katello
|
|
26
27
|
before_action(:only => [:create, :update]) { find_content_credential CONTENT_CREDENTIAL_SSL_CLIENT_KEY_TYPE }
|
27
28
|
before_action :check_ignore_global_proxy, :only => [ :update, :create ]
|
28
29
|
skip_before_action :authorize, :only => [:gpg_key_content]
|
29
|
-
skip_before_action :
|
30
|
+
skip_before_action :check_media_type, :only => [:upload_content]
|
30
31
|
|
31
32
|
def custom_index_relation(collection)
|
32
33
|
collection.includes(:product)
|
@@ -43,6 +44,7 @@ module Katello
|
|
43
44
|
param :docker_upstream_name, String, :desc => N_("Name of the upstream docker repository")
|
44
45
|
param :docker_tags_whitelist, Array, :desc => N_("Comma separated list of tags to sync for Container Image repository")
|
45
46
|
param :download_policy, ["immediate", "on_demand", "background"], :desc => N_("download policy for yum repos (either 'immediate', 'on_demand', or 'background (deprecated)')")
|
47
|
+
param :download_concurrency, :number, :desc => N_("Used to determine download concurrency of the repository in pulp3. Use value less than 20. Defaults to 10")
|
46
48
|
param :mirror_on_sync, :bool, :desc => N_("true if this repository when synced has to be mirrored from the source and stale rpms removed")
|
47
49
|
param :verify_ssl_on_sync, :bool, :desc => N_("if true, Katello will verify the upstream url's SSL certifcates are signed by a trusted CA")
|
48
50
|
param :upstream_username, String, :desc => N_("Username of the upstream repository user used for authentication")
|
@@ -57,7 +59,6 @@ module Katello
|
|
57
59
|
param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
|
58
60
|
param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for HTTP proxy for content sync")
|
59
61
|
param :http_proxy_id, :number, :desc => N_("ID of a HTTP Proxy")
|
60
|
-
param :auto_enabled, :bool, :desc => N_("if true, the repositories will be automatically enabled on a registered host subscribed to this product. Default: true")
|
61
62
|
end
|
62
63
|
|
63
64
|
def_param_group :repo_create do
|
@@ -295,6 +296,15 @@ module Katello
|
|
295
296
|
raise HttpErrors::BadRequest, e.message
|
296
297
|
end
|
297
298
|
|
299
|
+
api :POST, "/repositories/:id/verify_checksum", N_("Verify checksum of repository contents")
|
300
|
+
param :id, :number, :required => true, :desc => N_("repository ID")
|
301
|
+
def verify_checksum
|
302
|
+
task = async_task(::Actions::Katello::Repository::VerifyChecksum, @repository)
|
303
|
+
respond_for_async :resource => task
|
304
|
+
rescue Errors::InvalidActionOptionError => e
|
305
|
+
raise HttpErrors::BadRequest, e.message
|
306
|
+
end
|
307
|
+
|
298
308
|
api :POST, "/repositories/:id/export", N_("Export a repository")
|
299
309
|
param :id, :number, :desc => N_("Repository identifier"), :required => true
|
300
310
|
param :export_to_iso, :bool, :desc => N_("Export to ISO format"), :required => false
|
@@ -438,16 +448,17 @@ module Katello
|
|
438
448
|
protected
|
439
449
|
|
440
450
|
def find_product
|
441
|
-
|
451
|
+
if params[:product_id]
|
452
|
+
@product = Product.readable.find_by(id: params[:product_id])
|
453
|
+
throw_resource_not_found(name: 'product', id: params[:product_id]) if @product.nil?
|
454
|
+
end
|
455
|
+
|
442
456
|
find_organization_from_product if @organization.nil? && @product
|
443
457
|
end
|
444
458
|
|
445
459
|
def find_product_for_create
|
446
|
-
@product = Product.
|
447
|
-
|
448
|
-
|
449
|
-
def find_repository
|
450
|
-
@repository = Repository.find(params[:id])
|
460
|
+
@product = Product.editable.find_by(id: params[:product_id])
|
461
|
+
throw_resource_not_found(name: 'product', id: params[:product_id]) if @product.nil?
|
451
462
|
end
|
452
463
|
|
453
464
|
def find_content_credential(content_type)
|
@@ -464,8 +475,8 @@ module Katello
|
|
464
475
|
end
|
465
476
|
|
466
477
|
def repository_params
|
467
|
-
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
|
468
|
-
:ostree_upstream_sync_depth, :ostree_upstream_sync_policy,
|
478
|
+
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,
|
469
480
|
:deb_releases, :deb_components, :deb_architectures, :description, :http_proxy_policy, :http_proxy_id,
|
470
481
|
{:ignorable_content => []}
|
471
482
|
]
|
@@ -516,7 +527,6 @@ module Katello
|
|
516
527
|
root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
|
517
528
|
root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
|
518
529
|
root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
|
519
|
-
root.auto_enabled = repo_params[:auto_enabled] if repo_params.key?(:auto_enabled)
|
520
530
|
|
521
531
|
if root.ostree?
|
522
532
|
root.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
|
@@ -10,7 +10,7 @@ module Katello
|
|
10
10
|
before_action :check_upstream_connection, only: [:refresh_manifest]
|
11
11
|
before_action :find_provider
|
12
12
|
|
13
|
-
skip_before_action :
|
13
|
+
skip_before_action :check_media_type, :only => [:upload]
|
14
14
|
|
15
15
|
resource_description do
|
16
16
|
description "Subscriptions management."
|
data/app/controllers/katello/concerns/api/v2/{associations_permission_check.rb → authorization.rb}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
module Concerns
|
3
|
-
module Api::V2::
|
3
|
+
module Api::V2::Authorization
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
# The purpose of this module is to protect a controller from a user creating or updating some association
|
@@ -20,6 +20,24 @@ module Katello
|
|
20
20
|
before_action :check_association_ids, :only => [:create, :update]
|
21
21
|
end
|
22
22
|
|
23
|
+
def find_authorized_katello_resource
|
24
|
+
finder_scope = ::Foreman::AccessControl.permissions_for_controller_action(path_to_authenticate).first&.finder_scope
|
25
|
+
if finder_scope
|
26
|
+
instance_variable_set("@#{resource_name}", resource_class.send(finder_scope).find_by(:id => params[:id]))
|
27
|
+
end
|
28
|
+
|
29
|
+
throw_resource_not_found if instance_variable_get("@#{resource_name}").nil?
|
30
|
+
end
|
31
|
+
|
32
|
+
def find_unauthorized_katello_resource
|
33
|
+
instance_variable_set("@#{resource_name}", resource_class.find_by(id: params[:id]))
|
34
|
+
throw_resource_not_found if instance_variable_get("@#{resource_name}").nil?
|
35
|
+
end
|
36
|
+
|
37
|
+
def throw_resource_not_found(name: resource_name, id: params[:id])
|
38
|
+
fail HttpErrors::NotFound, _("Could not find %{name} resource with id %{id}") % {id: id, name: name}
|
39
|
+
end
|
40
|
+
|
23
41
|
def check_association_ids
|
24
42
|
if filtered_associations
|
25
43
|
wrapped_params = params[self._wrapper_options.name]
|
@@ -36,7 +54,7 @@ module Katello
|
|
36
54
|
end
|
37
55
|
end
|
38
56
|
else
|
39
|
-
Rails.logger.warn("#{self.class.name} may has unprotected associations, see
|
57
|
+
Rails.logger.warn("#{self.class.name} may has unprotected associations, see controllers/katello/api/v2/authorization.rb for details.") if ENV['RAILS_ENV'] == 'development'
|
40
58
|
end
|
41
59
|
end
|
42
60
|
|
@@ -19,11 +19,17 @@ module Katello
|
|
19
19
|
prepend Overrides
|
20
20
|
|
21
21
|
def update_multiple_taxonomies(type)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
if type == :organization
|
23
|
+
new_org_id = params.dig(type, 'id')
|
24
|
+
|
25
|
+
if new_org_id
|
26
|
+
registered_host = @hosts.where.not(organization_id: new_org_id).joins(:subscription_facet).first
|
27
|
+
if registered_host
|
28
|
+
error _("Unregister host %s before assigning an organization") % registered_host.name
|
29
|
+
redirect_back_or_to hosts_path
|
30
|
+
return
|
31
|
+
end
|
32
|
+
end
|
27
33
|
end
|
28
34
|
|
29
35
|
super
|