pulpcore 3.84.0__py3-none-any.whl → 3.85.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulpcore might be problematic. Click here for more details.

Files changed (163) hide show
  1. pulp_certguard/app/__init__.py +1 -1
  2. pulp_certguard/app/models.py +7 -26
  3. pulp_certguard/app/serializers.py +0 -2
  4. pulp_certguard/rhsm/__init__.py +4 -0
  5. pulp_certguard/rhsm/rhsm_check_path.py +198 -0
  6. pulp_certguard/tests/unit/certdata.py +249 -0
  7. pulp_certguard/tests/unit/test_rhsm_check_path.py +213 -0
  8. pulp_file/app/__init__.py +1 -1
  9. pulp_file/app/migrations/0001_initial_squashed_0016_add_domain.py +0 -20
  10. pulp_file/app/migrations/0017_alter_filealternatecontentsource_alternatecontentsource_ptr_and_more.py +1 -1
  11. pulpcore/app/apps.py +2 -12
  12. pulpcore/app/entrypoint.py +22 -22
  13. pulpcore/app/migrations/0001_squashed_0090_char_to_text_field.py +0 -95
  14. pulpcore/app/migrations/0091_systemid.py +1 -1
  15. pulp_file/app/migrations/0006_delete_filefilesystemexporter.py → pulpcore/app/migrations/0136_delete_basedistribution.py +3 -3
  16. pulpcore/app/migrations/0137_appstatus.py +33 -0
  17. pulpcore/app/migrations/0138_vulnerabilityreport.py +33 -0
  18. pulpcore/app/models/__init__.py +4 -1
  19. pulpcore/app/models/publication.py +0 -41
  20. pulpcore/app/models/status.py +145 -0
  21. pulpcore/app/models/task.py +1 -0
  22. pulpcore/app/models/vulnerability_report.py +34 -0
  23. pulpcore/app/serializers/__init__.py +1 -0
  24. pulpcore/app/serializers/content.py +13 -1
  25. pulpcore/app/serializers/repository.py +8 -1
  26. pulpcore/app/serializers/vulnerability_report.py +27 -0
  27. pulpcore/app/settings.py +14 -47
  28. pulpcore/app/tasks/__init__.py +2 -0
  29. pulpcore/app/tasks/vulnerability_report.py +159 -0
  30. pulpcore/app/viewsets/__init__.py +1 -0
  31. pulpcore/app/viewsets/vulnerability_report.py +20 -0
  32. pulpcore/constants.py +4 -0
  33. pulpcore/content/__init__.py +23 -22
  34. pulpcore/content/handler.py +5 -2
  35. pulpcore/migrations.py +38 -11
  36. pulpcore/openapi/__init__.py +8 -0
  37. pulpcore/plugin/models/__init__.py +2 -0
  38. pulpcore/plugin/serializers/__init__.py +2 -0
  39. pulpcore/plugin/tasking.py +2 -0
  40. pulpcore/plugin/viewsets/__init__.py +2 -0
  41. pulpcore/pytest_plugin.py +21 -21
  42. pulpcore/tasking/worker.py +38 -35
  43. pulpcore/tests/functional/api/test_auth.py +18 -3
  44. pulpcore/tests/functional/api/test_openapi_schema.py +32 -15
  45. pulpcore/tests/functional/api/using_plugin/test_checkpoint.py +23 -1
  46. pulpcore/tests/functional/api/using_plugin/test_proxy.py +1 -1
  47. pulpcore/tests/unit/content/test_heartbeat.py +11 -8
  48. pulpcore/tests/unit/test_vulnerability_report.py +74 -0
  49. {pulpcore-3.84.0.dist-info → pulpcore-3.85.0.dist-info}/METADATA +12 -17
  50. {pulpcore-3.84.0.dist-info → pulpcore-3.85.0.dist-info}/RECORD +54 -152
  51. pulp_certguard/app/utils.py +0 -28
  52. pulp_certguard/tests/unit/test_models.py +0 -9
  53. pulp_file/app/migrations/0001_initial.py +0 -59
  54. pulp_file/app/migrations/0002_file_related_names.py +0 -55
  55. pulp_file/app/migrations/0003_auto_20191014_1721.py +0 -18
  56. pulp_file/app/migrations/0004_filefilesystemexporter.py +0 -21
  57. pulp_file/app/migrations/0005_filerepository.py +0 -24
  58. pulp_file/app/migrations/0007_filefilesystemexporter.py +0 -25
  59. pulp_file/app/migrations/0008_add_manifest_field.py +0 -19
  60. pulp_file/app/migrations/0009_move_data_to_new_master_distribution_model.py +0 -77
  61. pulp_file/app/migrations/0010_auto_publish.py +0 -23
  62. pulp_file/app/migrations/0011_fix_auto_publish.py +0 -36
  63. pulp_file/app/migrations/0012_delete_filefilesystemexporter.py +0 -28
  64. pulp_file/app/migrations/0013_file_acs.py +0 -24
  65. pulp_file/app/migrations/0014_new_rbac_permissions.py +0 -33
  66. pulp_file/app/migrations/0015_allow_null_manifest.py +0 -23
  67. pulp_file/app/migrations/0016_add_domain.py +0 -25
  68. pulpcore/app/migrations/0001_initial.py +0 -451
  69. pulpcore/app/migrations/0002_increase_artifact_size_field.py +0 -18
  70. pulpcore/app/migrations/0003_remove_upload_completed.py +0 -17
  71. pulpcore/app/migrations/0004_add_duplicated_reserved_resources.py +0 -45
  72. pulpcore/app/migrations/0005_progressreport_code.py +0 -19
  73. pulpcore/app/migrations/0006_repository_plugin_managed.py +0 -18
  74. pulpcore/app/migrations/0007_delete_progress_proxies.py +0 -19
  75. pulpcore/app/migrations/0008_published_metadata_as_content.py +0 -44
  76. pulpcore/app/migrations/0009_remove_task_non_fatal_errors.py +0 -17
  77. pulpcore/app/migrations/0010_pulp_fields.py +0 -570
  78. pulpcore/app/migrations/0011_relative_path.py +0 -28
  79. pulpcore/app/migrations/0012_auto_20191104_2000.py +0 -31
  80. pulpcore/app/migrations/0013_repository_pulp_type.py +0 -18
  81. pulpcore/app/migrations/0014_remove_repository_plugin_managed.py +0 -17
  82. pulpcore/app/migrations/0015_auto_20191112_1426.py +0 -33
  83. pulpcore/app/migrations/0016_charfield_to_textfield.py +0 -68
  84. pulpcore/app/migrations/0017_remove_task_parent.py +0 -17
  85. pulpcore/app/migrations/0018_auto_20191127_2350.py +0 -20
  86. pulpcore/app/migrations/0019_add_signing_service_model.py +0 -27
  87. pulpcore/app/migrations/0020_change_publishedartifact_constraints.py +0 -17
  88. pulpcore/app/migrations/0021_add_signing_service_foreign_key.py +0 -24
  89. pulpcore/app/migrations/0022_rename_last_version.py +0 -27
  90. pulpcore/app/migrations/0023_change_exporter_models.py +0 -82
  91. pulpcore/app/migrations/0024_use_local_storage_for_uploads.py +0 -19
  92. pulpcore/app/migrations/0025_task_parent_task.py +0 -19
  93. pulpcore/app/migrations/0026_task_group.py +0 -32
  94. pulpcore/app/migrations/0027_export_backend.py +0 -31
  95. pulpcore/app/migrations/0028_import_importer_pulpimporter_pulpimporterrepository.py +0 -85
  96. pulpcore/app/migrations/0029_export_delete.py +0 -19
  97. pulpcore/app/migrations/0030_taskgroup_all_tasks_dispatched.py +0 -24
  98. pulpcore/app/migrations/0031_import_export_validate_params.py +0 -19
  99. pulpcore/app/migrations/0032_export_to_chunks.py +0 -27
  100. pulpcore/app/migrations/0033_increase_remote_artifact_size_field.py +0 -18
  101. pulpcore/app/migrations/0034_groupprogressreport.py +0 -32
  102. pulpcore/app/migrations/0035_content_upstream_id.py +0 -18
  103. pulpcore/app/migrations/0036_unprotect_last_export.py +0 -19
  104. pulpcore/app/migrations/0037_pulptemporaryfile.py +0 -28
  105. pulpcore/app/migrations/0038_repository_remote.py +0 -19
  106. pulpcore/app/migrations/0039_change_download_concurrency.py +0 -25
  107. pulpcore/app/migrations/0040_set_admin_is_staff.py +0 -28
  108. pulpcore/app/migrations/0041_accesspolicy.py +0 -29
  109. pulpcore/app/migrations/0042_rbac_for_tasks.py +0 -56
  110. pulpcore/app/migrations/0043_toc_attribute.py +0 -19
  111. pulpcore/app/migrations/0044_temp_file_artifact_field.py +0 -20
  112. pulpcore/app/migrations/0045_accesspolicy_permissions_allow_null.py +0 -19
  113. pulpcore/app/migrations/0046_task__resource_job_id.py +0 -35
  114. pulpcore/app/migrations/0047_improve_orphan_cleanup.py +0 -59
  115. pulpcore/app/migrations/0048_fips_checksums.py +0 -38
  116. pulpcore/app/migrations/0049_add_file_field_to_uploadchunk.py +0 -24
  117. pulpcore/app/migrations/0050_namespace_access_policies.py +0 -28
  118. pulpcore/app/migrations/0051_timeoutfields.py +0 -34
  119. pulpcore/app/migrations/0052_tasking_logging_cid.py +0 -18
  120. pulpcore/app/migrations/0053_remote_headers.py +0 -19
  121. pulpcore/app/migrations/0054_add_public_key.py +0 -104
  122. pulpcore/app/migrations/0055_label.py +0 -31
  123. pulpcore/app/migrations/0056_remote_rate_limit.py +0 -18
  124. pulpcore/app/migrations/0057_add_label_indexes.py +0 -23
  125. pulpcore/app/migrations/0058_accesspolicy_customized.py +0 -18
  126. pulpcore/app/migrations/0059_proxy_creds.py +0 -23
  127. pulpcore/app/migrations/0060_data_migration_proxy_creds.py +0 -45
  128. pulpcore/app/migrations/0061_call_handle_artifact_checksums_command.py +0 -87
  129. pulpcore/app/migrations/0062_add_new_distribution_mastermodel.py +0 -36
  130. pulpcore/app/migrations/0063_repository_retained_versions.py +0 -18
  131. pulpcore/app/migrations/0064_add_new_style_task_columns.py +0 -109
  132. pulpcore/app/migrations/0064_repository_user_hidden.py +0 -18
  133. pulpcore/app/migrations/0065_merge_20210615_1211.py +0 -14
  134. pulpcore/app/migrations/0066_download_concurrency_and_retry_changes.py +0 -24
  135. pulpcore/app/migrations/0067_add_protect_to_task_reservation.py +0 -19
  136. pulpcore/app/migrations/0068_add_timestamp_of_interest.py +0 -23
  137. pulpcore/app/migrations/0069_update_json_fields.py +0 -63
  138. pulpcore/app/migrations/0070_rename_retained_versions.py +0 -18
  139. pulpcore/app/migrations/0071_filesystemexport_filesystemexporter.py +0 -35
  140. pulpcore/app/migrations/0072_add_method_to_filesystem_exporter.py +0 -18
  141. pulpcore/app/migrations/0073_encrypt_remote_fields.py +0 -139
  142. pulpcore/app/migrations/0074_acs.py +0 -47
  143. pulpcore/app/migrations/0075_rbaccontentguard.py +0 -25
  144. pulpcore/app/migrations/0076_remove_reserved_resource.py +0 -39
  145. pulpcore/app/migrations/0077_move_remote_url_credentials.py +0 -41
  146. pulpcore/app/migrations/0078_grouprole_role_userrole.py +0 -70
  147. pulpcore/app/migrations/0079_rename_permissions_assignment_accesspolicy_creation_hooks.py +0 -18
  148. pulpcore/app/migrations/0080_proxy_group_model.py +0 -37
  149. pulpcore/app/migrations/0081_reapplabel_group_permissions.py +0 -59
  150. pulpcore/app/migrations/0082_add_manage_roles_permissions.py +0 -17
  151. pulpcore/app/migrations/0083_alter_group_options.py +0 -17
  152. pulpcore/app/migrations/0084_alter_rbaccontentguard_options.py +0 -17
  153. pulpcore/app/migrations/0085_contentredirectcontentguard.py +0 -26
  154. pulpcore/app/migrations/0086_task_json_fields.py +0 -77
  155. pulpcore/app/migrations/0087_taskschedule.py +0 -34
  156. pulpcore/app/migrations/0088_accesspolicy_queryset_scoping.py +0 -18
  157. pulpcore/app/migrations/0089_alter_contentredirectcontentguard_options.py +0 -17
  158. pulpcore/app/migrations/0090_char_to_text_field.py +0 -79
  159. pulpcore/tests/unit/migration/test_0077_move_remote_url_credentials.py +0 -35
  160. {pulpcore-3.84.0.dist-info → pulpcore-3.85.0.dist-info}/WHEEL +0 -0
  161. {pulpcore-3.84.0.dist-info → pulpcore-3.85.0.dist-info}/entry_points.txt +0 -0
  162. {pulpcore-3.84.0.dist-info → pulpcore-3.85.0.dist-info}/licenses/LICENSE +0 -0
  163. {pulpcore-3.84.0.dist-info → pulpcore-3.85.0.dist-info}/top_level.txt +0 -0
@@ -1,139 +0,0 @@
1
- # Generated by Django 2.2.20 on 2021-04-29 14:33
2
-
3
- from django.db import migrations
4
- import pulpcore.app.models.fields
5
-
6
- fields = ("username", "password", "proxy_username", "proxy_password", "client_key")
7
- new_fields = ("_encrypted_username", "_encrypted_password", "_encrypted_proxy_username", "_encrypted_proxy_password", "_encrypted_client_key")
8
-
9
-
10
- def encrypt_remote_fields(apps, schema_editor):
11
- Remote = apps.get_model("core", "Remote")
12
-
13
- remotes_needing_update = []
14
- for remote in Remote.objects.all().iterator():
15
- if not any([getattr(remote, field) for field in fields]):
16
- continue
17
-
18
- remote._encrypted_username = remote.username
19
- remote._encrypted_password = remote.password
20
- remote._encrypted_proxy_username = remote.proxy_username
21
- remote._encrypted_proxy_password = remote.proxy_password
22
- remote._encrypted_client_key = remote.client_key
23
- remotes_needing_update.append(remote)
24
-
25
- if len(remotes_needing_update) > 100:
26
- Remote.objects.bulk_update(remotes_needing_update, new_fields)
27
- remotes_needing_update.clear()
28
-
29
- Remote.objects.bulk_update(remotes_needing_update, new_fields)
30
-
31
-
32
- def unencrypt_remote_fields(apps, schema_editor):
33
- Remote = apps.get_model("core", "Remote")
34
-
35
- remotes_needing_update = []
36
- for remote in Remote.objects.all().iterator():
37
- if not any([getattr(remote, field) for field in new_fields]):
38
- continue
39
- remote.username = remote._encrypted_username
40
- remote.password = remote._encrypted_password
41
- remote.proxy_username = remote._encrypted_proxy_username
42
- remote.proxy_password = remote._encrypted_proxy_password
43
- remote.client_key = remote._encrypted_client_key
44
- remotes_needing_update.append(remote)
45
-
46
- if len(remotes_needing_update) > 100:
47
- Remote.objects.bulk_update(remotes_needing_update, fields)
48
- remotes_needing_update.clear()
49
-
50
- Remote.objects.bulk_update(remotes_needing_update, fields)
51
-
52
-
53
- class Migration(migrations.Migration):
54
-
55
- dependencies = [
56
- ("core", "0072_add_method_to_filesystem_exporter"),
57
- ]
58
-
59
- operations = [
60
- # Add new fields to temporarily hold the encrypted values
61
- migrations.AddField(
62
- model_name="remote",
63
- name="_encrypted_client_key",
64
- field=pulpcore.app.models.fields.EncryptedTextField(null=True),
65
- ),
66
- migrations.AddField(
67
- model_name="remote",
68
- name="_encrypted_password",
69
- field=pulpcore.app.models.fields.EncryptedTextField(null=True),
70
- ),
71
- migrations.AddField(
72
- model_name="remote",
73
- name="_encrypted_proxy_password",
74
- field=pulpcore.app.models.fields.EncryptedTextField(null=True),
75
- ),
76
- migrations.AddField(
77
- model_name="remote",
78
- name="_encrypted_proxy_username",
79
- field=pulpcore.app.models.fields.EncryptedTextField(null=True),
80
- ),
81
- migrations.AddField(
82
- model_name="remote",
83
- name="_encrypted_username",
84
- field=pulpcore.app.models.fields.EncryptedTextField(null=True),
85
- ),
86
- # Populate the new fields with encrypted values computed from the unencrypted fields
87
- migrations.RunPython(
88
- code=encrypt_remote_fields,
89
- reverse_code=unencrypt_remote_fields,
90
- elidable=True,
91
- ),
92
- # Remove the unencrypted columns
93
- migrations.RemoveField(
94
- model_name="remote",
95
- name="client_key",
96
- ),
97
- migrations.RemoveField(
98
- model_name="remote",
99
- name="password",
100
- ),
101
- migrations.RemoveField(
102
- model_name="remote",
103
- name="proxy_password",
104
- ),
105
- migrations.RemoveField(
106
- model_name="remote",
107
- name="proxy_username",
108
- ),
109
- migrations.RemoveField(
110
- model_name="remote",
111
- name="username",
112
- ),
113
- # Replace the formerly-unencrypted columns with the new encrypted ones
114
- migrations.RenameField(
115
- model_name="remote",
116
- old_name="_encrypted_client_key",
117
- new_name="client_key",
118
- ),
119
- migrations.RenameField(
120
- model_name="remote",
121
- old_name="_encrypted_password",
122
- new_name="password",
123
- ),
124
- migrations.RenameField(
125
- model_name="remote",
126
- old_name="_encrypted_proxy_password",
127
- new_name="proxy_password",
128
- ),
129
- migrations.RenameField(
130
- model_name="remote",
131
- old_name="_encrypted_proxy_username",
132
- new_name="proxy_username",
133
- ),
134
- migrations.RenameField(
135
- model_name="remote",
136
- old_name="_encrypted_username",
137
- new_name="username",
138
- ),
139
- ]
@@ -1,47 +0,0 @@
1
- # Generated by Django 3.2.6 on 2021-08-25 16:55
2
-
3
- from django.db import migrations, models
4
- import django.db.models.deletion
5
- import django_lifecycle.mixins
6
- import uuid
7
-
8
-
9
- class Migration(migrations.Migration):
10
-
11
- dependencies = [
12
- ('core', '0073_encrypt_remote_fields'),
13
- ]
14
-
15
- operations = [
16
- migrations.CreateModel(
17
- name='AlternateContentSource',
18
- fields=[
19
- ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
20
- ('pulp_created', models.DateTimeField(auto_now_add=True)),
21
- ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
22
- ('pulp_type', models.TextField(db_index=True, default=None)),
23
- ('name', models.TextField(db_index=True, unique=True)),
24
- ('last_refreshed', models.DateTimeField(null=True)),
25
- ('remote', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='core.remote')),
26
- ],
27
- options={
28
- 'verbose_name_plural': 'acs',
29
- },
30
- bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
31
- ),
32
- migrations.CreateModel(
33
- name='AlternateContentSourcePath',
34
- fields=[
35
- ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
36
- ('pulp_created', models.DateTimeField(auto_now_add=True)),
37
- ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
38
- ('path', models.TextField(default=None)),
39
- ('alternate_content_source', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='paths', to='core.alternatecontentsource')),
40
- ('repository', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.repository')),
41
- ],
42
- options={
43
- 'unique_together': {('alternate_content_source', 'path')},
44
- },
45
- bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
46
- ),
47
- ]
@@ -1,25 +0,0 @@
1
- # Generated by Django 3.2.6 on 2021-08-25 20:10
2
-
3
- from django.db import migrations, models
4
- import django.db.models.deletion
5
-
6
-
7
- class Migration(migrations.Migration):
8
-
9
- dependencies = [
10
- ('core', '0074_acs'),
11
- ]
12
-
13
- operations = [
14
- migrations.CreateModel(
15
- name='RBACContentGuard',
16
- fields=[
17
- ('contentguard_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='core_rbaccontentguard', serialize=False, to='core.contentguard')),
18
- ],
19
- options={
20
- 'permissions': (('download_rbaccontentguard', 'Can Download Content'),),
21
- 'default_related_name': '%(app_label)s_%(model_name)s',
22
- },
23
- bases=('core.contentguard',),
24
- ),
25
- ]
@@ -1,39 +0,0 @@
1
- # Generated by Django 3.2.6 on 2021-08-30 11:27
2
-
3
- from django.db import migrations
4
-
5
-
6
- class Migration(migrations.Migration):
7
-
8
- dependencies = [
9
- ('core', '0075_rbaccontentguard'),
10
- ]
11
-
12
- operations = [
13
- migrations.RemoveField(
14
- model_name='taskreservedresource',
15
- name='resource',
16
- ),
17
- migrations.RemoveField(
18
- model_name='taskreservedresource',
19
- name='task',
20
- ),
21
- migrations.RemoveField(
22
- model_name='worker',
23
- name='cleaned_up',
24
- ),
25
- migrations.RemoveField(
26
- model_name='worker',
27
- name='gracefully_stopped',
28
- ),
29
- migrations.RemoveField(
30
- model_name='task',
31
- name='_resource_job_id',
32
- ),
33
- migrations.DeleteModel(
34
- name='ReservedResource',
35
- ),
36
- migrations.DeleteModel(
37
- name='TaskReservedResource',
38
- ),
39
- ]
@@ -1,41 +0,0 @@
1
- # Generated by Django 3.2.6 on 2021-09-29 14:00
2
-
3
- from urllib.parse import urlparse, urlunparse
4
-
5
- from django.db import migrations
6
-
7
-
8
- def move_remote_url_credentials(apps, schema_editor):
9
- Remote = apps.get_model("core", "Remote")
10
-
11
- for remote in Remote.objects.filter(url__contains="@").iterator():
12
- url = urlparse(remote.url)
13
-
14
- if '@' not in url.netloc:
15
- # URLs can have an @ in other places than the netloc,
16
- # but those do not indicate credentials
17
- continue
18
-
19
- if not remote.username:
20
- remote.username = url.username
21
- if not remote.password:
22
- remote.password = url.password
23
-
24
- _, url_split = url.netloc.rsplit("@", maxsplit=1)
25
- remote.url = urlunparse(url._replace(netloc=url_split))
26
- remote.save()
27
-
28
-
29
- class Migration(migrations.Migration):
30
-
31
- dependencies = [
32
- ('core', '0076_remove_reserved_resource'),
33
- ]
34
-
35
- operations = [
36
- migrations.RunPython(
37
- code=move_remote_url_credentials,
38
- reverse_code=migrations.RunPython.noop,
39
- elidable=True,
40
- )
41
- ]
@@ -1,70 +0,0 @@
1
- # Generated by Django 3.2.7 on 2021-09-17 10:23
2
-
3
- from django.conf import settings
4
- from django.db import migrations, models
5
- import django.db.models.deletion
6
- import django_lifecycle.mixins
7
- import uuid
8
-
9
-
10
- class Migration(migrations.Migration):
11
-
12
- dependencies = [
13
- ('contenttypes', '0002_remove_content_type_name'),
14
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15
- ('auth', '0012_alter_user_first_name_max_length'),
16
- ('core', '0077_move_remote_url_credentials'),
17
- ]
18
-
19
- operations = [
20
- migrations.CreateModel(
21
- name='Role',
22
- fields=[
23
- ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
24
- ('pulp_created', models.DateTimeField(auto_now_add=True)),
25
- ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
26
- ('name', models.CharField(db_index=True, max_length=128, unique=True)),
27
- ('description', models.TextField(null=True)),
28
- ('permissions', models.ManyToManyField(to='auth.Permission')),
29
- ('locked', models.BooleanField(default=False)),
30
- ],
31
- options={
32
- 'abstract': False,
33
- },
34
- bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
35
- ),
36
- migrations.CreateModel(
37
- name='UserRole',
38
- fields=[
39
- ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
40
- ('pulp_created', models.DateTimeField(auto_now_add=True)),
41
- ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
42
- ('object_id', models.CharField(max_length=255, null=True)),
43
- ('content_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
44
- ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_users', to='core.role')),
45
- ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_roles', to=settings.AUTH_USER_MODEL)),
46
- ],
47
- options={
48
- 'indexes': [models.Index(fields=['content_type', 'object_id'], name='core_userro_content_5c0477_idx')],
49
- 'unique_together': {('user', 'role', 'content_type', 'object_id')},
50
- },
51
- bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
52
- ),
53
- migrations.CreateModel(
54
- name='GroupRole',
55
- fields=[
56
- ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
57
- ('pulp_created', models.DateTimeField(auto_now_add=True)),
58
- ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
59
- ('object_id', models.CharField(max_length=255, null=True)),
60
- ('content_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
61
- ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_roles', to='auth.group')),
62
- ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_groups', to='core.role')),
63
- ],
64
- options={
65
- 'indexes': [models.Index(fields=['content_type', 'object_id'], name='core_groupr_content_ea7d37_idx')],
66
- 'unique_together': {('group', 'role', 'content_type', 'object_id')},
67
- },
68
- bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
69
- ),
70
- ]
@@ -1,18 +0,0 @@
1
- # Generated by Django 3.2.7 on 2021-09-22 12:55
2
-
3
- from django.db import migrations
4
-
5
-
6
- class Migration(migrations.Migration):
7
-
8
- dependencies = [
9
- ('core', '0078_grouprole_role_userrole'),
10
- ]
11
-
12
- operations = [
13
- migrations.RenameField(
14
- model_name='accesspolicy',
15
- old_name='permissions_assignment',
16
- new_name='creation_hooks',
17
- ),
18
- ]
@@ -1,37 +0,0 @@
1
- # Generated by Django 3.2.9 on 2021-11-25 11:20
2
-
3
- import django.contrib.auth.models
4
- from django.db import migrations, models
5
- import django.db.models.deletion
6
- import django_lifecycle.mixins
7
- import pulpcore.app.models.access_policy
8
-
9
-
10
- class Migration(migrations.Migration):
11
-
12
- dependencies = [
13
- ('auth', '0012_alter_user_first_name_max_length'),
14
- ('core', '0079_rename_permissions_assignment_accesspolicy_creation_hooks'),
15
- ]
16
-
17
- operations = [
18
- migrations.CreateModel(
19
- name='Group',
20
- fields=[
21
- ],
22
- options={
23
- 'proxy': True,
24
- 'indexes': [],
25
- 'constraints': [],
26
- },
27
- bases=(django_lifecycle.mixins.LifecycleModelMixin, 'auth.group', pulpcore.app.models.access_policy.AutoAddObjPermsMixin),
28
- managers=[
29
- ('objects', django.contrib.auth.models.GroupManager()),
30
- ],
31
- ),
32
- migrations.AlterField(
33
- model_name='grouprole',
34
- name='group',
35
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_roles', to='core.group'),
36
- ),
37
- ]
@@ -1,59 +0,0 @@
1
- # Generated by Django 3.2.9 on 2021-12-08 11:33
2
-
3
- from django.apps import apps as global_apps
4
- from django.conf import settings
5
- from django.db import migrations
6
-
7
-
8
- def reapplabel_group_permissions_up(apps, schema_editor, up=True):
9
- User = apps.get_model(settings.AUTH_USER_MODEL)
10
-
11
- PERMISSION_CLASSES = [
12
- (User.user_permissions.through._meta.app_label, User.user_permissions.through._meta.model_name),
13
- ("auth", "Group_permissions"),
14
- ("guardian", "UserObjectPermission"),
15
- ("guardian", "GroupObjectPermission"),
16
- ]
17
-
18
- PERMISSION_NAMES = ["add", "change", "delete", "view"]
19
-
20
- Permission = apps.get_model("auth", "Permission")
21
- ContentType = apps.get_model("contenttypes", "ContentType")
22
- AuthGroup = apps.get_model("auth", "Group")
23
- CoreGroup = apps.get_model("core", "Group")
24
- auth_ctype = ContentType.objects.get_for_model(AuthGroup, for_concrete_model=False)
25
- core_ctype = ContentType.objects.get_for_model(CoreGroup, for_concrete_model=False)
26
-
27
- perm_classes = [apps.get_model(class_app, class_name) for class_app, class_name in PERMISSION_CLASSES]
28
-
29
- for perm_name in PERMISSION_NAMES:
30
- auth_perm, _ = Permission.objects.get_or_create(content_type=auth_ctype, codename=f"{perm_name}_group", defaults={"name": f"Can {perm_name} group"})
31
- core_perm, _ = Permission.objects.get_or_create(content_type=core_ctype, codename=f"{perm_name}_group", defaults={"name": f"Can {perm_name} group"})
32
- for perm_class in perm_classes:
33
- if up:
34
- perm_class.objects.filter(permission=auth_perm).update(permission=core_perm)
35
- else:
36
- perm_class.objects.filter(permission=core_perm).update(permission=auth_perm)
37
-
38
-
39
- def reapplabel_group_permissions_down(apps, schema_editor):
40
- reapplabel_group_permissions_up(apps, schema_editor, up=False)
41
-
42
-
43
- class Migration(migrations.Migration):
44
-
45
- dependencies = [
46
- ('core', '0080_proxy_group_model'),
47
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
48
- ('auth', '0012_alter_user_first_name_max_length'),
49
- ('contenttypes', '0002_remove_content_type_name'),
50
- ]
51
-
52
- operations = [
53
- ]
54
-
55
- if global_apps.is_installed('guardian'):
56
- dependencies.append(('guardian', '0002_generic_permissions_index'))
57
- operations.append(
58
- migrations.RunPython(reapplabel_group_permissions_up, reverse_code=reapplabel_group_permissions_down, elidable=True)
59
- )
@@ -1,17 +0,0 @@
1
- # Generated by Django 3.2.8 on 2021-10-21 10:58
2
-
3
- from django.db import migrations
4
-
5
-
6
- class Migration(migrations.Migration):
7
-
8
- dependencies = [
9
- ('core', '0081_reapplabel_group_permissions'),
10
- ]
11
-
12
- operations = [
13
- migrations.AlterModelOptions(
14
- name='task',
15
- options={'permissions': [('manage_roles_task', 'Can manage role assignments on task')]},
16
- ),
17
- ]
@@ -1,17 +0,0 @@
1
- # Generated by Django 3.2.9 on 2021-12-06 16:28
2
-
3
- from django.db import migrations
4
-
5
-
6
- class Migration(migrations.Migration):
7
-
8
- dependencies = [
9
- ('core', '0082_add_manage_roles_permissions'),
10
- ]
11
-
12
- operations = [
13
- migrations.AlterModelOptions(
14
- name='group',
15
- options={'permissions': [('manage_roles_group', 'Can manage role assignments on group')]},
16
- ),
17
- ]
@@ -1,17 +0,0 @@
1
- # Generated by Django 3.2.8 on 2021-12-09 22:59
2
-
3
- from django.db import migrations
4
-
5
-
6
- class Migration(migrations.Migration):
7
-
8
- dependencies = [
9
- ('core', '0083_alter_group_options'),
10
- ]
11
-
12
- operations = [
13
- migrations.AlterModelOptions(
14
- name='rbaccontentguard',
15
- options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': (('download_rbaccontentguard', 'Can Download Content'), ('manage_roles_rbaccontentguard', 'Can manage role assignments on RBAC content guard'))},
16
- ),
17
- ]
@@ -1,26 +0,0 @@
1
- # Generated by Django 3.2.10 on 2022-01-25 10:28
2
-
3
- from django.db import migrations, models
4
- import django.db.models.deletion
5
- import pulpcore.app.models.publication
6
-
7
-
8
- class Migration(migrations.Migration):
9
-
10
- dependencies = [
11
- ('core', '0084_alter_rbaccontentguard_options'),
12
- ]
13
-
14
- operations = [
15
- migrations.CreateModel(
16
- name='ContentRedirectContentGuard',
17
- fields=[
18
- ('contentguard_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='core_contentredirectcontentguard', serialize=False, to='core.contentguard')),
19
- ('shared_secret', models.BinaryField(default=pulpcore.app.models.publication._gen_secret, max_length=32)),
20
- ],
21
- options={
22
- 'default_related_name': '%(app_label)s_%(model_name)s',
23
- },
24
- bases=('core.contentguard',),
25
- ),
26
- ]
@@ -1,77 +0,0 @@
1
- # Generated by Django 3.2.11 on 2022-02-08 10:47
2
-
3
- import json
4
- import django.core.serializers.json
5
- from django.db import migrations, models
6
-
7
-
8
- def convert_task_args_to_json(apps, schema_editor):
9
- Task = apps.get_model("core", "Task")
10
- updated_tasks = []
11
- for task in Task.objects.only("args", "kwargs").iterator():
12
- try:
13
- update = False
14
- if isinstance(task.args, str):
15
- task.args = json.loads(task.args)
16
- update = True
17
- if isinstance(task.kwargs, str):
18
- task.kwargs = json.loads(task.kwargs)
19
- update = True
20
- if update:
21
- updated_tasks.append(task)
22
- except ValueError:
23
- # Catch and ignore all cases of JSON transcoding errors.
24
- # This is not even expected to be hit, but the migration should be fault tolerant.
25
- pass
26
- if len(updated_tasks) > 1000:
27
- Task.objects.bulk_update(updated_tasks, ["args", "kwargs"])
28
- updated_tasks.clear()
29
-
30
- Task.objects.bulk_update(updated_tasks, ["args", "kwargs"])
31
-
32
-
33
- def convert_task_args_to_str(apps, schema_editor):
34
- Task = apps.get_model("core", "Task")
35
- encoder = django.core.serializers.json.DjangoJSONEncoder
36
- updated_tasks = []
37
- for task in Task.objects.only("args", "kwargs").iterator():
38
- try:
39
- update = False
40
- if not isinstance(task.args, str):
41
- task.args = json.dumps(task.args, cls=encoder)
42
- update = True
43
- if not isinstance(task.kwargs, str):
44
- task.kwargs = json.dumps(task.kwargs, cls=encoder)
45
- update = True
46
- if update:
47
- updated_tasks.append(task)
48
- except ValueError:
49
- # Catch and ignore all cases of JSON transcoding errors.
50
- # This is not even expected to be hit, but the migration should be fault tolerant.
51
- pass
52
- if len(updated_tasks) > 1000:
53
- Task.objects.bulk_update(updated_tasks, ["args", "kwargs"])
54
- updated_tasks.clear()
55
-
56
- Task.objects.bulk_update(updated_tasks, ["args", "kwargs"])
57
-
58
-
59
- class Migration(migrations.Migration):
60
-
61
- dependencies = [
62
- ('core', '0085_contentredirectcontentguard'),
63
- ]
64
-
65
- operations = [
66
- migrations.AlterField(
67
- model_name='task',
68
- name='args',
69
- field=models.JSONField(encoder=django.core.serializers.json.DjangoJSONEncoder, null=True),
70
- ),
71
- migrations.AlterField(
72
- model_name='task',
73
- name='kwargs',
74
- field=models.JSONField(encoder=django.core.serializers.json.DjangoJSONEncoder, null=True),
75
- ),
76
- migrations.RunPython(code=convert_task_args_to_json, reverse_code=convert_task_args_to_str, elidable=True),
77
- ]
@@ -1,34 +0,0 @@
1
- # Generated by Django 3.2.11 on 2022-02-09 12:55
2
-
3
- from django.db import migrations, models
4
- import django.db.models.deletion
5
- import django_lifecycle.mixins
6
- import uuid
7
-
8
-
9
- class Migration(migrations.Migration):
10
-
11
- dependencies = [
12
- ('core', '0086_task_json_fields'),
13
- ]
14
-
15
- operations = [
16
- migrations.CreateModel(
17
- name='TaskSchedule',
18
- fields=[
19
- ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
20
- ('pulp_created', models.DateTimeField(auto_now_add=True)),
21
- ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
22
- ('dispatch_interval', models.DurationField(null=True)),
23
- ('name', models.CharField(max_length=256, unique=True)),
24
- ('next_dispatch', models.DateTimeField(default=django.utils.timezone.now, null=True)),
25
- ('task_name', models.CharField(max_length=256)),
26
- ('last_task', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.task')),
27
- ],
28
- options={
29
- 'abstract': False,
30
- 'permissions': [('manage_roles_taskschedule', 'Can manage role assignments on task schedules')],
31
- },
32
- bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
33
- ),
34
- ]