-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Enabled and Enhanced Artifactory Detector #4207
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
base: main
Are you sure you want to change the base?
Enabled and Enhanced Artifactory Detector #4207
Conversation
badce59
to
3fd026a
Compare
@@ -26,14 +29,20 @@ var ( | |||
defaultClient = detectors.DetectorHttpClientWithNoLocalAddresses | |||
|
|||
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives. | |||
keyPat = regexp.MustCompile(`\b([a-zA-Z0-9]{73}|\b[a-zA-Z0-9]{64})`) | |||
keyPat = regexp.MustCompile(`\b([a-zA-Z0-9]{64,73})\b`) | |||
URLPat = regexp.MustCompile(`\b([A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])\.jfrog\.io)`) |
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.
Does ...(?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])...
need to be a non-capturing group? These might require slightly more computation but I can't tell why it's grouped.
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.
It ensures the endpoint has at least two alphanumeric characters, and it can be up to 63 characters long, allowing hyphens (-) in the middle
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.
Yes, but I'm not sure if it needs to be a non-capturing group, that's extra computation. \b([A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]\.jfrog\.io)
yields the same output without using one.
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 isn't a blocker or anything.
Description:
This PR enables Artifactory detector and enhances it
Checklist:
make test-community
)?make lint
this requires golangci-lint)?