diff --git a/CHANGES/2488.removal b/CHANGES/2488.removal new file mode 100644 index 0000000000..1b5b7984d9 --- /dev/null +++ b/CHANGES/2488.removal @@ -0,0 +1 @@ +Removed support for publishing repos with a checksum type of md5, sha1, or sha224 diff --git a/pulp_rpm/app/constants.py b/pulp_rpm/app/constants.py index bba1bb189c..3d312882e5 100644 --- a/pulp_rpm/app/constants.py +++ b/pulp_rpm/app/constants.py @@ -13,11 +13,6 @@ # The same as above, but in a format that choice fields can use CHECKSUM_CHOICES = ( - (CHECKSUM_TYPES.UNKNOWN, CHECKSUM_TYPES.UNKNOWN), - (CHECKSUM_TYPES.MD5, CHECKSUM_TYPES.MD5), - (CHECKSUM_TYPES.SHA, CHECKSUM_TYPES.SHA1), - (CHECKSUM_TYPES.SHA1, CHECKSUM_TYPES.SHA1), - (CHECKSUM_TYPES.SHA224, CHECKSUM_TYPES.SHA224), (CHECKSUM_TYPES.SHA256, CHECKSUM_TYPES.SHA256), (CHECKSUM_TYPES.SHA384, CHECKSUM_TYPES.SHA384), (CHECKSUM_TYPES.SHA512, CHECKSUM_TYPES.SHA512), diff --git a/pulp_rpm/app/migrations/0056_alter_package_checksum_type_and_more.py b/pulp_rpm/app/migrations/0056_alter_package_checksum_type_and_more.py new file mode 100644 index 0000000000..e88fbea5b1 --- /dev/null +++ b/pulp_rpm/app/migrations/0056_alter_package_checksum_type_and_more.py @@ -0,0 +1,43 @@ +# Generated by Django 4.2.5 on 2023-11-06 22:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('rpm', '0055_add_repo_config_field'), + ] + + operations = [ + migrations.AlterField( + model_name='package', + name='checksum_type', + field=models.TextField(choices=[('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')]), + ), + migrations.AlterField( + model_name='repometadatafile', + name='checksum_type', + field=models.TextField(choices=[('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')]), + ), + migrations.AlterField( + model_name='rpmpublication', + name='metadata_checksum_type', + field=models.TextField(choices=[('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')]), + ), + migrations.AlterField( + model_name='rpmpublication', + name='package_checksum_type', + field=models.TextField(choices=[('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')]), + ), + migrations.AlterField( + model_name='rpmrepository', + name='metadata_checksum_type', + field=models.TextField(choices=[('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')], null=True), + ), + migrations.AlterField( + model_name='rpmrepository', + name='package_checksum_type', + field=models.TextField(choices=[('sha256', 'sha256'), ('sha384', 'sha384'), ('sha512', 'sha512')], null=True), + ), + ] diff --git a/pulp_rpm/tests/functional/api/test_publish.py b/pulp_rpm/tests/functional/api/test_publish.py index 3f260cca50..0cd886124a 100644 --- a/pulp_rpm/tests/functional/api/test_publish.py +++ b/pulp_rpm/tests/functional/api/test_publish.py @@ -663,14 +663,14 @@ def test_on_demand_specified_metadata_and_package_checksum_type( ): """Sync and publish an RPM repository and verify the checksum types.""" repomd_checksum_types, primary_checksum_types = get_checksum_types( - package_checksum_type="sha224", metadata_checksum_type="sha224", policy="on_demand" + package_checksum_type="sha384", metadata_checksum_type="sha384", policy="on_demand" ) for repomd_type, repomd_checksum_type in repomd_checksum_types.items(): - assert repomd_checksum_type == "sha224" + assert repomd_checksum_type == "sha384" for package, package_checksum_type in primary_checksum_types.items(): - # since none of the packages in question have sha224 checksums, the + # since none of the packages in question have sha384 checksums, the # checksums they do have will be used instead. In this case, sha256. assert package_checksum_type == "sha256" @@ -707,14 +707,14 @@ def test_immediate_specified_metadata_checksum_type(get_checksum_types): def test_immediate_specified_metadata_and_package_checksum_type(get_checksum_types): """Sync and publish an RPM repository and verify the checksum types.""" repomd_checksum_types, primary_checksum_types = get_checksum_types( - package_checksum_type="sha224", metadata_checksum_type="sha224", policy="immediate" + package_checksum_type="sha512", metadata_checksum_type="sha512", policy="immediate" ) for repomd_type, repomd_checksum_type in repomd_checksum_types.items(): - assert repomd_checksum_type == "sha224" + assert repomd_checksum_type == "sha512" for package, package_checksum_type in primary_checksum_types.items(): - assert package_checksum_type == "sha224" + assert package_checksum_type == "sha512" @pytest.mark.parallel