-
Notifications
You must be signed in to change notification settings - Fork 565
feat(java): support user-defined Maven mirrors in trivy.yaml #11006
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
DmitriyLewen
wants to merge
16
commits into
aquasecurity:main
Choose a base branch
from
DmitriyLewen:maven-central-mirror-trivy-config
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 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a583f30
feat(java): apply config-file Maven mirrors in the pom parser
DmitriyLewen 0283653
feat(flag): add scan.maven.mirrors config option
DmitriyLewen b406c3c
feat(java): wire scan.maven.mirrors to the pom analyzer
DmitriyLewen 6e8c620
docs(java): document scan.maven.mirrors
DmitriyLewen c8611d5
feat(flag): reject non-absolute Maven mirror URLs
DmitriyLewen 283355f
refactor(java): simplify pom mirror comments and drop redundant debug…
DmitriyLewen 3ca9d19
test: refactor and dedupe Maven mirror tests
DmitriyLewen 48fa082
test(java): merge resolveMirrors settings and config-file cases
DmitriyLewen 017028b
test(java): build TestParser_mirrorFor inputs via resolveMirrors
DmitriyLewen 2e8edf5
chore(java): fix golangci-lint issues (gci import order, map make)
DmitriyLewen 405a8a4
fix(flag): restrict Maven mirror URLs to http/https
DmitriyLewen 1b5aec6
fix(java): fall back to the next mirror on 429 instead of aborting
DmitriyLewen b43e591
fix(flag): reject empty Maven mirror target lists
DmitriyLewen 77e2a0f
refactor(flag): configure Maven mirrors as a list instead of a map
DmitriyLewen 0bb1700
fix(java): ignore credentials and host case when matching Maven mirrors
DmitriyLewen 07b1cf7
refactor(java): use errors.AsType for the rate limit check
DmitriyLewen 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
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
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
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.
nit:
TrimRightonly removes trailing slashes; it does not normalize./,../, or repeated slashes, and it can also remove a slash from the query or fragment. Would normalizingu.Pathwithpath.Clean, or usingu.JoinPath("."), be appropriate here? Trivy already normalizes the repository base withpath.Joinwhen constructing artifact URLs, so applying the same path semantics to mirror keys seems reasonable. This is not general URL canonicalization, since servers may distinguish/repofrom/repo/, as well as repeated slashes.RawPathand percent-encoding may also need a quick check, but this may be more than this PR needs, so I'll leave the final decision to you.