katello 3.17.0 → 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
- data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
- data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
- data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
- data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
- data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
- data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
- data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_controller.rb +9 -9
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
- data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
- data/app/helpers/katello/katello_urls_helper.rb +5 -2
- data/app/lib/actions/candlepin/product/content_create.rb +2 -0
- data/app/lib/actions/candlepin/product/content_update.rb +2 -0
- data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +9 -9
- data/app/lib/actions/katello/content_view_version/import.rb +8 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
- data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
- data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
- data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
- data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
- data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
- data/app/lib/actions/katello/product/content_create.rb +7 -6
- data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
- data/app/lib/actions/katello/repository/import_upload.rb +4 -1
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +3 -1
- data/app/lib/actions/katello/repository/update.rb +5 -1
- data/app/lib/actions/katello/repository/upload_files.rb +1 -0
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
- data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
- data/app/lib/actions/pulp3/content_migration.rb +10 -0
- data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
- data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
- data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
- data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
- data/app/lib/actions/pulp3/import_migration.rb +6 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
- data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
- data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/delete.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
- data/app/lib/katello/resources/candlepin/owner.rb +5 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
- data/app/lib/katello/resources/registry.rb +3 -3
- data/app/models/katello/authorization/activation_key.rb +4 -0
- data/app/models/katello/authorization/content_view.rb +13 -0
- data/app/models/katello/authorization/content_view_component.rb +15 -0
- data/app/models/katello/authorization/content_view_filter.rb +15 -0
- data/app/models/katello/authorization/content_view_version.rb +25 -2
- data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
- data/app/models/katello/authorization/gpg_key.rb +12 -4
- data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
- data/app/models/katello/authorization/organization.rb +8 -0
- data/app/models/katello/authorization/sync_plan.rb +16 -0
- data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +4 -5
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
- data/app/models/katello/content_migration_progress.rb +4 -0
- data/app/models/katello/content_view.rb +30 -4
- data/app/models/katello/content_view_component.rb +2 -0
- data/app/models/katello/content_view_filter.rb +5 -0
- data/app/models/katello/content_view_history.rb +2 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +8 -0
- data/app/models/katello/content_view_repository.rb +13 -1
- data/app/models/katello/content_view_version_export_history.rb +8 -1
- data/app/models/katello/glue/candlepin/pool.rb +9 -14
- data/app/models/katello/glue/pulp/repo.rb +8 -0
- data/app/models/katello/gpg_key.rb +1 -1
- data/app/models/katello/ping.rb +8 -3
- data/app/models/katello/repository.rb +33 -0
- data/app/models/katello/root_repository.rb +26 -1
- data/app/models/katello/smart_proxy_sync_history.rb +8 -0
- data/app/services/katello/candlepin/event_handler.rb +2 -0
- data/app/services/katello/candlepin/message_handler.rb +34 -0
- data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
- data/app/services/katello/host_status_manager.rb +9 -0
- data/app/services/katello/pulp3/api/apt.rb +57 -0
- data/app/services/katello/pulp3/api/core.rb +8 -0
- data/app/services/katello/pulp3/api/docker.rb +4 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
- data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
- data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
- data/app/services/katello/pulp3/deb.rb +38 -0
- data/app/services/katello/pulp3/docker_manifest.rb +1 -0
- data/app/services/katello/pulp3/docker_tag.rb +1 -0
- data/app/services/katello/pulp3/migration.rb +51 -10
- data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
- data/app/services/katello/pulp3/repository.rb +10 -4
- data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
- data/app/services/katello/pulp3/repository/apt.rb +63 -0
- data/app/services/katello/pulp3/repository/docker.rb +9 -0
- data/app/services/katello/pulp3/repository/yum.rb +14 -9
- data/app/services/katello/pulp3/repository_mirror.rb +9 -4
- data/app/services/katello/pulp3/task.rb +4 -0
- data/app/services/katello/pulp3/task_group.rb +4 -0
- data/app/services/katello/repository_type.rb +2 -1
- data/app/services/katello/smart_proxy_helper.rb +9 -0
- data/app/views/dashboard/_subscription_widget.html.erb +0 -5
- data/app/views/foreman/hosts/_registration.html.erb +12 -0
- data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/app/views/katello/layouts/react.html.erb +3 -2
- data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
- data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
- data/config/routes/api/v2.rb +24 -2
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
- data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
- data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
- data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
- data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
- data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
- data/lib/katello/engine.rb +2 -0
- data/lib/katello/permission_creator.rb +98 -69
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +10 -2
- data/lib/katello/repository_types/deb.rb +9 -1
- data/lib/katello/tasks/pulp3_migration.rake +17 -3
- data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
- data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
- data/lib/katello/tasks/reset.rake +2 -1
- data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +51 -44
- data/locale/bn/katello.po +279 -55
- data/locale/cs/katello.po +278 -51
- data/locale/de/katello.po +279 -52
- data/locale/en/katello.po +278 -49
- data/locale/es/katello.po +279 -51
- data/locale/fr/katello.po +279 -51
- data/locale/gu/katello.po +279 -55
- data/locale/hi/katello.po +279 -55
- data/locale/it/katello.po +279 -51
- data/locale/ja/katello.po +279 -52
- data/locale/katello.pot +1379 -971
- data/locale/kn/katello.po +279 -55
- data/locale/ko/katello.po +279 -51
- data/locale/mr/katello.po +279 -55
- data/locale/or/katello.po +279 -55
- data/locale/pa/katello.po +279 -55
- data/locale/pt/katello.po +278 -52
- data/locale/pt_BR/katello.po +279 -51
- data/locale/ru/katello.po +279 -51
- data/locale/ta/katello.po +279 -55
- data/locale/te/katello.po +279 -55
- data/locale/zh_CN/katello.po +279 -51
- data/locale/zh_TW/katello.po +279 -52
- data/webpack/components/ActionableDetail.js +2 -1
- data/webpack/components/Search/Search.js +1 -1
- data/webpack/components/Table/MainTable.js +6 -2
- data/webpack/components/Table/TableWrapper.js +46 -9
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
- data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
- data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
- data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
- metadata +74 -13
- data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbd0716cd63dcfb9f135e084f2dcd07401019b45f4a0c6c4f61ddf0953fbb00b
|
4
|
+
data.tar.gz: d7ae76869fc68b2046637b8eb116f9f23048b0f5dce7042b3c65d77556d9d7c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86b93fe297e88ea9c5bac35ae1dbc746ffd2ddcbfdd06046552cef774153182ab5938483ff6663d6d382613603066ede7a0cccc99386d3def6c63db46194f2b
|
7
|
+
data.tar.gz: 3813c0ec50e517fbe18575d033322e0ee7df5f63b5aad7abe514e62eda523339e6f3d9a54c1734e5fdc07031217fff59ece0dc17b4d02f1e28b86db93dbb13dd
|
@@ -166,25 +166,27 @@ module Katello
|
|
166
166
|
headers[header[0].split('_')[1..-1].join('-')] = header[1]
|
167
167
|
end
|
168
168
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
169
|
+
if (manifest_response = redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers) })
|
170
|
+
#when pulp 2 is removed, this should no longer be needed, and all clients should be redirected
|
171
|
+
logger.debug filter_sensitive_data(manifest_response)
|
172
|
+
results = JSON.parse(manifest_response)
|
173
|
+
|
174
|
+
response.header['Docker-Content-Digest'] = "sha256:#{Digest::SHA256.hexdigest(manifest_response)}"
|
175
|
+
# https://docs.docker.com/registry/spec/manifest-v2-2/
|
176
|
+
# If its v2 schema 2 only the mediaType attribute will be present in the manifest
|
177
|
+
media_type = results['mediaType']
|
178
|
+
if media_type.blank?
|
179
|
+
# so mediaType is not schema2 v2 only set the mediaType based on
|
180
|
+
# https://docs.docker.com/registry/spec/manifest-v2-1/
|
181
|
+
media_type = if results["signatures"].blank?
|
182
|
+
'application/vnd.docker.distribution.manifest.v1+json'
|
183
|
+
else
|
184
|
+
'application/vnd.docker.distribution.manifest.v1+prettyjws'
|
185
|
+
end
|
186
|
+
end
|
186
187
|
|
187
|
-
|
188
|
+
render json: manifest_response, content_type: media_type
|
189
|
+
end
|
188
190
|
end
|
189
191
|
|
190
192
|
def check_blob
|
@@ -199,11 +201,24 @@ module Katello
|
|
199
201
|
render json: {}
|
200
202
|
end
|
201
203
|
|
204
|
+
def redirect_client
|
205
|
+
return yield
|
206
|
+
rescue RestClient::Exception => exception
|
207
|
+
if [301, 302, 307].include?(exception.response.code)
|
208
|
+
redirect_to exception.response.headers[:location]
|
209
|
+
nil
|
210
|
+
else
|
211
|
+
raise exception
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
202
215
|
def pull_blob
|
203
216
|
headers = {}
|
204
217
|
headers['Accept'] = request.headers['Accept'] if request.headers['Accept']
|
205
|
-
|
206
|
-
|
218
|
+
if (blob_response = redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers, max_redirects: 0) })
|
219
|
+
#when pulp 2 is removed, this should no longer be needed, and all clients should be redirected
|
220
|
+
render json: blob_response
|
221
|
+
end
|
207
222
|
end
|
208
223
|
|
209
224
|
def push_manifest
|
@@ -478,7 +493,9 @@ module Katello
|
|
478
493
|
end
|
479
494
|
|
480
495
|
def confirm_settings
|
481
|
-
|
496
|
+
if SETTINGS.dig(:katello, :container_image_registry) || SmartProxy.pulp_primary&.pulp3_repository_type_support?(::Katello::Repository::DOCKER_TYPE)
|
497
|
+
return true
|
498
|
+
end
|
482
499
|
render_error('custom_error', :status => :not_found,
|
483
500
|
:locals => { :message => "Registry not configured" })
|
484
501
|
end
|
@@ -119,7 +119,9 @@ module Katello
|
|
119
119
|
# Note that this request comes in as content-type 'text/plain' so that
|
120
120
|
# tomcat won't parse the json. Here we just pass the plain body through to candlepin
|
121
121
|
def async_hypervisors_update
|
122
|
-
task = Katello::Resources::Candlepin::Consumer.async_hypervisors(params[:owner],
|
122
|
+
task = Katello::Resources::Candlepin::Consumer.async_hypervisors(owner: params[:owner],
|
123
|
+
reporter_id: params[:reporter_id],
|
124
|
+
raw_json: request.raw_post)
|
123
125
|
async_task(::Actions::Katello::Host::Hypervisors, nil, :task_id => task['id'])
|
124
126
|
|
125
127
|
render :json => task
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module Katello
|
2
|
-
# rubocop:disable Metrics/ClassLength
|
3
2
|
class Api::V2::ActivationKeysController < Api::V2::ApiController
|
4
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
4
|
include Katello::Concerns::Api::V2::ContentOverridesController
|
@@ -7,11 +6,10 @@ module Katello
|
|
7
6
|
before_action :find_environment, :only => [:index, :create, :update]
|
8
7
|
before_action :find_optional_organization, :only => [:index, :create, :show]
|
9
8
|
before_action :find_content_view, :only => [:index]
|
10
|
-
before_action :
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
before_action :authorize
|
9
|
+
before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :available_releases, :product_content,
|
10
|
+
:available_host_collections, :add_host_collections, :remove_host_collections,
|
11
|
+
:content_override, :add_subscriptions, :remove_subscriptions,
|
12
|
+
:subscriptions]
|
15
13
|
before_action :verify_simple_content_access_disabled, :only => [:add_subscriptions]
|
16
14
|
|
17
15
|
wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level auto_attach purpose_role purpose_usage purpose_addons content_view_environment))
|
@@ -97,6 +95,9 @@ module Katello
|
|
97
95
|
param :id, :number, :desc => N_("ID of the activation key"), :required => true
|
98
96
|
param :organization_id, :number, :desc => N_("organization identifier"), :required => false
|
99
97
|
def copy
|
98
|
+
@activation_key = Katello::ActivationKey.readable.find_by(:id => params[:id])
|
99
|
+
throw_resource_not_found(name: 'activation_key', id: params[:id]) if @activation_key.nil?
|
100
|
+
|
100
101
|
fail HttpErrors::BadRequest, _("New name cannot be blank") unless params[:new_name]
|
101
102
|
@new_activation_key = @activation_key.copy(params[:new_name])
|
102
103
|
@new_activation_key.user = current_user
|
@@ -256,12 +257,6 @@ module Katello
|
|
256
257
|
activation_keys
|
257
258
|
end
|
258
259
|
|
259
|
-
def find_activation_key
|
260
|
-
@activation_key = ActivationKey.find(params[:id])
|
261
|
-
fail HttpErrors::NotFound, _("Couldn't find activation key '%s'") % params[:id] if @activation_key.nil?
|
262
|
-
@activation_key
|
263
|
-
end
|
264
|
-
|
265
260
|
private
|
266
261
|
|
267
262
|
def subscription_index
|
@@ -281,7 +276,7 @@ module Katello
|
|
281
276
|
environment_id = params[:environment][:id] if !environment_id && params[:environment]
|
282
277
|
return unless environment_id
|
283
278
|
|
284
|
-
@environment = KTEnvironment.
|
279
|
+
@environment = KTEnvironment.readable.find_by(id: environment_id)
|
285
280
|
fail HttpErrors::NotFound, _("Couldn't find environment '%s'") % params[:environment_id] if @environment.nil?
|
286
281
|
@organization = @environment.organization
|
287
282
|
@environment
|
@@ -292,7 +287,7 @@ module Katello
|
|
292
287
|
@host_collections = []
|
293
288
|
|
294
289
|
ids&.each do |host_collection_id|
|
295
|
-
host_collection = HostCollection.find(host_collection_id)
|
290
|
+
host_collection = HostCollection.readable.find(host_collection_id)
|
296
291
|
fail HttpErrors::NotFound, _("Couldn't find host collection '%s'") % host_collection_id if host_collection.nil?
|
297
292
|
@host_collections << host_collection
|
298
293
|
end
|
@@ -306,7 +301,7 @@ module Katello
|
|
306
301
|
def find_content_view
|
307
302
|
if params.include?(:content_view_id)
|
308
303
|
cv_id = params[:content_view_id]
|
309
|
-
@content_view = ContentView.find_by(:id => cv_id)
|
304
|
+
@content_view = ContentView.readable.find_by(:id => cv_id)
|
310
305
|
fail HttpErrors::NotFound, _("Couldn't find content view '%s'") % cv_id if @content_view.nil?
|
311
306
|
end
|
312
307
|
end
|
@@ -93,14 +93,14 @@ module Katello
|
|
93
93
|
|
94
94
|
def find_editable_capsule
|
95
95
|
@capsule = SmartProxy.unscoped.authorized(:manage_capsule_content).find(params[:id])
|
96
|
-
unless @capsule&.
|
96
|
+
unless @capsule&.pulp_mirror?
|
97
97
|
fail _("This request may only be performed on a Smart proxy that has the Pulp Node feature.")
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
101
|
def find_capsule
|
102
102
|
@capsule = SmartProxy.unscoped.authorized(:view_capsule_content).find(params[:id])
|
103
|
-
unless @capsule&.
|
103
|
+
unless @capsule&.pulp_mirror?
|
104
104
|
fail _("This request may only be performed on a Smart proxy that has the Pulp Node feature.")
|
105
105
|
end
|
106
106
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::ContentCredentialsController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
|
-
before_action :authorize
|
5
4
|
before_action :find_organization, :only => [:create, :index, :auto_complete_search]
|
6
|
-
before_action :
|
5
|
+
before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :content, :set_content]
|
7
6
|
skip_before_action :check_media_type, :only => [:create, :content, :set_content]
|
8
7
|
|
9
8
|
def resource_class
|
@@ -103,12 +102,6 @@ module Katello
|
|
103
102
|
|
104
103
|
protected
|
105
104
|
|
106
|
-
def find_content_credential
|
107
|
-
@content_credential = GpgKey.find(params[:id])
|
108
|
-
rescue ActiveRecord::RecordNotFound
|
109
|
-
raise HttpErrors::NotFound, _("Couldn't find Content Credential '%s'") % params[:id]
|
110
|
-
end
|
111
|
-
|
112
105
|
def content_credential_params
|
113
106
|
params.permit(:name, :content_type, :content)
|
114
107
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::ContentExportIncrementalsController < Api::V2::ApiController
|
3
|
+
before_action :fail_if_not_pulp3, :only => [:version, :library]
|
4
|
+
before_action :find_exportable_organization, :only => [:library]
|
5
|
+
before_action :find_exportable_content_view_version, :only => [:version]
|
6
|
+
before_action :find_library_export_view, :only => [:library]
|
7
|
+
before_action :find_history, :only => [:version, :library]
|
8
|
+
|
9
|
+
api :POST, "/content_export_incrementals/version", N_("Performs an incremental-export of a content view version.")
|
10
|
+
param :id, :number, :desc => N_("Content view version identifier"), :required => true
|
11
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
12
|
+
param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
|
13
|
+
"no greater than the specified size in megabytes."), :required => false
|
14
|
+
param :from_history_id, :number, :desc => N_("Export history identifier used for incremental export. "\
|
15
|
+
"If not provided the most recent export history will be used."), :required => false
|
16
|
+
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this version"\
|
17
|
+
" are unexportable. False by default."), :required => false
|
18
|
+
def version
|
19
|
+
tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::Export,
|
20
|
+
content_view_version: @version,
|
21
|
+
destination_server: params[:destination_server],
|
22
|
+
chunk_size: params[:chunk_size_mb],
|
23
|
+
from_history: @history,
|
24
|
+
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
25
|
+
|
26
|
+
respond_for_async :resource => tasks
|
27
|
+
end
|
28
|
+
|
29
|
+
api :POST, "/content_export_incrementals/library", N_("Performs an incremental-export of the repositories in library.")
|
30
|
+
param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
|
31
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
32
|
+
param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
|
33
|
+
"no greater than the specified size in megabytes."), :required => false
|
34
|
+
param :from_history_id, :number, :desc => N_("Export history identifier used for incremental export. "\
|
35
|
+
"If not provided the most recent export history will be used."), :required => false
|
36
|
+
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this organization"\
|
37
|
+
" are unexportable. False by default."), :required => false
|
38
|
+
def library
|
39
|
+
tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary,
|
40
|
+
@organization,
|
41
|
+
destination_server: params[:destination_server],
|
42
|
+
chunk_size: params[:chunk_size_mb],
|
43
|
+
from_history: @history,
|
44
|
+
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
45
|
+
respond_for_async :resource => tasks
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def find_exportable_content_view_version
|
51
|
+
@version = ContentViewVersion.exportable.find_by_id(params[:id])
|
52
|
+
throw_resource_not_found(name: 'content view version', id: params[:id]) if @version.blank?
|
53
|
+
@view = @version.content_view
|
54
|
+
end
|
55
|
+
|
56
|
+
def find_library_export_view
|
57
|
+
@view = ::Katello::Pulp3::ContentViewVersion::Export.find_library_export_view(destination_server: params[:destination_server],
|
58
|
+
organization: @organization,
|
59
|
+
create_by_default: false)
|
60
|
+
if @view.blank?
|
61
|
+
msg = _("Unable to incrementally export. Do a Full Export the library content "\
|
62
|
+
"before updating from the latest increment.")
|
63
|
+
fail HttpErrors::BadRequest, msg
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def find_history
|
68
|
+
if params[:from_history_id].present?
|
69
|
+
@history = ::Katello::ContentViewVersionExportHistory.find(params[:from_history_id])
|
70
|
+
if @history.blank?
|
71
|
+
throw_resource_not_found(name: 'export history',
|
72
|
+
id: params[:from_history_id])
|
73
|
+
end
|
74
|
+
else
|
75
|
+
@history = ::Katello::ContentViewVersionExportHistory.
|
76
|
+
latest(@view,
|
77
|
+
destination_server: params[:destination_server])
|
78
|
+
if @history.blank?
|
79
|
+
msg = _("No existing export history was found to perform an incremental export. A full export must be performed")
|
80
|
+
fail HttpErrors::NotFound, msg
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def find_exportable_organization
|
86
|
+
find_organization
|
87
|
+
unless @organization.can_export_library_content?
|
88
|
+
throw_resource_not_found(name: 'organization', id: params[:organization_id])
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def fail_if_not_pulp3
|
93
|
+
unless SmartProxy.pulp_primary.pulp3_repository_type_support?(Katello::Repository::YUM_TYPE)
|
94
|
+
fail HttpErrors::BadRequest, _("Invalid usage for Pulp 2 repositories. Use export for Yum repositories")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::ContentExportsController < Api::V2::ApiController
|
3
|
+
before_action :fail_if_not_pulp3, :only => [:version, :library]
|
4
|
+
before_action :find_exportable_organization, :only => [:library]
|
5
|
+
before_action :find_exportable_content_view_version, :only => [:version]
|
6
|
+
|
7
|
+
api :GET, "/content_exports", N_("List export histories")
|
8
|
+
param :content_view_version_id, :number, :desc => N_("Content view version identifier"), :required => false
|
9
|
+
param :content_view_id, :number, :desc => N_("Content view identifier"), :required => false
|
10
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
11
|
+
param :organization_id, :number, :desc => N_("Organization identifier"), :required => false
|
12
|
+
param :id, :number, :desc => N_("Content view version export history identifier"), :required => false
|
13
|
+
param_group :search, Api::V2::ApiController
|
14
|
+
add_scoped_search_description_for(ContentViewVersionExportHistory)
|
15
|
+
def index
|
16
|
+
history = ContentViewVersionExportHistory.readable
|
17
|
+
history = history.where(:id => params[:id]) unless params[:id].blank?
|
18
|
+
history = history.where(:content_view_version_id => params[:content_view_version_id]) unless params[:content_view_version_id].blank?
|
19
|
+
history = history.where(:destination_server => params[:destination_server]) unless params[:destination_server].blank?
|
20
|
+
history = history.with_organization_id(params[:organization_id]) unless params[:organization_id].blank?
|
21
|
+
history = history.with_content_view_id(params[:content_view_id]) unless params[:content_view_id].blank?
|
22
|
+
respond_with_template_collection("index", 'content_view_version_export_histories',
|
23
|
+
:collection => scoped_search(history, 'id', 'asc', resource_class: ContentViewVersionExportHistory))
|
24
|
+
end
|
25
|
+
|
26
|
+
api :GET, "/content_exports/api_status", N_("true if the export api is pulp3 ready and usable. This API is intended for use by hammer-cli only.")
|
27
|
+
def api_status
|
28
|
+
::Foreman::Deprecation.api_deprecation_warning("/content_exports/api_status is being deprecated and will be removed in a future version of Katello.")
|
29
|
+
render json: { api_usable: SmartProxy.pulp_primary.pulp3_repository_type_support?(Katello::Repository::YUM_TYPE) }, status: :ok
|
30
|
+
end
|
31
|
+
|
32
|
+
api :POST, "/content_exports/version", N_("Performs a full-export of a content view version.")
|
33
|
+
param :id, :number, :desc => N_("Content view version identifier"), :required => true
|
34
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
35
|
+
param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
|
36
|
+
"no greater than the specified size in megabytes."), :required => false
|
37
|
+
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this version"\
|
38
|
+
" are unexportable. False by default."), :required => false
|
39
|
+
def version
|
40
|
+
tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::Export,
|
41
|
+
content_view_version: @version,
|
42
|
+
destination_server: params[:destination_server],
|
43
|
+
chunk_size: params[:chunk_size_mb],
|
44
|
+
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
45
|
+
respond_for_async :resource => tasks
|
46
|
+
end
|
47
|
+
|
48
|
+
api :POST, "/content_exports/library", N_("Performs a full-export of the repositories in library.")
|
49
|
+
param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
|
50
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
51
|
+
param :chunk_size_mb, :number, :desc => N_("Split the exported content into archives "\
|
52
|
+
"no greater than the specified size in megabytes."), :required => false
|
53
|
+
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this organization"\
|
54
|
+
" are unexportable. False by default."), :required => false
|
55
|
+
def library
|
56
|
+
tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary,
|
57
|
+
@organization,
|
58
|
+
destination_server: params[:destination_server],
|
59
|
+
chunk_size: params[:chunk_size_mb],
|
60
|
+
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
61
|
+
respond_for_async :resource => tasks
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def find_exportable_content_view_version
|
67
|
+
@version = ContentViewVersion.exportable.find_by_id(params[:id])
|
68
|
+
throw_resource_not_found(name: 'content view version', id: params[:id]) if @version.blank?
|
69
|
+
end
|
70
|
+
|
71
|
+
def find_exportable_organization
|
72
|
+
find_organization
|
73
|
+
unless @organization.can_export_library_content?
|
74
|
+
throw_resource_not_found(name: 'organization', id: params[:organization_id])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def fail_if_not_pulp3
|
79
|
+
unless SmartProxy.pulp_primary.pulp3_repository_type_support?(Katello::Repository::YUM_TYPE)
|
80
|
+
fail HttpErrors::BadRequest, _("Invalid usage for Pulp 2 repositories. Use export for Yum repositories")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::ContentImportsController < Api::V2::ApiController
|
3
|
+
before_action :find_publishable_content_view, :only => [:version]
|
4
|
+
before_action :find_importable_organization, :only => [:library]
|
5
|
+
before_action :find_default_content_view, :only => [:library]
|
6
|
+
|
7
|
+
api :POST, "/content_imports/version", N_("Import a content view version")
|
8
|
+
param :content_view_id, :number, :desc => N_("Content view identifier"), :required => true
|
9
|
+
param :path, String, :desc => N_("Directory containing the exported Content View Version"), :required => true
|
10
|
+
param :metadata, Hash, :desc => N_("Metadata taken from the upstream export history for this Content View Version"), :required => true
|
11
|
+
def version
|
12
|
+
if @view.default?
|
13
|
+
fail HttpErrors::BadRequest, _("Cannot use this end point for importing to library. "\
|
14
|
+
"If you intented to upload to library, use the library endpoint.")
|
15
|
+
end
|
16
|
+
|
17
|
+
task = async_task(::Actions::Katello::ContentViewVersion::Import, @view, path: params[:path], metadata: metadata_params.to_h)
|
18
|
+
respond_for_async :resource => task
|
19
|
+
end
|
20
|
+
|
21
|
+
api :POST, "/content_imports/library", N_("Import a content view version to the library")
|
22
|
+
param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
|
23
|
+
param :path, String, :desc => N_("Directory containing the exported Content View Version"), :required => true
|
24
|
+
param :metadata, Hash, :desc => N_("Metadata taken from the upstream export history for this Content View Version"), :required => true
|
25
|
+
def library
|
26
|
+
task = async_task(::Actions::Katello::ContentViewVersion::ImportLibrary, @organization, path: params[:path], metadata: metadata_params.to_h)
|
27
|
+
respond_for_async :resource => task
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def find_publishable_content_view
|
33
|
+
@view = ContentView.publishable.find(params[:content_view_id])
|
34
|
+
throw_resource_not_found(name: 'content_view', id: params[:content_view_id]) if @view.blank?
|
35
|
+
end
|
36
|
+
|
37
|
+
def find_default_content_view
|
38
|
+
@view = @organization&.default_content_view
|
39
|
+
throw_resource_not_found(name: 'organization', id: params[:organization_id]) if @view.blank?
|
40
|
+
end
|
41
|
+
|
42
|
+
def find_importable_organization
|
43
|
+
find_organization
|
44
|
+
throw_resource_not_found(name: 'organization', id: params[:organization_id]) unless @organization.can_import_library_content?
|
45
|
+
end
|
46
|
+
|
47
|
+
def metadata_params
|
48
|
+
params.require(:metadata).permit(
|
49
|
+
:organization,
|
50
|
+
:content_view,
|
51
|
+
:repository_mapping,
|
52
|
+
:toc,
|
53
|
+
content_view_version: [:major, :minor]
|
54
|
+
).tap do |nested|
|
55
|
+
nested[:repository_mapping] = params[:metadata].require(:repository_mapping).permit!
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|