MCPcopy Index your code
hub / github.com/git-bug/git-bug / ValidateConfig

Method ValidateConfig

bridge/gitlab/config.go:151–168  ·  view source on GitHub ↗
(conf core.Configuration)

Source from the content-addressed store, hash-verified

149}
150
151func (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
170func promptTokenOptions(repo repository.RepoKeyring, login, baseUrl string) (auth.Credential, error) {
171 creds, err := auth.List(repo,

Callers 1

ConfigureMethod · 0.95

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected