| 149 | } |
| 150 | |
| 151 | func (g *Gitlab) ValidateConfig(conf core.Configuration) error { |
| 152 | if v, ok := conf[core.ConfigKeyTarget]; !ok { |
| 153 | return fmt.Errorf("missing %s key", core.ConfigKeyTarget) |
| 154 | } else if v != target { |
| 155 | return fmt.Errorf("unexpected target name: %v", v) |
| 156 | } |
| 157 | if _, ok := conf[confKeyGitlabBaseUrl]; !ok { |
| 158 | return fmt.Errorf("missing %s key", confKeyGitlabBaseUrl) |
| 159 | } |
| 160 | if _, ok := conf[confKeyProjectID]; !ok { |
| 161 | return fmt.Errorf("missing %s key", confKeyProjectID) |
| 162 | } |
| 163 | if _, ok := conf[confKeyDefaultLogin]; !ok { |
| 164 | return fmt.Errorf("missing %s key", confKeyDefaultLogin) |
| 165 | } |
| 166 | |
| 167 | return nil |
| 168 | } |
| 169 | |
| 170 | func promptTokenOptions(repo repository.RepoKeyring, login, baseUrl string) (auth.Credential, error) { |
| 171 | creds, err := auth.List(repo, |