-
Notifications
You must be signed in to change notification settings - Fork 94
Veles codecatalyst #1577
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?
Veles codecatalyst #1577
Conversation
fix: validator name
|
Note: In c1abfc7 I removed the |
| } | ||
|
|
||
| // Validate validates code AWS CodeCatalyst Git Basic Auth credentials. | ||
| func (v *Validator) Validate(ctx context.Context, secret Credentials) (veles.ValidationStatus, error) { |
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.
Can we use the simplevalidate library for this? I know we have a separate helper function here for setting up the HTTP request but maybe that can be turned into a simplevalidate.Validator that takes params from the codecatalyst package (e.g. which prefix to check for)
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.
that takes params from the codecatalyst package (e.g. which prefix to check for)
Yes, I could inject that logic into the EndpointFunc and return an error if the URL is not on the specific domain.
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.
In fe9c461 I've modified the logic to use the simplevalidate.Validator. I could also have created a gitvalidator in the gitbasicauth pkg but I think this is a nice in-between for now, since I’m not sure yet whether other providers share all the validation logic.
|
Hello @erikvarga , thanks for the review. I noticed that the That is due to a linter bug (fixed in #1541) where plugin registrations were only picked up if the package name differed from the function’s package. When two packages had the same name but different paths, the registrations weren’t detected. |
I see, thanks for fixing it. In that case we can just merge this PR after the plugger fixes have been merged. |
edit: convert the detector to a simpletoken.detector
This PR adds the logic to detect Amazon CodeCatalyst personal access tokens by introducing a Git Basic Auth detector.
It also introduce common logic for future git basic auth scanners for other git providers.