MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / GetOIDCProvider

Method GetOIDCProvider

db/database.go:604–620  ·  view source on GitHub ↗
(providerName string)

Source from the content-addressed store, hash-verified

602}
603
604func (context *DatabaseContext) GetOIDCProvider(providerName string) (*auth.OIDCProvider, error) {
605
606 // If providerName isn't specified, check whether there's a default provider
607 if providerName == "" {
608 provider := context.OIDCProviders.GetDefaultProvider()
609 if provider == nil {
610 return nil, errors.New("No default provider available.")
611 }
612 return provider, nil
613 }
614
615 if provider, ok := context.OIDCProviders[providerName]; ok {
616 return provider, nil
617 } else {
618 return nil, base.RedactErrorf("No provider found for provider name %q", base.MD(providerName))
619 }
620}
621
622// _stopOnlineProcesses is called to represent an error condition from startOnlineProcesses, or from DatabaseContext.Close. Most of the objects are not safe to close twice, since they have internal terminator objects and goroutines that wait on closed channels. Acquire the bucket lock, to avoid calling this function multiple times.
623func (db *DatabaseContext) _stopOnlineProcesses(ctx context.Context) {

Callers 2

getOIDCProviderMethod · 0.80
TestGetOIDCProviderFunction · 0.80

Calls 3

RedactErrorfFunction · 0.92
MDFunction · 0.92
GetDefaultProviderMethod · 0.80

Tested by 1

TestGetOIDCProviderFunction · 0.64