-
Notifications
You must be signed in to change notification settings - Fork 49
Add support to vuln report for pulp_python plugin #1273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
git-hyagi
wants to merge
1
commit into
pulp:main
Choose a base branch
from
git-hyagi:add-vuln-report
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Added support to vulnerability report for pulp_python plugin. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import click | ||
| from pulp_glue.common.i18n import get_translation | ||
| from pulp_glue.core.context import PulpVulnerabilityReportContext | ||
|
|
||
| from pulpcore.cli.common.generic import ( | ||
| PulpCLIContext, | ||
| href_option, | ||
| list_command, | ||
| pass_pulp_context, | ||
| pulp_group, | ||
| show_command, | ||
| ) | ||
|
|
||
| translation = get_translation(__package__) | ||
| _ = translation.gettext | ||
|
|
||
| lookup_options = [href_option] | ||
|
|
||
|
|
||
| @pulp_group() | ||
| @pass_pulp_context | ||
| @click.pass_context | ||
| def vulnerability_report(ctx: click.Context, pulp_ctx: PulpCLIContext, /) -> None: | ||
| ctx.obj = PulpVulnerabilityReportContext(pulp_ctx) | ||
|
|
||
|
|
||
| vulnerability_report.add_command(list_command()) | ||
| vulnerability_report.add_command(show_command(decorators=lookup_options)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -eu | ||
| # shellcheck source=tests/scripts/config.source | ||
| . "$(dirname "$(dirname "$(realpath "$0")")")"/config.source | ||
|
|
||
| cleanup() { | ||
| pulp python repository destroy --name python || true | ||
| pulp python remote destroy --name python || true | ||
| pulp file repository destroy --name file-repo || true | ||
| pulp orphan cleanup --protection-time=0 | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| pulp debug has-plugin --name "core" --specifier ">=3.85.3" || exit 0 | ||
| pulp debug has-plugin --name "python" --specifier ">=3.21.0" || exit 0 | ||
|
|
||
| # create a test repository | ||
| pulp python repository create --name python | ||
| pulp python remote create --name python --url "https://pypi.org/" --includes '["django==5.2.1"]' | ||
| pulp python repository sync --name python --remote python | ||
|
|
||
| expect_succ pulp python repository version scan --repository python | ||
| VULN_REPORT=$(echo "$OUTPUT" | jq .pulp_href -r) | ||
| expect_succ pulp vulnerability-report show --href "$VULN_REPORT" | ||
|
|
||
| # test with non-implemented content type | ||
| pulp file repository create --name file-repo | ||
| expect_fail pulp file repository version scan --repository file-repo | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should move to pulp_python.