katello 3.13.4 → 3.14.0.rc1

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 (412) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +25 -16
  3. data/app/controllers/katello/api/v2/activation_keys_controller.rb +26 -21
  4. data/app/controllers/katello/api/v2/ansible_collections_controller.rb +6 -0
  5. data/app/controllers/katello/api/v2/content_uploads_controller.rb +8 -2
  6. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +8 -1
  7. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
  9. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -3
  10. data/app/controllers/katello/api/v2/katello_ping_controller.rb +24 -0
  11. data/app/controllers/katello/api/v2/module_streams_controller.rb +21 -0
  12. data/app/controllers/katello/api/v2/package_groups_controller.rb +5 -0
  13. data/app/controllers/katello/api/v2/packages_controller.rb +16 -0
  14. data/app/controllers/katello/api/v2/repositories_controller.rb +7 -4
  15. data/app/controllers/katello/api/v2/srpms_controller.rb +1 -1
  16. data/app/controllers/katello/api/v2/subscriptions_controller.rb +5 -1
  17. data/app/controllers/katello/api/v2/sync_plans_controller.rb +7 -5
  18. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +36 -5
  19. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +12 -0
  20. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +55 -0
  21. data/app/lib/actions/katello/capsule_content/sync.rb +13 -64
  22. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +40 -0
  23. data/app/lib/actions/katello/content_view/publish.rb +0 -3
  24. data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +1 -3
  25. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +21 -0
  26. data/app/lib/actions/katello/repository/create.rb +8 -0
  27. data/app/lib/actions/katello/repository/import_upload.rb +13 -12
  28. data/app/lib/actions/katello/repository/metadata_generate.rb +2 -2
  29. data/app/lib/actions/katello/repository/update.rb +9 -0
  30. data/app/lib/actions/katello/repository/upload_files.rb +4 -11
  31. data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -0
  32. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +16 -0
  33. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +25 -0
  34. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +34 -0
  35. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +35 -0
  36. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +15 -0
  37. data/app/lib/actions/{katello/capsule_content → pulp/orphan_cleanup}/remove_unneeded_repos.rb +2 -2
  38. data/app/lib/actions/pulp/repository/import_upload.rb +7 -11
  39. data/app/lib/actions/pulp3/abstract_async_task.rb +7 -7
  40. data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +32 -0
  41. data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +31 -0
  42. data/app/lib/actions/pulp3/capsule_content/sync.rb +26 -0
  43. data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +20 -0
  44. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +15 -15
  45. data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
  46. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +36 -0
  47. data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +24 -0
  48. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
  49. data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +25 -0
  50. data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +20 -0
  51. data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +16 -0
  52. data/app/lib/actions/pulp3/repository/create_publication.rb +1 -5
  53. data/app/lib/actions/pulp3/repository/import_upload.rb +21 -0
  54. data/app/lib/actions/pulp3/repository/save_artifact.rb +19 -0
  55. data/app/lib/actions/pulp3/repository/save_version.rb +3 -2
  56. data/app/lib/actions/pulp3/repository/sync.rb +1 -1
  57. data/app/lib/actions/pulp3/repository/upload_file.rb +76 -0
  58. data/app/lib/katello/api/v2/rendering.rb +1 -2
  59. data/app/lib/katello/concerns/base_template_scope_extensions.rb +34 -2
  60. data/app/lib/katello/errors.rb +21 -0
  61. data/app/lib/katello/resources/candlepin/consumer.rb +0 -9
  62. data/app/lib/katello/resources/candlepin/owner.rb +0 -5
  63. data/app/lib/katello/resources/candlepin/product.rb +2 -6
  64. data/app/lib/katello/resources/registry.rb +25 -10
  65. data/app/lib/katello/util/filter_clause_generator.rb +1 -1
  66. data/app/lib/katello/util/module_stream_clause_generator.rb +49 -0
  67. data/app/lib/katello/util/package_clause_generator.rb +1 -1
  68. data/app/models/katello/ansible_collection.rb +5 -8
  69. data/app/models/katello/ansible_collection_tag.rb +8 -0
  70. data/app/models/katello/ansible_tag.rb +8 -0
  71. data/app/models/katello/concerns/host_managed_extensions.rb +16 -14
  72. data/app/models/katello/concerns/pulp_database_unit.rb +27 -4
  73. data/app/models/katello/concerns/search_by_repository_name.rb +4 -1
  74. data/app/models/katello/concerns/smart_proxy_extensions.rb +44 -20
  75. data/app/models/katello/content_view_docker_filter.rb +15 -2
  76. data/app/models/katello/content_view_filter.rb +28 -8
  77. data/app/models/katello/content_view_module_stream_filter.rb +14 -0
  78. data/app/models/katello/content_view_module_stream_filter_rule.rb +11 -0
  79. data/app/models/katello/content_view_package_filter.rb +18 -8
  80. data/app/models/katello/content_view_version.rb +7 -2
  81. data/app/models/katello/deb.rb +0 -8
  82. data/app/models/katello/docker_manifest.rb +0 -8
  83. data/app/models/katello/docker_manifest_list.rb +0 -8
  84. data/app/models/katello/docker_meta_tag.rb +38 -20
  85. data/app/models/katello/docker_tag.rb +22 -33
  86. data/app/models/katello/erratum.rb +10 -8
  87. data/app/models/katello/file_unit.rb +1 -13
  88. data/app/models/katello/glue/candlepin/owner.rb +0 -5
  89. data/app/models/katello/glue/candlepin/product.rb +1 -5
  90. data/app/models/katello/glue/pulp/repo.rb +1 -1
  91. data/app/models/katello/host/content_facet.rb +6 -0
  92. data/app/models/katello/host_collection.rb +4 -0
  93. data/app/models/katello/installed_package.rb +4 -0
  94. data/app/models/katello/module_stream.rb +1 -12
  95. data/app/models/katello/ostree_branch.rb +0 -7
  96. data/app/models/katello/package_group.rb +0 -7
  97. data/app/models/katello/ping.rb +10 -3
  98. data/app/models/katello/pool.rb +11 -1
  99. data/app/models/katello/puppet_module.rb +0 -7
  100. data/app/models/katello/repository.rb +15 -6
  101. data/app/models/katello/repository_docker_meta_tag.rb +7 -0
  102. data/app/models/katello/repository_docker_tag.rb +7 -0
  103. data/app/models/katello/repository_file_unit.rb +7 -0
  104. data/app/models/katello/rhsm_fact_name.rb +5 -1
  105. data/app/models/katello/rhsm_fact_parser.rb +17 -1
  106. data/app/models/katello/root_repository.rb +11 -6
  107. data/app/models/katello/rpm.rb +0 -8
  108. data/app/models/katello/srpm.rb +0 -8
  109. data/app/models/katello/upstream_pool.rb +2 -0
  110. data/app/models/katello/yum_metadata_file.rb +0 -4
  111. data/app/models/setting/content.rb +124 -128
  112. data/app/services/katello/candlepin/consumer.rb +0 -1
  113. data/app/services/katello/pulp/content.rb +11 -4
  114. data/app/services/katello/pulp/docker_tag.rb +0 -1
  115. data/app/services/katello/pulp/pulp_content_unit.rb +4 -0
  116. data/app/services/katello/pulp/repository.rb +53 -0
  117. data/app/services/katello/pulp/repository/file.rb +1 -1
  118. data/app/services/katello/pulp/repository/puppet.rb +8 -1
  119. data/app/services/katello/pulp/repository/yum.rb +42 -9
  120. data/app/services/katello/pulp/smart_proxy_repository.rb +13 -96
  121. data/app/services/katello/pulp3/ansible_collection.rb +7 -3
  122. data/app/services/katello/pulp3/content.rb +60 -0
  123. data/app/services/katello/pulp3/docker_blob.rb +1 -1
  124. data/app/services/katello/pulp3/docker_manifest.rb +1 -1
  125. data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
  126. data/app/services/katello/pulp3/docker_tag.rb +2 -2
  127. data/app/services/katello/pulp3/file_unit.rb +7 -1
  128. data/app/services/katello/pulp3/pulp_content_unit.rb +15 -5
  129. data/app/services/katello/pulp3/repository.rb +301 -24
  130. data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
  131. data/app/services/katello/pulp3/repository/docker.rb +54 -9
  132. data/app/services/katello/pulp3/repository/file.rb +8 -0
  133. data/app/services/katello/pulp3/repository/yum.rb +61 -0
  134. data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -0
  135. data/app/services/katello/repository_type_manager.rb +7 -0
  136. data/app/services/katello/smart_proxy_helper.rb +50 -0
  137. data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
  138. data/app/views/katello/api/v2/ansible_collections/base.json.rabl +5 -0
  139. data/app/views/katello/api/v2/ansible_collections/show.json.rabl +7 -0
  140. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -0
  141. data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +1 -1
  142. data/app/views/katello/api/v2/content_view_filters/base.json.rabl +5 -0
  143. data/app/views/katello/api/v2/content_view_filters/show.json.rabl +2 -1
  144. data/app/views/katello/api/v2/hosts_bulk_actions/erratum.json.rabl +2 -0
  145. data/app/views/katello/api/v2/{ping → katello_ping}/server_status.json.rabl +0 -0
  146. data/app/views/katello/api/v2/{ping → katello_ping}/show.json.rabl +0 -0
  147. data/app/views/katello/api/v2/{ping → katello_ping}/version.json.rabl +0 -0
  148. data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
  149. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  150. data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
  151. data/app/views/katello/api/v2/subscriptions/permissions.rabl +11 -0
  152. data/config/katello.yaml.example +9 -0
  153. data/config/routes.rb +2 -1
  154. data/config/routes/api/v2.rb +2 -2
  155. data/db/migrate/20180920214134_create_repository_root.rb +1 -1
  156. data/db/migrate/20190730183518_add_docker_tag_join_table.rb +25 -0
  157. data/db/migrate/20190730203334_add_docker_meta_tag_join_table.rb +25 -0
  158. data/db/migrate/20190814025338_create_content_view_module_stream_filter_rules.rb +13 -0
  159. data/db/migrate/20190816162733_rename_ansible_collection_whitelist_to_requirements.rb +5 -0
  160. data/db/migrate/20190822144300_add_ansible_fields.rb +18 -0
  161. data/db/migrate/20190912210927_rename_repository_file_unit.rb +12 -0
  162. data/engines/bastion/README.md +2 -2
  163. data/engines/bastion/app/assets/javascripts/bastion/components/bst-edit.directive.js +2 -1
  164. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +20 -6
  165. data/engines/bastion/app/assets/javascripts/bastion/components/views/bst-modal.html +1 -1
  166. data/engines/bastion/app/assets/javascripts/bastion/layouts/partials/table.html +2 -1
  167. data/engines/bastion/app/assets/stylesheets/bastion/overrides.scss +1 -0
  168. data/engines/bastion/lib/bastion.rb +1 -0
  169. data/engines/bastion_katello/README.md +1 -2
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +1 -4
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.factory.js +28 -0
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.module.js +15 -0
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +4 -0
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -6
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-destroy-modal.html +3 -3
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +2 -34
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -1
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +6 -0
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -11
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -4
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +3 -1
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -3
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -5
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -4
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +4 -16
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +13 -0
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -13
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +47 -5
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-module-stream-filter.controller.js +68 -0
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +2 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-rule-matching-package-modal.controller.js +37 -0
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -1
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/module-stream-list-filter.controller.js +73 -0
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +4 -1
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +14 -1
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +3 -0
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-details.html +0 -2
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +5 -0
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-rule-matching-package-modal.html +43 -0
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +4 -0
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +41 -0
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter.html +43 -0
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +4 -0
  211. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +1 -1
  212. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +1 -1
  213. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +3 -3
  214. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +1 -2
  215. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -1
  216. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +3 -0
  217. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js +1 -1
  218. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +1 -1
  219. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +44 -35
  220. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
  221. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +12 -0
  222. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -3
  223. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +21 -3
  224. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ansible-collections.html +36 -0
  225. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/download-policy.service.js +1 -1
  226. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +24 -2
  227. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +29 -15
  228. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +9 -0
  229. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +1 -1
  230. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +8 -0
  231. data/engines/bastion_katello/lib/bastion_katello/engine.rb +8 -8
  232. data/lib/katello/engine.rb +0 -4
  233. data/lib/katello/plugin.rb +19 -1
  234. data/lib/katello/repository_types/yum.rb +2 -0
  235. data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
  236. data/lib/katello/tasks/reimport.rake +1 -1
  237. data/lib/katello/version.rb +1 -1
  238. data/package.json +9 -5
  239. data/webpack/__mocks__/foremanReact/common/helpers.js +4 -1
  240. data/webpack/__mocks__/foremanReact/components/PermissionDenied/index.js +2 -0
  241. data/webpack/components/Content/ContentPage.js +55 -0
  242. data/webpack/{scenes/ModuleStreams/ModuleStreamsTable.js → components/Content/ContentTable.js} +9 -8
  243. data/webpack/components/Content/Details/ContentDetailInfo.js +33 -0
  244. data/webpack/{scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js → components/Content/Details/ContentDetailRepositories.js} +4 -4
  245. data/webpack/{scenes/ModuleStreams/Details/Repositories/TableSchema.js → components/Content/Details/ContentDetailRepositoryTableSchema.js} +1 -1
  246. data/webpack/components/Content/Details/ContentDetails.js +70 -0
  247. data/webpack/components/Content/Details/__tests__/ContentDetailInfo.test.js +28 -0
  248. data/webpack/components/Content/Details/__tests__/ContentDetailRepositories.test.js +22 -0
  249. data/webpack/components/Content/Details/__tests__/ContentDetails.test.js +64 -0
  250. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap +39 -0
  251. data/webpack/{scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap → components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap} +3 -9
  252. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +137 -0
  253. data/webpack/components/Content/__tests__/ContentPage.test.js +36 -0
  254. data/webpack/components/Content/__tests__/ContentTable.test.js +40 -0
  255. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +70 -0
  256. data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +33 -0
  257. data/webpack/components/Search/index.js +6 -7
  258. data/webpack/components/SelectOrg/SelectOrgAction.js +20 -22
  259. data/webpack/containers/Application/config.js +10 -0
  260. data/webpack/containers/Application/overrides.scss +5 -0
  261. data/webpack/move_to_foreman/common/helpers.js +1 -1
  262. data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +5 -2
  263. data/webpack/move_to_foreman/components/common/table/formatters/EntitlementsInlineEditFormatter.js +9 -2
  264. data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +2 -0
  265. data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +3 -0
  266. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +1 -0
  267. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +10 -10
  268. data/webpack/redux/actions/RedHatRepositories/__tests__/enabled.test.js +39 -0
  269. data/webpack/redux/actions/RedHatRepositories/enabled.js +24 -24
  270. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
  271. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +23 -22
  272. data/webpack/redux/actions/RedHatRepositories/sets.js +17 -21
  273. data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +1 -0
  274. data/webpack/redux/reducers/RedHatRepositories/__tests__/sets.test.js +1 -1
  275. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +1 -0
  276. data/webpack/redux/reducers/RedHatRepositories/enabled.js +42 -33
  277. data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +2 -1
  278. data/webpack/redux/reducers/RedHatRepositories/sets.js +2 -1
  279. data/webpack/redux/reducers/index.js +4 -0
  280. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +30 -0
  281. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsConstants.js +3 -0
  282. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsPage.js +80 -0
  283. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +39 -0
  284. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +60 -0
  285. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTables.scss +0 -0
  286. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetails.js +91 -0
  287. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +23 -0
  288. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsConstants.js +3 -0
  289. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +30 -0
  290. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionsSchema.js +35 -0
  291. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailInfo.test.js +16 -0
  292. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.fixtures.js +25 -0
  293. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +29 -0
  294. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +41 -0
  295. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsReducer.test.js +33 -0
  296. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailInfo.test.js.snap +83 -0
  297. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetails.test.js.snap +190 -0
  298. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsActions.test.js.snap +54 -0
  299. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsReducer.test.js.snap +50 -0
  300. data/webpack/scenes/AnsibleCollections/Details/index.js +17 -0
  301. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +25 -0
  302. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollections.fixtures.js +52 -0
  303. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsActions.test.js +48 -0
  304. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsReducer.test.js +46 -0
  305. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +27 -0
  306. data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionPage.test.js.snap +73 -0
  307. data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionsTable.test.js.snap +81 -0
  308. data/webpack/scenes/AnsibleCollections/index.js +17 -0
  309. data/webpack/scenes/ModuleStreams/Details/ModuleDetailsSchema.js +56 -0
  310. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +7 -71
  311. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +9 -11
  312. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +5 -3
  313. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +453 -507
  314. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +10 -11
  315. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +12 -33
  316. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -4
  317. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +8 -9
  318. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +5 -3
  319. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +83 -65
  320. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +1 -1
  321. data/webpack/scenes/Organizations/OrganizationActions.js +27 -32
  322. data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +12 -12
  323. data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +1 -1
  324. data/webpack/scenes/Products/ProductActions.js +10 -10
  325. data/webpack/scenes/Products/__tests__/ProductActions.test.js +6 -6
  326. data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +118 -0
  327. data/webpack/scenes/RedHatRepositories/__tests__/RedHatRepositoriesPage.test.js +51 -0
  328. data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +117 -0
  329. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +44 -45
  330. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/EnabledRepository.test.js +84 -5
  331. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +46 -47
  332. data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
  333. data/webpack/scenes/RedHatRepositories/index.js +2 -101
  334. data/webpack/scenes/Settings/Tables/TableActions.js +42 -43
  335. data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +18 -18
  336. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +10 -10
  337. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
  338. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +8 -8
  339. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
  340. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +142 -113
  341. data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +8 -0
  342. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +40 -40
  343. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +24 -24
  344. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -199
  345. data/webpack/scenes/Subscriptions/SubscriptionActions.js +52 -46
  346. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +21 -2
  347. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +64 -42
  348. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  349. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +21 -21
  350. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +20 -21
  351. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -15
  352. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +12 -13
  353. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -14
  354. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +21 -23
  355. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +35 -1
  356. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +13 -0
  357. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +7 -0
  358. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +18 -0
  359. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +5 -4
  360. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +26 -5
  361. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +9 -1
  362. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +27 -2
  363. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +5 -4
  364. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +1 -0
  365. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Dialogs/UpdateDialog.js +9 -9
  366. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +8 -3
  367. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -23
  368. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +0 -135
  369. data/webpack/scenes/Subscriptions/index.js +2 -0
  370. data/webpack/scenes/Tasks/TaskActions.js +36 -31
  371. data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +35 -47
  372. metadata +146 -67
  373. data/app/controllers/katello/api/v2/ping_controller.rb +0 -24
  374. data/app/lib/actions/katello/capsule_content/create_repos.rb +0 -30
  375. data/app/lib/actions/katello/capsule_content/remove_orphans.rb +0 -21
  376. data/app/lib/actions/pulp/repository/refresh_needed.rb +0 -37
  377. data/app/lib/katello/resources/candlepin/owner_info.rb +0 -18
  378. data/app/models/katello/glue/candlepin/owner_info.rb +0 -41
  379. data/app/models/katello/repository_file.rb +0 -7
  380. data/app/overrides/add_subscription_status.rb +0 -6
  381. data/app/views/overrides/hosts/_subscription_link.html.erb +0 -6
  382. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-events.controller.js +0 -17
  383. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +0 -30
  384. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
  385. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -58
  386. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-product-details.controller.js +0 -12
  387. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-products.controller.js +0 -30
  388. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -25
  389. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +0 -120
  390. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-products.html +0 -54
  391. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/grouped.filter.js +0 -21
  392. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-details.controller.js +0 -34
  393. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-history.controller.js +0 -18
  394. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +0 -261
  395. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest.controller.js +0 -16
  396. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +0 -19
  397. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +0 -46
  398. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +0 -17
  399. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -92
  400. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +0 -33
  401. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-start-date.directive.js +0 -21
  402. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-type.directive.js +0 -16
  403. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptionAttachAmountFilter.filter.js +0 -16
  404. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.controller.js +0 -73
  405. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +0 -110
  406. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -5
  407. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +0 -2
  408. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-type.html +0 -18
  409. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions-delete-bulk.html +0 -4
  410. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +0 -63
  411. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +0 -52
  412. data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f766a3017d31408f1d870da14183242e914597a31783a07257a5df741330e6d
4
- data.tar.gz: f0abe55e1bd1cf6148ae02eaa02ab068e49f6c3909af80624c9b578cb1f84a1f
3
+ metadata.gz: c1e2baddffe6d51af8dbaa2e187ada9d5be93c145a8b3bea3113b77f49592b14
4
+ data.tar.gz: 3b42136f2440dc5c12e17472bcaa112d21a2d9e4db649dcbfcaa8f6b847d6732
5
5
  SHA512:
6
- metadata.gz: 712836c8cd4ba4a476650ad3fd04f3e04be29be3cc615c5be137d289578048f98a06ae8e2a31f6653e082f198e865df87bc608864f98aa77a2e7ebcc0d95a667
7
- data.tar.gz: 0fbec392523232e91c577f7e0df9ca2080d60f828e8e9397d5c0ef6a4b2b5e7ad4d275a3a09ec92fa9c67b34a36e09305d1e57551e5c0af8d072aa00483a671b
6
+ metadata.gz: 179fe38f2b010e92ee61df9cec470142d2889ba0f03894eb7ac4ac4f4a96801f1e37106249dbdd3c851c2fdc7ed84b69ee001efa7f6e48c71d56c3618be1405b
7
+ data.tar.gz: e98d76db3da13831b995f31bc5e6332ac7942e3179e679fb95756b911d0509313e31d09922cc6242eb0889abf1cb78aec72079c2601f9d7746d839f1d34b5b9e
@@ -42,7 +42,7 @@ module Katello
42
42
 
43
43
  def optional_authorize
44
44
  @repository = find_scope_repository
45
- if @repository && @repository.environment.registry_unauthenticated_pull
45
+ if @repository && (@repository.environment.registry_unauthenticated_pull || ssl_client_authorized?(@repository.organization.label))
46
46
  true
47
47
  else
48
48
  authorize
@@ -51,7 +51,7 @@ module Katello
51
51
 
52
52
  def registry_authorize
53
53
  @repository = find_readable_repository
54
- return true if ['GET', 'HEAD'].include?(request.method) && @repository && @repository.environment.registry_unauthenticated_pull
54
+ return true if ['GET', 'HEAD'].include?(request.method) && @repository && !require_user_authorization?
55
55
 
56
56
  token = request.headers['Authorization']
57
57
  if token
@@ -79,10 +79,7 @@ module Katello
79
79
 
80
80
  def authorize_repository_write
81
81
  @repository = find_writable_repository
82
- unless @repository
83
- not_found params[:repository]
84
- return false
85
- end
82
+ return item_not_found(params[:repository]) unless @repository
86
83
  true
87
84
  end
88
85
 
@@ -102,26 +99,32 @@ module Katello
102
99
  def find_readable_repository
103
100
  return nil unless params[:repository]
104
101
  repository = Repository.docker_type.find_by(container_repository_name: params[:repository])
105
- if repository && !repository.environment.registry_unauthenticated_pull
102
+ if require_user_authorization?(repository)
106
103
  repository = readable_repositories.docker_type.find_by(container_repository_name: params[:repository])
107
104
  end
108
105
  repository
109
106
  end
110
107
 
108
+ def require_user_authorization?(repository = @repository)
109
+ !repository || (!repository.environment.registry_unauthenticated_pull && !ssl_client_authorized?(repository.organization.label))
110
+ end
111
+
112
+ def ssl_client_authorized?(org_label)
113
+ request.headers['HTTP_SSL_CLIENT_VERIFY'] == "SUCCESS" && request.headers['HTTP_SSL_CLIENT_S_DN'] == "O=#{org_label}"
114
+ end
115
+
111
116
  def authorize_repository_read
112
117
  @repository = find_readable_repository
113
- unless @repository
114
- not_found params[:repository]
115
- return false
116
- end
118
+ return item_not_found(params[:repository]) unless @repository
117
119
 
118
120
  if params[:tag]
119
121
  if params[:tag][0..6] == 'sha256:'
120
122
  manifest = Katello::DockerManifestList.where(digest: params[:tag]).first || Katello::DockerManifest.where(digest: params[:tag]).first
121
- not_found params[:tag] unless manifest
123
+ return item_not_found(params[:tag]) unless manifest
122
124
  else
123
- tag = DockerMetaTag.where(repository_id: @repository.id, name: params[:tag]).first
124
- not_found params[:tag] unless tag
125
+ tag = ::Katello::DockerMetaTag.where(id: ::Katello::RepositoryDockerMetaTag.
126
+ where(repository_id: @repository.id).select(:docker_meta_tag_id), name: params[:tag]).first
127
+ return item_not_found(params[:tag]) unless tag
125
128
  end
126
129
  end
127
130
 
@@ -129,7 +132,7 @@ module Katello
129
132
  end
130
133
 
131
134
  def token
132
- if @repository && @repository.environment.registry_unauthenticated_pull
135
+ if !require_user_authorization?
133
136
  personal_token = OpenStruct.new(token: 'unauthenticated', issued_at: Time.now, expires_at: Time.now + 3)
134
137
  else
135
138
  personal_token = PersonalAccessToken.where(user_id: User.current.id, name: 'registry').first
@@ -312,7 +315,7 @@ module Katello
312
315
  end
313
316
 
314
317
  def catalog
315
- repositories = readable_repositories.where(content_type: 'docker').collect do |repository|
318
+ repositories = readable_repositories.docker_type.collect do |repository|
316
319
  repository.container_repository_name
317
320
  end
318
321
  render json: { repositories: repositories }
@@ -487,5 +490,11 @@ module Katello
487
490
  ::Api::V2::BaseController.instance_method(:process_action).bind(self).call(method_name, *args)
488
491
  Rails.logger.debug "With body: #{response.body}\n" unless route_name == 'pull_blob'
489
492
  end
493
+
494
+ def item_not_found(item)
495
+ msg = "#{item} was not found!"
496
+ # returning errors based on registry specifications in https://docs.docker.com/registry/spec/api/#errors
497
+ render json: {errors: [code: :invalid_request, message: msg, details: msg]}, status: :not_found
498
+ end
490
499
  end
491
500
  end
@@ -37,6 +37,9 @@ module Katello
37
37
  param :content_view_id, :number, :desc => N_("content view id")
38
38
  param :max_hosts, :number, :desc => N_("maximum number of registered content hosts")
39
39
  param :unlimited_hosts, :bool, :desc => N_("can the activation key have unlimited hosts")
40
+ param :release_version, String, :desc => N_("content release version")
41
+ param :service_level, String, :desc => N_("service level")
42
+ param :auto_attach, :bool, :desc => N_("auto attach subscriptions upon registration")
40
43
  param :purpose_usage, String, :desc => N_("Sets the system purpose usage")
41
44
  param :purpose_role, String, :desc => N_("Sets the system purpose usage")
42
45
  param :purpose_addons, Array, :desc => N_("Sets the system add-ons")
@@ -48,6 +51,13 @@ module Katello
48
51
  end
49
52
  sync_task(::Actions::Katello::ActivationKey::Create, @activation_key)
50
53
  @activation_key.reload
54
+
55
+ sync_task(::Actions::Katello::ActivationKey::Update, @activation_key,
56
+ :service_level => activation_key_params[:service_level],
57
+ :release_version => activation_key_params[:release_version],
58
+ :auto_attach => activation_key_params[:auto_attach]
59
+ )
60
+
51
61
  respond_for_create(:resource => @activation_key)
52
62
  end
53
63
 
@@ -213,36 +223,31 @@ module Katello
213
223
 
214
224
  api :PUT, "/activation_keys/:id/content_override", N_("Override content for activation_key")
215
225
  param :id, :number, :desc => N_("ID of the activation key"), :required => true
216
- param :content_override, Hash, :desc => N_("Content override parameters"), :deprecated => true do
217
- param :content_label, String, :desc => N_("Label of the content"), :required => true
218
- param :value, String, :desc => N_("Override to a boolean value or 'default'"), :required => true
219
- end
220
- param :content_overrides, Array, :desc => N_("Array of Content override parameters") do
226
+ param :content_overrides, Array, :desc => N_("Array of Content override parameters to be added in bulk") do
221
227
  param :content_label, String, :desc => N_("Label of the content"), :required => true
222
228
  param :value, String, :desc => N_("Override value. Provide a boolean value if name is 'enabled'"), :required => false
223
229
  param :name, String, :desc => N_("Override parameter key or name. Note if name is not provided the default name will be 'enabled'"), :required => false
224
230
  param :remove, :bool, :desc => N_("Set true to remove an override and reset it to 'default'"), :required => false
225
231
  end
226
232
  def content_override
227
- content_overrides = []
228
- if params[:content_override]
229
- ::Foreman::Deprecation.api_deprecation_warning("The parameter content_override will be removed in Katello 3.5. Please update to use the content_overrides parameter.")
230
- content_override_params = {:content_label => params[:content_override][:content_label]}
231
- value = params[:content_override][:value]
232
- if value == "default"
233
- content_override_params[:remove] = true
234
- elsif value
235
- content_override_params[:value] = ::Foreman::Cast.to_bool(value)
233
+ if params[:content_overrides]
234
+ organization = @activation_key.organization
235
+ specified_labels = []
236
+ content_override_values = params[:content_overrides].map do |override|
237
+ specified_labels << override[:content_label]
238
+ validate_content_overrides_enabled(override)
239
+ end
240
+ specified_labels.uniq!
241
+ existing_labels = organization.contents.where(label: specified_labels).uniq
242
+
243
+ unless specified_labels.size == existing_labels.size
244
+ missing_labels = specified_labels - existing_labels.pluck(:label)
245
+ msg = "Content label(s) \"#{missing_labels.join(", ")}\" were not found in the Organization \"#{organization}\""
246
+ fail HttpErrors::BadRequest, _(msg)
236
247
  end
237
- content_overrides << content_override_params
238
- elsif params[:content_overrides]
239
- content_overrides = params[:content_overrides]
240
- end
241
248
 
242
- content_override_values = content_overrides.map do |override_params|
243
- validate_content_overrides_enabled(override_params)
249
+ @activation_key.set_content_overrides(content_override_values)
244
250
  end
245
- @activation_key.set_content_overrides(content_override_values)
246
251
  respond_for_show(:resource => @activation_key)
247
252
  end
248
253
 
@@ -6,6 +6,12 @@ module Katello
6
6
  apipie_concern_subst(:a_resource => N_("an ansible collection"), :resource_id => "ansible_collections")
7
7
  include Katello::Concerns::Api::V2::RepositoryContentController
8
8
 
9
+ def index
10
+ sort_by, sort_order, options = sort_options
11
+ options[:includes] = [:tags]
12
+ respond(:collection => scoped_search(index_relation, sort_by, sort_order, options))
13
+ end
14
+
9
15
  def default_sort
10
16
  %w(name asc)
11
17
  end
@@ -8,18 +8,24 @@ module Katello
8
8
 
9
9
  api :POST, "/repositories/:repository_id/content_uploads", N_("Create an upload request")
10
10
  param :repository_id, :number, :required => true, :desc => N_("repository id")
11
+ param :size, :number, :required => true, :desc => N_("Size of file to upload")
12
+ param :checksum, String, :required => false, :desc => N_("Checksum of file to upload")
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')")
11
14
  def create
12
- render :json => @repository.backend_content_service(::SmartProxy.pulp_master).create_upload
15
+ content_type = params[:content_type] || ::Katello::RepositoryTypeManager.find(@repository.content_type).default_managed_content_type.label
16
+ unit_type_id = SmartProxy.pulp_master.content_service(content_type).content_type
17
+ render :json => @repository.backend_content_service(::SmartProxy.pulp_master).create_upload(params[:size], params[:checksum], unit_type_id)
13
18
  end
14
19
 
15
20
  api :PUT, "/repositories/:repository_id/content_uploads/:id", N_("Upload a chunk of the file's content")
16
21
  param :repository_id, :number, :required => true, :desc => N_("Repository id")
17
22
  param :id, String, :required => true, :desc => N_("Upload request id")
23
+ param :size, :number, :required => true, :desc => N_("Size of file to upload")
18
24
  param :offset, :number, :required => true, :desc => N_("The offset in the file where the content starts")
19
25
  param :content, File, :required => true, :desc => N_("The actual file contents")
20
26
  def update
21
27
  @repository.backend_content_service(::SmartProxy.pulp_master)
22
- .upload_chunk(params[:id], params[:offset], params[:content])
28
+ .upload_chunk(params[:id], params[:offset], params[:content], params[:size])
23
29
  head :no_content
24
30
  end
25
31
 
@@ -34,6 +34,7 @@ module Katello
34
34
  param :end_date, String, :desc => N_("erratum: end date (YYYY-MM-DD)")
35
35
  param :types, Array, :desc => N_("erratum: types (enhancement, bugfix, security)")
36
36
  param :date_type, String, :desc => N_("erratum: search using the 'Issued On' or 'Updated On' column of the errata. Values are 'issued'/'updated'")
37
+ param :module_stream_ids, Array, :desc => N_("module stream ids")
37
38
  def create
38
39
  rule_clazz = ContentViewFilter.rule_class_for(@filter)
39
40
 
@@ -45,6 +46,12 @@ module Katello
45
46
  rule_clazz.create!(rule_params.except(:errata_ids)
46
47
  .merge(filter: @filter, errata_id: errata_id))
47
48
  end
49
+ if rule_params[:module_stream_ids]
50
+ rules += (rule_params[:module_stream_ids] || []).map do |module_stream_id|
51
+ rule_clazz.create!(rule_params.except(:module_stream_ids)
52
+ .merge(filter: @filter, module_stream_id: module_stream_id))
53
+ end
54
+ end
48
55
 
49
56
  if rules.empty?
50
57
  rules = [rule_clazz.create!(rule_params.merge(:filter => @filter))]
@@ -125,7 +132,7 @@ module Katello
125
132
  @rule_params ||= params.fetch(:content_view_filter_rule, {}).
126
133
  permit(:uuid, :version, :min_version, :max_version, :architecture,
127
134
  :errata_id, :start_date, :end_date, :date_type,
128
- :types => [], :errata_ids => [], name: [])
135
+ :types => [], :module_stream_ids => [], :errata_ids => [], name: [])
129
136
  end
130
137
 
131
138
  def process_errata_ids(select_all_params)
@@ -34,7 +34,7 @@ module Katello
34
34
  api :post, "/content_view_filters", N_("create a filter for a content view")
35
35
  param :content_view_id, :number, :desc => N_("content view identifier"), :required => true
36
36
  param :name, String, :desc => N_("name of the filter"), :required => true
37
- param :type, String, :desc => N_("type of filter (e.g. rpm, package_group, erratum, docker)"), :required => true
37
+ param :type, String, :desc => N_("type of filter (e.g. rpm, package_group, erratum, docker, modulemd)"), :required => true
38
38
  param :original_packages, :bool, :desc => N_("add all packages without errata to the included/excluded list. " \
39
39
  "(package filter only)")
40
40
  param :inclusion, :bool, :desc => N_("specifies if content should be included or excluded, default: inclusion=false")
@@ -43,7 +43,7 @@ module Katello
43
43
  collection = collection.where("#{date_type} >= ?", params[:start_date]) if params[:start_date]
44
44
  collection = collection.where("#{date_type} <= ?", params[:end_date]) if params[:end_date]
45
45
  collection = collection.of_type(params[:types]) if params[:types]
46
- collection.non_modular
46
+ collection
47
47
  end
48
48
 
49
49
  def custom_index_relation(collection)
@@ -52,11 +52,11 @@ module Katello
52
52
  respond_for_index(:collection => index_response, :template => "index")
53
53
  end
54
54
 
55
- api :GET, "/hosts/:host_id/subscriptions/events", N_("List subscription events for the host")
55
+ api :GET, "/hosts/:host_id/subscriptions/events", N_("List subscription events for the host"), :deprecated => true
56
56
  param :host_id, Integer, :desc => N_("Id of the host"), :required => true
57
57
  def events
58
- collection = full_result_response(@host.subscription_facet.candlepin_consumer.events.map { |e| OpenStruct.new(e) })
59
- respond_for_index :collection => collection
58
+ ::Foreman::Deprecation.api_deprecation_warning("Events API is being deprecated and will be removed in Katello 3.16.")
59
+ respond_for_index :collection => full_result_response([])
60
60
  end
61
61
 
62
62
  api :DELETE, "/hosts/:host_id/subscriptions/", N_("Unregister the host as a subscription consumer")
@@ -0,0 +1,24 @@
1
+ module Katello
2
+ class Api::V2::KatelloPingController < Api::V2::ApiController
3
+ resource_description do
4
+ api_version "v2"
5
+ resource_id "ping"
6
+ api_base_url ""
7
+ end
8
+
9
+ skip_before_action :authorize
10
+ before_action :require_login, :only => [:index]
11
+
12
+ api :GET, "/katello/api/ping", N_("Shows status of Katello system and it's subcomponents")
13
+ description N_("This service is only available for authenticated users")
14
+ def index
15
+ respond_for_show :resource => Katello::Ping.ping
16
+ end
17
+
18
+ api :GET, "/katello/api/status", N_("Shows version information")
19
+ description N_("This service is available for unauthenticated users")
20
+ def server_status
21
+ respond_for_show :resource => Katello::Ping.status, :template => "server_status"
22
+ end
23
+ end
24
+ end
@@ -35,6 +35,27 @@ module Katello
35
35
  %w(name asc)
36
36
  end
37
37
 
38
+ def available_for_content_view_filter(filter, _collection)
39
+ collection_ids = []
40
+ current_ids = filter.module_stream_rules.map(&:module_stream_id)
41
+ filter.applicable_repos.each do |repo|
42
+ collection_ids.concat(repo.module_stream_ids)
43
+ end
44
+ collection = ModuleStream.where(:id => collection_ids)
45
+ collection = collection.where("id not in (?)", current_ids) unless current_ids.empty?
46
+ collection
47
+ end
48
+
49
+ def filter_by_content_view(filter, collection)
50
+ repos = Katello::ContentView.find(filter.content_view_id).repositories
51
+ ids = repos.map { |r| r.send(:module_stream_ids) }.flatten
52
+ filter_by_ids(ids, collection)
53
+ end
54
+
55
+ def filter_by_content_view_filter(filter, collection)
56
+ collection.where(:id => filter.module_stream_rules.pluck(:module_stream_id))
57
+ end
58
+
38
59
  private
39
60
 
40
61
  def check_params
@@ -70,6 +70,11 @@ module Katello
70
70
  %w(name asc)
71
71
  end
72
72
 
73
+ def filter_by_content_view_filter(filter, collection)
74
+ ids = filter.send("#{singular_resource_name}_rules").pluck(:uuid)
75
+ filter_by_ids(ids, collection)
76
+ end
77
+
73
78
  private
74
79
 
75
80
  def repo_association
@@ -75,6 +75,22 @@ module Katello
75
75
  collection
76
76
  end
77
77
 
78
+ def filter_by_content_view_filter(filter, collection)
79
+ filtered_rpms = []
80
+ filter.package_rules.each do |rule|
81
+ filtered_rpms += filter.query_rpms_from_collection(collection, rule).pluck(:id)
82
+ end
83
+
84
+ collection.where(id: filter.applicable_rpms.pluck(:id) & filtered_rpms)
85
+ end
86
+
87
+ def filter_by_content_view_filter_rule(rule, collection)
88
+ filter = rule.filter
89
+ filtered_rpms = filter.query_rpms_from_collection(collection, rule).pluck(:id)
90
+
91
+ collection.where(id: filter.applicable_rpms.pluck(:id) & filtered_rpms)
92
+ end
93
+
78
94
  private
79
95
 
80
96
  def find_host
@@ -54,7 +54,7 @@ module Katello
54
54
  param :deb_architectures, String, :desc => N_("comma separated list of architectures to be synched from deb-archive")
55
55
  param :ignore_global_proxy, :bool, :desc => N_("if true, will ignore the globally configured proxy when syncing"), :deprecated => true
56
56
  param :ignorable_content, Array, :desc => N_("List of content units to ignore while syncing a yum repository. Must be subset of %s") % RootRepository::IGNORABLE_CONTENT_UNIT_TYPES.join(",")
57
- param :ansible_collection_whitelist, String, :desc => N_("Name of collection to sync from URL")
57
+ param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
58
58
  param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for http proxy for content sync")
59
59
  param :http_proxy_id, :number, :desc => N_("ID of a HTTP Proxy")
60
60
  end
@@ -90,6 +90,7 @@ module Katello
90
90
  param :description, String, :desc => N_("description of the repository")
91
91
  param :available_for, String, :desc => N_("interpret specified object to return only Repositories that can be associated with specified object. Only 'content_view' & 'content_view_version' are supported."),
92
92
  :required => false
93
+ param :with_content, RepositoryTypeManager.enabled_content_types, :desc => N_("only repositories having at least one of the specified content type ex: rpm , erratum")
93
94
  param_group :search, Api::V2::ApiController
94
95
  add_scoped_search_description_for(Repository)
95
96
  def index
@@ -119,6 +120,7 @@ module Katello
119
120
 
120
121
  def index_relation
121
122
  query = Repository.readable
123
+ query = query.with_content(params[:with_content]) if params[:with_content]
122
124
  query = index_relation_product(query)
123
125
  query = query.with_type(params[:content_type]) if params[:content_type]
124
126
  query = query.where(:root_id => RootRepository.where(:name => params[:name])) if params[:name]
@@ -385,6 +387,7 @@ module Katello
385
387
  param :content_type, RepositoryTypeManager.uploadable_content_types.map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree', 'puppet_module', 'rpm', 'srpm')")
386
388
  param :uploads, Array, :desc => N_("Array of uploads to import") do
387
389
  param 'id', String, :required => true
390
+ param 'content_unit_id', String
388
391
  param 'size', String
389
392
  param 'checksum', String
390
393
  param 'name', String, :desc => N_("Needs to only be set for file repositories or docker tags")
@@ -399,7 +402,7 @@ module Katello
399
402
  end
400
403
 
401
404
  uploads = (params[:uploads] || []).map do |upload|
402
- upload.permit(:id, :size, :checksum, :name, :digest).to_h
405
+ upload.permit(:id, :content_unit_id, :size, :checksum, :name, :digest).to_h
403
406
  end
404
407
 
405
408
  if params.key?(:upload_ids)
@@ -466,7 +469,7 @@ module Katello
466
469
  ]
467
470
 
468
471
  keys += [{:docker_tags_whitelist => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
469
- keys += [:ansible_collection_whitelist] if params[:action] == 'create' || @repository&.ansible_collection?
472
+ keys += [:ansible_collection_requirements] if params[:action] == 'create' || @repository&.ansible_collection?
470
473
  keys += [:label, :content_type] if params[:action] == "create"
471
474
  if params[:action] == 'create' || @repository.custom?
472
475
  keys += [:url, :gpg_key_id, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :unprotected, :name,
@@ -508,7 +511,7 @@ module Katello
508
511
  root.upstream_username = repo_params[:upstream_username] if repo_params.key?(:upstream_username)
509
512
  root.upstream_password = repo_params[:upstream_password] if repo_params.key?(:upstream_password)
510
513
  root.ignorable_content = repo_params[:ignorable_content] if root.yum? && repo_params.key?(:ignorable_content)
511
- root.ansible_collection_whitelist = repo_params[:ansible_collection_whitelist] if root.ansible_collection?
514
+ root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
512
515
  root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
513
516
  root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
514
517
 
@@ -1,6 +1,6 @@
1
1
  module Katello
2
2
  class Api::V2::SrpmsController < Api::V2::ApiController
3
- apipie_concern_subst(:a_resource => N_("a source repository"), :resource => "srpms")
3
+ apipie_concern_subst(:a_resource => N_("SRPM details"), :resource => "srpms")
4
4
  include Katello::Concerns::Api::V2::RepositoryContentController
5
5
 
6
6
  api :GET, "/srpms", N_("List srpms")