Skip to content

Adds synchronous RPM Upload API#4034

Merged
dralley merged 1 commit intopulp:mainfrom
dkliban:4027
Jul 1, 2025
Merged

Adds synchronous RPM Upload API#4034
dralley merged 1 commit intopulp:mainfrom
dkliban:4027

Conversation

@dkliban
Copy link
Copy Markdown
Member

@dkliban dkliban commented Jul 1, 2025

closes: #4027

@dkliban dkliban force-pushed the 4027 branch 2 times, most recently from 2bce299 to 9b28308 Compare July 1, 2025 15:28
Comment thread pulp_rpm/app/serializers/package.py Outdated
@dkliban dkliban force-pushed the 4027 branch 3 times, most recently from 716fdf3 to ff944ee Compare July 1, 2025 18:10
Copy link
Copy Markdown
Contributor

@dralley dralley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK.. @ggainey any other thoughts?

Copy link
Copy Markdown
Contributor

@ggainey ggainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get the test modified to use a user that has only the required permissions? The test currently runs as "admin", so we're not testing the RBAC work here.

@dkliban dkliban force-pushed the 4027 branch 2 times, most recently from a9bbe13 to ad137ba Compare July 1, 2025 20:34

LOCKED_ROLES = {
"rpm.rpm_package_uploader": [
"rpm.upload_rpm_packages",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

file_to_upload.write(requests.get(file_to_use).content)
upload_attrs = {"file": file_to_upload.name, "pulp_labels": labels}
rpm_package_api.upload(**upload_attrs)
assert ctx.value.status == 403
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# Single unit upload
file_to_use = os.path.join(RPM_UNSIGNED_FIXTURE_URL, RPM_PACKAGE_FILENAME)

with gen_user(model_roles=["rpm.rpm_package_uploader"]):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dralley dralley merged commit cd32dc4 into pulp:main Jul 1, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As a user, I can upload RPMs synchronously

3 participants