Skip to content
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

Backport Migration Option AuthToken #13101

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
4 line diff
  • Loading branch information
6543 committed Oct 11, 2020
commit 19f27e1f295577ff043dc6a63504a4ce92bfb403
4 changes: 1 addition & 3 deletions modules/migrations/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ type GitlabDownloader struct {
// Use either a username/password, personal token entered into the username field, or anonymous/public access
// Note: Public access only allows very basic access
func NewGitlabDownloader(baseURL, repoPath, username, password, token string) *GitlabDownloader {
var gitlabClient *gitlab.Client
var err error
gitlabClient, err = gitlab.NewClient(token, gitlab.WithBaseURL(baseURL))
gitlabClient, err := gitlab.NewClient(token, gitlab.WithBaseURL(baseURL))
// Only use basic auth if token is blank and password is NOT
// Basic auth will fail with empty strings, but empty token will allow anonymous public API usage
if token == "" && password != "" {
Expand Down