Project

Profile

Help

Issue #2191

closed

The RPM rsync distributor's "predistributor_id" config option isn't validated

Added by Ichimonji10 almost 8 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
2.10.0
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Let's say I decide to create an RPM repository with a yum importer, yum distributor and RPM rsync distributor. To do so, I might submit an HTTP POST request to /pulp/api/v2/repositories/ with the following payload:

{
    "importer_type_id": "yum_importer",
    "importer_config": {
        "feed": "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm/"
    },
    "notes": {
        "_repo-type": "rpm-repo"
    },
    "id": "4818bdb8-1fc8-44e8-8504-231466a057f1",
    "distributors": [
        {
            "distributor_config": {
                "http": true,
                "relative_url": "c23ae706-d9f9-4740-aecd-4bbb2bfde953/",
                "https": true
            },
            "distributor_id": "d2160bbe-ba12-4079-bf61-2c898337780a",
            "distributor_type_id": "yum_distributor",
            "auto_publish": false
        },
        {
            "distributor_config": {
                "predistributor_id": "d8e6da36-0552-422d-9c9f-1802e4c10b5f",
                "remote": {
                    "root": "/home/a8333f9e-027",
                    "host": "example.com",
                    "ssh_user": "a8333f9e-027",
                    "ssh_identity_file": "/27f14dc8-3562-4065-ad1d-b5827522b5c2"
                }
            },
            "distributor_id": "a6658d24-2bde-4f85-8afd-5dfe45d53527",
            "distributor_type_id": "rpm_rsync_distributor"
        }
    ]
}

The RPM rsync distributor must reference the yum distributor via the "predistributor_id" option. However, in the example payload above, this reference is broken. Pulp accepts this payload anyway and will create the repository, importer and distributors.

Pulp should verify this relation when processing the request. This will prevent mysterious errors from occurring later when a user decides to perform a publish. Providing immediate feedback to the user also makes the application more user-friendly.

Also available in: Atom PDF