MCPcopy Create free account
hub / github.com/netlify/gotrue / Provider

Method Provider

api/external.go:296–316  ·  view source on GitHub ↗

Provider returns a Provider interface for the given name.

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

294
295// Provider returns a Provider interface for the given name.
296func (a *API) Provider(ctx context.Context, name string) (provider.Provider, error) {
297 config := a.getConfig(ctx)
298 name = strings.ToLower(name)
299
300 switch name {
301 case "bitbucket":
302 return provider.NewBitbucketProvider(config.External.Bitbucket)
303 case "github":
304 return provider.NewGithubProvider(config.External.Github)
305 case "gitlab":
306 return provider.NewGitlabProvider(config.External.Gitlab)
307 case "google":
308 return provider.NewGoogleProvider(config.External.Google)
309 case "facebook":
310 return provider.NewFacebookProvider(config.External.Facebook)
311 case "saml":
312 return provider.NewSamlProvider(config.External.Saml, a.db, getInstanceID(ctx))
313 default:
314 return nil, fmt.Errorf("Provider %s could not be found", name)
315 }
316}
317
318func (a *API) redirectErrors(handler apiHandler, w http.ResponseWriter, r *http.Request) {
319 ctx := r.Context()

Callers 2

OAuthProviderMethod · 0.95

Calls 8

getConfigMethod · 0.95
NewBitbucketProviderFunction · 0.92
NewGithubProviderFunction · 0.92
NewGitlabProviderFunction · 0.92
NewGoogleProviderFunction · 0.92
NewFacebookProviderFunction · 0.92
NewSamlProviderFunction · 0.92
getInstanceIDFunction · 0.85

Tested by

no test coverage detected