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

Method GetProviderForIssuer

auth/oidc.go:217–233  ·  view source on GitHub ↗
(ctx context.Context, issuer string, audiences []string)

Source from the content-addressed store, hash-verified

215}
216
217func (opm OIDCProviderMap) GetProviderForIssuer(ctx context.Context, issuer string, audiences []string) *OIDCProvider {
218 base.DebugfCtx(ctx, base.KeyAuth, "GetProviderForIssuer with issuer: %v, audiences: %+v", base.UD(issuer), base.UD(audiences))
219 for _, provider := range opm {
220 clientID := base.ValDefault(provider.ClientID, "")
221 if provider.Issuer == issuer && clientID != "" {
222 // Iterate over the audiences looking for a match
223 for _, aud := range audiences {
224 if clientID == aud {
225 base.DebugfCtx(ctx, base.KeyAuth, "Provider matches, returning")
226 return provider
227 }
228 }
229 }
230 }
231 base.InfofCtx(ctx, base.KeyAuth, "No provider match found")
232 return nil
233}
234
235// Stop stops all the provider discovery sync task by terminating the async goroutines.
236func (opm OIDCProviderMap) Stop() {

Calls 4

DebugfCtxFunction · 0.92
UDFunction · 0.92
ValDefaultFunction · 0.92
InfofCtxFunction · 0.92

Tested by 1