katello 3.17.0.rc2 → 3.18.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.

Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
  5. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
  6. data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
  7. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
  8. data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
  9. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +74 -34
  10. data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
  11. data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
  12. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
  13. data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
  14. data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
  15. data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
  16. data/app/controllers/katello/api/v2/host_tracer_controller.rb +16 -36
  17. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +44 -4
  18. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
  19. data/app/controllers/katello/api/v2/products_controller.rb +9 -9
  20. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
  21. data/app/controllers/katello/api/v2/repositories_controller.rb +8 -5
  22. data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
  23. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
  24. data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
  25. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
  26. data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
  27. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
  28. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
  29. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
  30. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +24 -0
  31. data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
  32. data/app/helpers/katello/katello_urls_helper.rb +5 -2
  33. data/app/lib/actions/candlepin/product/content_create.rb +2 -0
  34. data/app/lib/actions/candlepin/product/content_update.rb +2 -0
  35. data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
  36. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
  37. data/app/lib/actions/katello/content_view/promote.rb +2 -2
  38. data/app/lib/actions/katello/content_view/promote_to_environment.rb +12 -3
  39. data/app/lib/actions/katello/content_view/publish.rb +19 -3
  40. data/app/lib/actions/katello/content_view_version/import.rb +30 -0
  41. data/app/lib/actions/katello/content_view_version/incremental_update.rb +22 -6
  42. data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
  43. data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
  44. data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
  45. data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
  46. data/app/lib/actions/katello/organization/create.rb +1 -1
  47. data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
  48. data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
  49. data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
  50. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +8 -0
  51. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +8 -0
  52. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +16 -2
  53. data/app/lib/actions/katello/product/content_create.rb +7 -6
  54. data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
  55. data/app/lib/actions/katello/repository/import_upload.rb +4 -1
  56. data/app/lib/actions/katello/repository/multi_clone_contents.rb +8 -6
  57. data/app/lib/actions/katello/repository/remove_content.rb +1 -1
  58. data/app/lib/actions/katello/repository/sync.rb +3 -1
  59. data/app/lib/actions/katello/repository/update.rb +5 -1
  60. data/app/lib/actions/katello/repository/upload_files.rb +1 -0
  61. data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
  62. data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
  63. data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
  64. data/app/lib/actions/pulp3/abstract_async_task.rb +1 -0
  65. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
  66. data/app/lib/actions/pulp3/content_view_version/create_importer.rb +24 -0
  67. data/app/lib/actions/pulp3/content_view_version/destroy_importer.rb +16 -0
  68. data/app/lib/actions/pulp3/content_view_version/export.rb +6 -1
  69. data/app/lib/actions/pulp3/content_view_version/import.rb +25 -0
  70. data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +25 -0
  71. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +40 -10
  72. data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +47 -0
  73. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
  74. data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
  75. data/app/lib/actions/pulp3/repository/copy_content.rb +6 -1
  76. data/app/lib/actions/pulp3/repository/multi_copy_content.rb +1 -1
  77. data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
  78. data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
  79. data/app/lib/katello/resources/candlepin/owner.rb +5 -0
  80. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
  81. data/app/lib/katello/resources/cdn.rb +3 -2
  82. data/app/lib/katello/resources/registry.rb +3 -3
  83. data/app/lib/katello/util/cdn_var_substitutor.rb +9 -7
  84. data/app/models/katello/authorization/activation_key.rb +4 -0
  85. data/app/models/katello/authorization/content_view.rb +13 -0
  86. data/app/models/katello/authorization/content_view_component.rb +15 -0
  87. data/app/models/katello/authorization/content_view_filter.rb +15 -0
  88. data/app/models/katello/authorization/gpg_key.rb +12 -4
  89. data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
  90. data/app/models/katello/authorization/sync_plan.rb +16 -0
  91. data/app/models/katello/concerns/organization_extensions.rb +4 -5
  92. data/app/models/katello/concerns/smart_proxy_extensions.rb +2 -0
  93. data/app/models/katello/content_view.rb +30 -3
  94. data/app/models/katello/content_view_component.rb +2 -0
  95. data/app/models/katello/content_view_filter.rb +5 -0
  96. data/app/models/katello/content_view_puppet_module.rb +8 -0
  97. data/app/models/katello/content_view_repository.rb +13 -1
  98. data/app/models/katello/content_view_version.rb +10 -1
  99. data/app/models/katello/content_view_version_export_history.rb +2 -0
  100. data/app/models/katello/glue/candlepin/pool.rb +9 -14
  101. data/app/models/katello/glue/pulp/repo.rb +9 -1
  102. data/app/models/katello/gpg_key.rb +1 -1
  103. data/app/models/katello/ping.rb +8 -3
  104. data/app/models/katello/repository.rb +26 -0
  105. data/app/models/katello/root_repository.rb +31 -2
  106. data/app/models/katello/smart_proxy_sync_history.rb +8 -0
  107. data/app/overrides/add_organization_attributes.rb +12 -0
  108. data/app/services/katello/candlepin/event_handler.rb +2 -0
  109. data/app/services/katello/candlepin/message_handler.rb +34 -0
  110. data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
  111. data/app/services/katello/host_status_manager.rb +9 -0
  112. data/app/services/katello/host_trace_manager.rb +38 -0
  113. data/app/services/katello/pulp3/api/apt.rb +57 -0
  114. data/app/services/katello/pulp3/api/core.rb +8 -0
  115. data/app/services/katello/pulp3/content_view_version/export.rb +87 -32
  116. data/app/services/katello/pulp3/content_view_version/import.rb +52 -0
  117. data/app/services/katello/pulp3/content_view_version/import_export_common.rb +50 -0
  118. data/app/services/katello/pulp3/content_view_version/import_validator.rb +107 -0
  119. data/app/services/katello/pulp3/deb.rb +38 -0
  120. data/app/services/katello/pulp3/migration.rb +8 -2
  121. data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
  122. data/app/services/katello/pulp3/repository.rb +7 -1
  123. data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
  124. data/app/services/katello/pulp3/repository/apt.rb +63 -0
  125. data/app/services/katello/pulp3/repository/docker.rb +4 -0
  126. data/app/services/katello/pulp3/repository/yum.rb +71 -4
  127. data/app/services/katello/pulp3/repository_mirror.rb +9 -4
  128. data/app/services/katello/pulp3/task.rb +4 -4
  129. data/app/services/katello/pulp3/task_group.rb +6 -0
  130. data/app/services/katello/repository_type.rb +2 -1
  131. data/app/services/katello/smart_proxy_helper.rb +9 -0
  132. data/app/services/katello/ui_notifications/subscriptions/sca_disable_error.rb +13 -0
  133. data/app/services/katello/ui_notifications/subscriptions/sca_disable_success.rb +13 -0
  134. data/app/services/katello/ui_notifications/subscriptions/sca_enable_error.rb +13 -0
  135. data/app/services/katello/ui_notifications/subscriptions/sca_enable_success.rb +13 -0
  136. data/app/views/dashboard/_subscription_widget.html.erb +0 -5
  137. data/app/views/foreman/hosts/_registration.html.erb +12 -0
  138. data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
  139. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  140. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  141. data/app/views/overrides/organizations/_edit_override.html.erb +10 -1
  142. data/app/views/overrides/organizations/_index_header_override.html.erb +3 -0
  143. data/app/views/overrides/organizations/_index_row_override.html.erb +3 -0
  144. data/config/routes/api/v2.rb +3 -6
  145. data/config/routes/overrides.rb +5 -0
  146. data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
  147. data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
  148. data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
  149. data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
  150. data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
  151. data/db/seeds.d/109-katello-notification-blueprints.rb +24 -0
  152. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  153. data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
  154. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
  155. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +2 -5
  156. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +4 -3
  157. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +2 -4
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-repository-sets.html +1 -1
  159. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
  160. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +3 -4
  161. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +2 -4
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +4 -3
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +2 -4
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +1 -1
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +3 -1
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +15 -13
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +18 -3
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +17 -5
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
  190. data/lib/katello/engine.rb +2 -0
  191. data/lib/katello/permission_creator.rb +78 -69
  192. data/lib/katello/permissions/host_permissions.rb +2 -0
  193. data/lib/katello/plugin.rb +10 -2
  194. data/lib/katello/repository_types/deb.rb +9 -1
  195. data/lib/katello/tasks/pulp3_migration_abort.rake +17 -0
  196. data/lib/katello/tasks/pulp3_migration_stats.rake +21 -0
  197. data/lib/katello/tasks/pulp3_post_migration_check.rake +2 -1
  198. data/lib/katello/tasks/reimport.rake +1 -1
  199. data/lib/katello/tasks/reset.rake +2 -1
  200. data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
  201. data/lib/katello/version.rb +1 -1
  202. data/locale/action_names.rb +54 -47
  203. data/locale/bn/katello.po +165 -26
  204. data/locale/cs/katello.po +164 -24
  205. data/locale/de/katello.po +165 -26
  206. data/locale/en/katello.po +164 -23
  207. data/locale/es/katello.po +165 -25
  208. data/locale/fr/katello.po +165 -25
  209. data/locale/gu/katello.po +165 -26
  210. data/locale/hi/katello.po +165 -26
  211. data/locale/it/katello.po +165 -25
  212. data/locale/ja/katello.po +165 -26
  213. data/locale/katello.pot +1036 -802
  214. data/locale/kn/katello.po +165 -26
  215. data/locale/ko/katello.po +165 -25
  216. data/locale/mr/katello.po +165 -26
  217. data/locale/or/katello.po +165 -26
  218. data/locale/pa/katello.po +165 -26
  219. data/locale/pt/katello.po +164 -23
  220. data/locale/pt_BR/katello.po +165 -25
  221. data/locale/ru/katello.po +165 -25
  222. data/locale/ta/katello.po +165 -26
  223. data/locale/te/katello.po +165 -26
  224. data/locale/zh_CN/katello.po +165 -25
  225. data/locale/zh_TW/katello.po +165 -26
  226. data/webpack/components/ActionableDetail.js +2 -1
  227. data/webpack/components/Search/Search.js +1 -1
  228. data/webpack/components/Table/MainTable.js +6 -2
  229. data/webpack/components/Table/TableWrapper.js +46 -9
  230. data/webpack/index.js +0 -1
  231. data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
  232. data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
  233. data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
  234. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
  235. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
  236. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  237. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
  238. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
  239. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
  240. data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
  241. data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
  242. data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
  243. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
  244. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
  245. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
  246. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
  247. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
  248. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
  249. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
  250. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
  251. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
  252. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
  253. data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
  254. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
  255. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
  256. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
  257. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  258. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
  259. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
  260. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
  261. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
  262. data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
  263. metadata +87 -15
  264. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces-resolve.factory.js +0 -18
  265. 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: 3c7f446fd8f4d3af288f0bbbf1f5b56bdac0f903d0c55fc332221d2cf2830384
4
- data.tar.gz: 621fc49c5e82b6698a805c7a9b29143bad8b4b17690b94cd6cae3a65de1f33d9
3
+ metadata.gz: 31984263518369ed740c74cc962e0a3726d173f56f39beeff760737391520ba5
4
+ data.tar.gz: 87110c33c153b8dbb60062382e4afbe36e72ce826b4655fc64bdce3adf639e2f
5
5
  SHA512:
6
- metadata.gz: e88e27186ae85ae6787743e2295b1076e9b6af862a531fc6aec29de59c18a378aa377725b0f7687594fcb8e9d891e6dc3d19e03f26aed3f1e9009eb03c03877d
7
- data.tar.gz: 71d88ce6981546419a0f01f22a634727fdf36e11d164b69366aeabf00eb8ac1490935123c66e0733896ffc158b68b62d61817e4f03329f29cf6873fd1075da58
6
+ metadata.gz: e34e20b1885f1e552101ed27f9a002844ef460213fe6f0b57efb507bae174a84fd1dc04c6b9bd9caac5af2a81c88e60dddd7e135c236e5f8a4bd3b022620596c
7
+ data.tar.gz: f33c6fd1f711801f238631c3eda95c5d3c2c2305b5f1a6c4de8c15226d5c6cf717e2827a5552723b2d84edf427ee890c7c933c4d8d632686b5e68a2ba5dba230
@@ -166,25 +166,27 @@ module Katello
166
166
  headers[header[0].split('_')[1..-1].join('-')] = header[1]
167
167
  end
168
168
 
169
- r = Resources::Registry::Proxy.get(@_request.fullpath, headers)
170
- logger.debug filter_sensitive_data(r)
171
- results = JSON.parse(r)
172
-
173
- response.header['Docker-Content-Digest'] = "sha256:#{Digest::SHA256.hexdigest(r)}"
174
- # https://docs.docker.com/registry/spec/manifest-v2-2/
175
- # If its v2 schema 2 only the mediaType attribute will be present in the manifest
176
- media_type = results['mediaType']
177
- if media_type.blank?
178
- # so mediaType is not schema2 v2 only set the mediaType based on
179
- # https://docs.docker.com/registry/spec/manifest-v2-1/
180
- media_type = if results["signatures"].blank?
181
- 'application/vnd.docker.distribution.manifest.v1+json'
182
- else
183
- 'application/vnd.docker.distribution.manifest.v1+prettyjws'
184
- end
185
- end
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
- render json: r, content_type: media_type
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
- r = Resources::Registry::Proxy.get(@_request.fullpath, headers)
206
- render json: r
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
- return true if SETTINGS.dig(:katello, :container_image_registry)
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], request.raw_post)
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 :find_activation_key, :only => [:show, :update, :destroy, :available_releases, :copy, :product_content,
11
- :available_host_collections, :add_host_collections, :remove_host_collections,
12
- :content_override, :add_subscriptions, :remove_subscriptions,
13
- :subscriptions]
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.find(environment_id)
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
@@ -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 :find_content_credential, :only => [:show, :update, :destroy, :content, :set_content]
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
@@ -1,7 +1,8 @@
1
1
  module Katello
2
2
  class Api::V2::ContentViewComponentsController < Api::V2::ApiController
3
- before_action :find_composite_content_view
4
- before_action :find_content_view_component, :only => [:show, :update]
3
+ before_action :find_composite_content_view, :only => [:show, :index]
4
+ before_action :find_composite_content_view_for_edit, :only => [:add_components, :remove_components, :update]
5
+ before_action :find_authorized_katello_resource, :only => [:show, :update]
5
6
 
6
7
  wrap_parameters :include => %w(composite_content_view_id content_view_version_id content_view_id latest)
7
8
 
@@ -13,7 +14,7 @@ module Katello
13
14
  end
14
15
 
15
16
  def index_response
16
- results = @view.content_view_components
17
+ results = @view.content_view_components.readable
17
18
  {
18
19
  :results => results.uniq,
19
20
  :subtotal => results.count,
@@ -31,15 +32,26 @@ module Katello
31
32
  param :latest, :bool, :desc => N_("true if the latest version of the component's content view is desired")
32
33
  end
33
34
  def add_components
35
+ @view.add_components(authorized_components)
36
+ @view.save!
37
+ respond_for_index(:collection => index_response, :template => "index")
38
+ end
39
+
40
+ private def authorized_components
34
41
  components = params.require(:components).map do |component|
35
42
  component = component.permit([:latest, :content_view_version_id, :content_view_id])
36
43
  options = {}
37
44
  options[:latest] = ::Foreman::Cast.to_bool(component[:latest]) if component.key?(:latest)
38
- options.merge(component.slice(:content_view_version_id, :content_view_id))
45
+ options.merge(component.slice(:content_view_version_id, :content_view_id)).with_indifferent_access
46
+ end
47
+
48
+ components.each do |component|
49
+ if component[:content_view_version_id] && Katello::ContentViewVersion.readable.find_by(id: component[:content_view_version_id]).nil?
50
+ throw_resource_not_found(name: 'content_view_version', id: component[:content_view_version_id])
51
+ elsif component[:content_view_id] && Katello::ContentView.readable.find_by(id: component[:content_view_id]).nil?
52
+ throw_resource_not_found(name: 'content_view', id: component[:content_view_id])
53
+ end
39
54
  end
40
- @view.add_components(components)
41
- @view.save!
42
- respond_for_index(:collection => index_response, :template => "index")
43
55
  end
44
56
 
45
57
  api :PUT, "/content_views/:composite_content_view_id/content_view_components/remove",
@@ -56,7 +68,7 @@ module Katello
56
68
  param :composite_content_view_id, :number, :desc => N_("composite content view numeric identifier"), :required => true
57
69
  param :id, :number, :desc => N_("content view component ID. Identifier of the component association"), :required => true
58
70
  def show
59
- respond :resource => @component
71
+ respond :resource => @content_view_component
60
72
  end
61
73
 
62
74
  api :PUT, "/content_views/:composite_content_view_id/content_view_components/:id",
@@ -67,6 +79,9 @@ module Katello
67
79
  param :latest, :bool, :desc => N_("true if the latest version of the components content view is desired")
68
80
  def update
69
81
  cvv_id = component_params[:content_view_version_id]
82
+ if cvv_id && Katello::ContentViewVersion.readable.find_by(id: cvv_id).nil?
83
+ throw_resource_not_found(name: 'content view version', id: cvv_id)
84
+ end
70
85
  if component_params.key?(:latest) && component_params.key?(:content_view_version_id)
71
86
  latest = ::Foreman::Cast.to_bool(component_params[:latest])
72
87
  if latest && cvv_id.present?
@@ -75,22 +90,24 @@ module Katello
75
90
  end
76
91
  end
77
92
  if cvv_id.present?
78
- @component.update!(:content_view_version_id => cvv_id, :latest => false)
93
+ @content_view_component.update!(:content_view_version_id => cvv_id, :latest => false)
79
94
  elsif component_params.key?(:latest)
80
95
  latest = ::Foreman::Cast.to_bool(component_params[:latest])
81
- @component.update!(:content_view_version_id => nil, :latest => latest)
96
+ @content_view_component.update!(:content_view_version_id => nil, :latest => latest)
82
97
  end
83
- respond :resource => @component
98
+ respond :resource => @content_view_component
84
99
  end
85
100
 
86
101
  private
87
102
 
88
103
  def find_composite_content_view
89
- @view = ContentView.composite.non_default.find(params[:composite_content_view_id])
104
+ @view = ContentView.composite.non_default.readable.find_by(id: params[:composite_content_view_id])
105
+ throw_resource_not_found(name: 'composite content view', id: params[:composite_content_view_id]) if @view.nil?
90
106
  end
91
107
 
92
- def find_content_view_component
93
- @component = ContentViewComponent.find(params[:id])
108
+ def find_composite_content_view_for_edit
109
+ @view = ContentView.composite.non_default.editable.find_by(id: params[:composite_content_view_id])
110
+ throw_resource_not_found(name: 'composite content view', id: params[:composite_content_view_id]) if @view.nil?
94
111
  end
95
112
 
96
113
  def component_params
@@ -2,9 +2,9 @@ module Katello
2
2
  class Api::V2::ContentViewFiltersController < Api::V2::ApiController
3
3
  include Katello::Concerns::FilteredAutoCompleteSearch
4
4
 
5
- before_action :find_content_view
5
+ before_action :find_editable_content_view, :only => [:create, :update, :destroy]
6
+ before_action :find_readable_content_view, :only => [:show, :index, :auto_complete_search]
6
7
  before_action :find_filter, :except => [:index, :create, :auto_complete_search]
7
-
8
8
  wrap_parameters :include => (ContentViewFilter.attribute_names + %w(repository_ids))
9
9
 
10
10
  api :get, "/content_views/:content_view_id/filters", N_("list filters")
@@ -73,7 +73,7 @@ module Katello
73
73
  respond :resource => @filter
74
74
  end
75
75
 
76
- api :delete, "/content_views/:content_view_id/filters/:id", N_("delete a filter")
76
+ api :delefind_filterte, "/content_views/:content_view_id/filters/:id", N_("delete a filter")
77
77
  api :delete, "/content_view_filters/:id", N_("delete a filter")
78
78
  param :content_view_id, :number, :desc => N_("content view identifier")
79
79
  param :id, :number, :desc => N_("filter identifier"), :required => true
@@ -84,18 +84,27 @@ module Katello
84
84
 
85
85
  private
86
86
 
87
- def find_content_view
88
- @view = ContentView.find(params[:content_view_id]) if params[:content_view_id]
87
+ def find_readable_content_view
88
+ @view = ContentView.readable.find_by(id: params[:content_view_id]) if params[:content_view_id]
89
+ throw_resource_not_found(name: 'content view', id: params[:content_view_id]) if params[:content_view_id] && @view.nil?
90
+ end
91
+
92
+ def find_editable_content_view
93
+ @view = ContentView.editable.find_by(id: params[:content_view_id]) if params[:content_view_id]
94
+ throw_resource_not_found(name: 'content view', id: params[:content_view_id]) if params[:content_view_id] && @view.nil?
89
95
  end
90
96
 
91
97
  def find_filter
92
98
  if @view
93
99
  @filter = @view.filters.find_by(:id => params[:id])
94
- fail HttpErrors::NotFound, _("Couldn't find ContentViewFilter with id=%s") % params[:id] unless @filter
100
+ elsif params[:action] == 'show'
101
+ @filter = ContentViewFilter.readable.find_by(id: params[:id])
102
+ @view = @filter&.content_view
95
103
  else
96
- @filter = ContentViewFilter.find(params[:id])
97
- @view = @filter.content_view
104
+ @filter = ContentViewFilter.editable.find_by(id: params[:id])
105
+ @view = @filter&.content_view
98
106
  end
107
+ fail HttpErrors::NotFound, _("Couldn't find ContentViewFilter with id=%s") % params[:id] unless @filter
99
108
  end
100
109
 
101
110
  def filter_params
@@ -25,6 +25,7 @@ module Katello
25
25
  SQL
26
26
 
27
27
  query = Katello::Repository.readable.in_default_view.in_organization(@organization)
28
+ query = query.with_type(params[:content_type]) if params[:content_type]
28
29
  # Use custom sort to perform the join and order since we need to order by specific content_view
29
30
  # and the ORDER BY query needs access to the katello_content_view_repositories table
30
31
  custom_sort = ->(sort_query) { sort_query.joins(:root).joins(join_query).order(order_query) }
@@ -1,4 +1,5 @@
1
1
  module Katello
2
+ # rubocop:disable Metrics/ClassLength
2
3
  class Api::V2::ContentViewVersionsController < Api::V2::ApiController
3
4
  include Concerns::Api::V2::BulkHostsExtensions
4
5
  include Katello::Concerns::FilteredAutoCompleteSearch
@@ -99,47 +100,34 @@ module Katello
99
100
  :template => '../../../api/v2/content_view_version_export_histories/index')
100
101
  end
101
102
 
102
- api :POST, "/content_view_versions/:id/export", N_("Export a content view version"), :deprecated => true
103
+ api :GET, "/content_view_versions/export_api_status", N_("true if the export api is pulp3 ready and usable. This API is intended for use by hammer-cli only.")
104
+ def export_api_status
105
+ ::Foreman::Deprecation.api_deprecation_warning("export_api_status is being deprecated and will be removed in a future version of Katello.")
106
+ render json: { api_usable: SmartProxy.pulp_primary.pulp3_repository_type_support?(Katello::Repository::YUM_TYPE) }, status: :ok
107
+ end
108
+
109
+ api :POST, "/content_view_versions/:id/export", N_("Export a content view version")
103
110
  param :id, :number, :desc => N_("Content view version identifier"), :required => true
104
111
  param :destination_server, String, :desc => N_("Destination Server name, required for Pulp3")
112
+ param :chunk_size_mb, :number, :desc => N_("Chunk export-tarfile into pieces of chunk_size mega bytes. Relevant only for Pulp 3 repositories"), :required => false
105
113
  param :export_to_iso, :bool, :desc => N_("Export to ISO format. Relevant only for Pulp 2 repositories"), :required => false
106
114
  param :iso_mb_size, :number, :desc => N_("maximum size of each ISO in MB. Relevant only for Pulp 2 repositories"), :required => false
107
115
  param :since, Date, :desc => N_("Optional date of last export (ex: 2010-01-01T12:00:00Z). Relevant only for Pulp 2 repositories"), :required => false
108
116
  def export
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
114
-
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
125
-
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
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])
141
- end
117
+ task = if SmartProxy.pulp_primary.pulp3_repository_type_support?(Katello::Repository::YUM_TYPE)
118
+ export_pulp_v3
119
+ else
120
+ export_pulp_v2
121
+ end
122
+ respond_for_async :resource => task
123
+ end
142
124
 
125
+ api :POST, "/content_view_versions/import", N_("Import a content view version")
126
+ param :content_view_id, :number, :desc => N_("Content view identifier"), :required => true
127
+ param :path, String, :desc => N_("Directory containing the exported Content View Version"), :required => true
128
+ param :metadata, Hash, :desc => N_("Metadata taken from the upstream export history for this Content View Version"), :required => true
129
+ def import
130
+ task = async_task(::Actions::Katello::ContentViewVersion::Import, @view, path: params[:path], metadata: metadata_params&.to_h)
143
131
  respond_for_async :resource => task
144
132
  end
145
133
 
@@ -333,5 +321,57 @@ module Katello
333
321
  return deny_access unless @version.content_view.deletable?
334
322
  true
335
323
  end
324
+
325
+ def export_pulp_v2
326
+ ::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.")
327
+ if params[:export_to_iso].blank? && params[:iso_mb_size].present?
328
+ fail HttpErrors::BadRequest, _("ISO export must be enabled when specifying ISO size")
329
+ end
330
+
331
+ if (repos = @version.content_view.on_demand_repositories).any?
332
+ fail HttpErrors::BadRequest, _("This content view has on demand repositories that cannot be exported: %{repos}" % {repos: repos.pluck(:label).join(", ")})
333
+ end
334
+
335
+ if params[:since].present?
336
+ begin
337
+ params[:since].to_datetime
338
+ rescue
339
+ raise HttpErrors::BadRequest, _("Invalid date provided.")
340
+ end
341
+ end
342
+ async_task(::Actions::Katello::ContentViewVersion::Export, @version,
343
+ ::Foreman::Cast.to_bool(params[:export_to_iso]),
344
+ params[:since].try(:to_datetime),
345
+ params[:iso_mb_size])
346
+ end
347
+
348
+ def export_pulp_v3
349
+ invalid_params = [:export_to_iso, :iso_mb_size, :since].reject { |param| params[param].blank? }
350
+ unless invalid_params.empty?
351
+ fail HttpErrors::BadRequest, _("Invalid parameters provided - %{params}. These are only relevant for Pulp 2 repositories" % { params: invalid_params.join(', ')})
352
+ end
353
+
354
+ if params[:destination_server].blank?
355
+ fail HttpErrors::BadRequest, _("Destination Server Name required for Pulp3 repositories")
356
+ end
357
+
358
+ history = ::Katello::ContentViewVersionExportHistory.find(params[:from_history_id]) unless params[:from_history_id].blank?
359
+
360
+ async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::Export, @version, destination_server: params[:destination_server],
361
+ chunk_size: params[:chunk_size_mb],
362
+ from_history: history)
363
+ end
364
+
365
+ def metadata_params
366
+ params.require(:metadata).permit(
367
+ :organization,
368
+ :content_view,
369
+ :repository_mapping,
370
+ :toc,
371
+ content_view_version: [:major, :minor]
372
+ ).tap do |nested|
373
+ nested[:repository_mapping] = params[:metadata].require(:repository_mapping).permit!
374
+ end
375
+ end
336
376
  end
337
377
  end