@@ -331,14 +331,36 @@ func (c *Config) Sanitize() *Config {
331
331
panic (err )
332
332
}
333
333
334
- if c .HTTP .Auth != nil && c .HTTP .Auth .LDAP != nil && c .HTTP .Auth .LDAP .bindPassword != "" {
335
- sanitizedConfig .HTTP .Auth .LDAP = & LDAPConfig {}
334
+ // Sanitize HTTP config
335
+ if c .HTTP .Auth != nil {
336
+ // Sanitize LDAP bind password
337
+ if c .HTTP .Auth .LDAP != nil && c .HTTP .Auth .LDAP .bindPassword != "" {
338
+ sanitizedConfig .HTTP .Auth .LDAP = & LDAPConfig {}
336
339
337
- if err := DeepCopy (c .HTTP .Auth .LDAP , sanitizedConfig .HTTP .Auth .LDAP ); err != nil {
338
- panic (err )
340
+ if err := DeepCopy (c .HTTP .Auth .LDAP , sanitizedConfig .HTTP .Auth .LDAP ); err != nil {
341
+ panic (err )
342
+ }
343
+
344
+ sanitizedConfig .HTTP .Auth .LDAP .bindPassword = "******"
339
345
}
340
346
341
- sanitizedConfig .HTTP .Auth .LDAP .bindPassword = "******"
347
+ // Sanitize OpenID client secrets
348
+ if c .HTTP .Auth .OpenID != nil {
349
+ sanitizedConfig .HTTP .Auth .OpenID = & OpenIDConfig {
350
+ Providers : make (map [string ]OpenIDProviderConfig ),
351
+ }
352
+
353
+ for provider , config := range c .HTTP .Auth .OpenID .Providers {
354
+ sanitizedConfig .HTTP .Auth .OpenID .Providers [provider ] = OpenIDProviderConfig {
355
+ Name : config .Name ,
356
+ ClientID : config .ClientID ,
357
+ ClientSecret : "******" ,
358
+ KeyPath : config .KeyPath ,
359
+ Issuer : config .Issuer ,
360
+ Scopes : config .Scopes ,
361
+ }
362
+ }
363
+ }
342
364
}
343
365
344
366
if c .IsEventRecorderEnabled () {
0 commit comments