| 602 | } |
| 603 | |
| 604 | func (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. |
| 623 | func (db *DatabaseContext) _stopOnlineProcesses(ctx context.Context) { |