MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / setProviderDefaults

Method setProviderDefaults

providers/provider_data.go:214–228  ·  view source on GitHub ↗
(defaults providerDefaults)

Source from the content-addressed store, hash-verified

212}
213
214func (p *ProviderData) setProviderDefaults(defaults providerDefaults) {
215 p.ProviderName = defaults.name
216 p.LoginURL = defaultURL(p.LoginURL, defaults.loginURL)
217 p.RedeemURL = defaultURL(p.RedeemURL, defaults.redeemURL)
218 p.ProfileURL = defaultURL(p.ProfileURL, defaults.profileURL)
219 p.ValidateURL = defaultURL(p.ValidateURL, defaults.validateURL)
220
221 if p.Scope == "" {
222 p.Scope = defaults.scope
223 }
224
225 if p.UserClaim == "" {
226 p.UserClaim = oidcUserClaim
227 }
228}
229
230// defaultURL will set return a default value if the given value is not set.
231func defaultURL(u *url.URL, d *url.URL) *url.URL {

Callers 15

NewNextcloudProviderFunction · 0.80
NewSourceHutProviderFunction · 0.80
NewFacebookProviderFunction · 0.80
NewBitbucketProviderFunction · 0.80
NewKeycloakProviderFunction · 0.80
NewADFSProviderFunction · 0.80
NewGitHubProviderFunction · 0.80
NewLoginGovProviderFunction · 0.80
NewAzureProviderFunction · 0.80
NewOIDCProviderFunction · 0.80
NewGitLabProviderFunction · 0.80
NewDigitalOceanProviderFunction · 0.80

Calls 1

defaultURLFunction · 0.85

Tested by

no test coverage detected