aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab/config.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-07-17 22:41:42 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-07-23 17:18:04 +0200
commitce3a2788ab3bc9f205bcc27b03355155d641c2f4 (patch)
tree6565bce7af28395e0a244e363b387865bc85e557 /bridge/gitlab/config.go
parent05a3aec1a89f1b8c56a464558bbe39f96a42b267 (diff)
downloadgit-bug-ce3a2788ab3bc9f205bcc27b03355155d641c2f4.tar.gz
bridge/gitlab: fix note error handling bug
bridge/gitlab: remove unused functions
Diffstat (limited to 'bridge/gitlab/config.go')
-rw-r--r--bridge/gitlab/config.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/bridge/gitlab/config.go b/bridge/gitlab/config.go
index 7faddd6d..cac2d91e 100644
--- a/bridge/gitlab/config.go
+++ b/bridge/gitlab/config.go
@@ -107,21 +107,6 @@ func (*Gitlab) ValidateConfig(conf core.Configuration) error {
return nil
}
-func requestToken(client *gitlab.Client, userID int, name string, scopes ...string) (string, error) {
- impToken, _, err := client.Users.CreateImpersonationToken(
- userID,
- &gitlab.CreateImpersonationTokenOptions{
- Name: &name,
- Scopes: &scopes,
- },
- )
- if err != nil {
- return "", err
- }
-
- return impToken.Token, nil
-}
-
func promptToken() (string, error) {
fmt.Println("You can generate a new token by visiting https://gitlab.com/settings/tokens.")
fmt.Println("Choose 'Generate new token' and set the necessary access scope for your repository.")
@@ -231,28 +216,6 @@ func getValidGitlabRemoteURLs(remotes map[string]string) []string {
return urls
}
-func validateUsername(username string) (bool, int, error) {
- // no need for a token for this action
- client := buildClient("")
-
- users, _, err := client.Users.ListUsers(&gitlab.ListUsersOptions{Username: &username})
- if err != nil {
- return false, 0, err
- }
-
- if len(users) == 0 {
- return false, 0, fmt.Errorf("username not found")
- } else if len(users) > 1 {
- return false, 0, fmt.Errorf("found multiple matches")
- }
-
- if users[0].Username == username {
- return true, users[0].ID, nil
- }
-
- return false, 0, nil
-}
-
func validateProjectURL(url, token string) (bool, int, error) {
client := buildClient(token)