MCPcopy Index your code
hub / github.com/coder/coder / Git

Method Git

coderd/externalauth/externalauth.go:150–156  ·  view source on GitHub ↗

Git returns a Provider for this config if the provider type is a supported git hosting provider. Returns (nil, nil) for non-git providers (e.g. Slack, JFrog). Returns a non-nil error if provider construction fails.

(client *http.Client)

Source from the content-addressed store, hash-verified

148// providers (e.g. Slack, JFrog). Returns a non-nil error if provider
149// construction fails.
150func (c *Config) Git(client *http.Client) (gitprovider.Provider, error) {
151 norm := strings.ToLower(c.Type)
152 if !codersdk.EnhancedExternalAuthProvider(norm).Git() {
153 return nil, nil //nolint:nilnil // nil provider means non-git type, not an error
154 }
155 return gitprovider.New(norm, c.APIBaseURL, client)
156}
157
158// GenerateTokenExtra generates the extra token data to store in the database.
159func (c *Config) GenerateTokenExtra(token *oauth2.Token) (pqtype.NullRawMessage, error) {

Callers 3

resolveExternalAuthMethod · 0.45
GetManifestMethod · 0.45

Calls 2

NewFunction · 0.92

Tested by

no test coverage detected