mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Adding baseurl flag to allow self-hosted GitLab/GitHub servers
This commit is contained in:
1 parent
ef38b69c39
commit
c5e1e8abc0
3 files changed
+25
-2
No files matched your search
+10
-1
@@ -23,11 +23,20 @@ type Gitlab struct {
|
||||
// NewGitlabClient accepts a manager struct and returns a Gitlab host pointer which will be used to
|
||||
// perform a gitlab audit on an group or user.
|
||||
func NewGitlabClient(m manager.Manager) *Gitlab {
|
||||
return &Gitlab{
|
||||
gitlabClient := &Gitlab{
|
||||
manager: m,
|
||||
ctx: context.Background(),
|
||||
client: gitlab.NewClient(nil, options.GetAccessToken(m.Opts)),
|
||||
}
|
||||
|
||||
if m.Opts.BaseURL != "" {
|
||||
err := gitlabClient.client.SetBaseURL(m.Opts.BaseURL)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
return gitlabClient
|
||||
}
|
||||
|
||||
// Audit will audit a github user or organization's repos.
|
||||
|
||||
Reference in new issue
Block a user