@@ -410,7 +410,7 @@ func ConvertConfig(entries []codersdk.ExternalAuthConfig, accessURL *url.URL) ([
410
410
// Applies defaults to the config entry.
411
411
// This allows users to very simply state that they type is "GitHub",
412
412
// apply their client secret and ID, and have the UI appear nicely.
413
- configDefaults (& entry )
413
+ applyDefaultsToConfig (& entry )
414
414
415
415
valid := httpapi .NameValid (entry .ID )
416
416
if valid != nil {
@@ -494,27 +494,27 @@ func ConvertConfig(entries []codersdk.ExternalAuthConfig, accessURL *url.URL) ([
494
494
}
495
495
496
496
// applyDefaultsToConfig applies defaults to the config entry.
497
- func configDefaults (config * codersdk.ExternalAuthConfig ) {
497
+ func applyDefaultsToConfig (config * codersdk.ExternalAuthConfig ) {
498
498
// If static defaults exist, apply them.
499
499
if defaults , ok := staticDefaults [codersdk .EnhancedExternalAuthProvider (config .Type )]; ok {
500
- applyDefaultsToConfig (config , defaults )
500
+ copyDefaultSettings (config , defaults )
501
501
return
502
502
}
503
503
504
504
// Dynamic defaults
505
505
switch codersdk .EnhancedExternalAuthProvider (config .Type ) {
506
506
case codersdk .EnhancedExternalAuthProviderBitBucketServer :
507
- applyDefaultsToConfig (config , bitbucketServerDefaults (config ))
507
+ copyDefaultSettings (config , bitbucketServerDefaults (config ))
508
508
return
509
509
default :
510
510
// No defaults for this type. We still want to run this apply with
511
511
// an empty set of defaults.
512
- applyDefaultsToConfig (config , codersdk.ExternalAuthConfig {})
512
+ copyDefaultSettings (config , codersdk.ExternalAuthConfig {})
513
513
return
514
514
}
515
515
}
516
516
517
- func applyDefaultsToConfig (config * codersdk.ExternalAuthConfig , defaults codersdk.ExternalAuthConfig ) {
517
+ func copyDefaultSettings (config * codersdk.ExternalAuthConfig , defaults codersdk.ExternalAuthConfig ) {
518
518
if config .AuthURL == "" {
519
519
config .AuthURL = defaults .AuthURL
520
520
}
0 commit comments