Fixed gitlab detector#4371
Conversation
shahzadhaider1
left a comment
There was a problem hiding this comment.
Minor (non-blocking) suggestions.
| for _, endpoint := range s.Endpoints() { | ||
| s1 := detectors.Result{ | ||
| DetectorType: detectorspb.DetectorType_Gitlab, | ||
| Raw: []byte(resMatch), |
There was a problem hiding this comment.
In a single data string, if we have 2 set of credentials and only 2nd endpoint is correct, it would not be possible to identify why one result is verified and the other is not.
| Raw: []byte(resMatch), | |
| Raw: []byte(resMatch), | |
| RawV2: []byte(resMatch + endpoint), | |
There was a problem hiding this comment.
I had considered this change but hesitated, concerned it might duplicate existing results in the Enterprise.
I think @rosecodym can comment better on this change.
There was a problem hiding this comment.
Yup, you're right. Raw/RawV2 is like a primary key, and updating it even slightly can have impacts on the enterprise data, so let's not touch that. Instead, we can store the endpoint in the extra data.
There was a problem hiding this comment.
This could cause problems in diagnosing issues later on in enterprise too. This just might require migration.
Also, I'm positive that "adding" a RawV2 won't require migration
@rosecodym awaiting your response.
There was a problem hiding this comment.
Yes, adding a RawV2 that wasn't there before is fine and won't affect the deduplication fingerprinting.
Changing Raw or RawV2 will cause issues though.
There was a problem hiding this comment.
Thanks @dustin-decker for the clarification - I updated the code.
amanfcp
left a comment
There was a problem hiding this comment.
LGTM! Thanks @kashifkhan0771
* Fixed gitlab detector * moved validations outside endpoints loop * resolved comments * resolved comments
Description:
Fixes: #4370
Checklist:
make test-community)?make lintthis requires golangci-lint)?