pulp / pulp/pulpcore

Add `build_context` parameter to `has_repo_or_repo_ver_param_model_or_obj_perms`

Open
#5,786 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

Is your feature request related to a problem? Please describe.
The has_repo_or_repo_ver_param_model_or_obj_perms function verifies only repository or repository_version as parameters. In pulp-container image build machinery, instead of repository_version, we are planning to add a field called build_context (where users would be passing a file repository_version href to be used as the build context of the image build process).

Describe the solution you'd like
Add support in has_repo_or_repo_ver_param_model_or_obj_perms to also validate the permissions based on build_context.

Describe alternatives you've considered
We thought about creating a new access condition function in pulp-container, but, to avoid the code repetition, maybe it would be better to keep using the pulpcore has_repo_or_repo_ver_param_model_or_obj_perms.
To workaround this "limitation" we are having to do something like:

data["repository_version"] = data["build_context"]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pulpcore/app/global_access_conditions.py at has_repo_or_repo_ver_param_model_or_obj_perms, linked in the issue. Trace how repository and repository_version parameters are validated, then add equivalent support for build_context while preserving the existing behavior. Done means permissions can be validated from build_context without the data workaround described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authorization
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.