@@ -371,27 +371,6 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
371
371
return xerrors .Errorf ("parse ssh keygen algorithm %s: %w" , cfg .SSHKeygenAlgorithm .Value , err )
372
372
}
373
373
374
- // Validate provided auto-import templates.
375
- var (
376
- validatedAutoImportTemplates = make ([]coderd.AutoImportTemplate , len (cfg .AutoImportTemplates .Value ))
377
- seenValidatedAutoImportTemplates = make (map [coderd.AutoImportTemplate ]struct {}, len (cfg .AutoImportTemplates .Value ))
378
- )
379
- for i , autoImportTemplate := range cfg .AutoImportTemplates .Value {
380
- var v coderd.AutoImportTemplate
381
- switch autoImportTemplate {
382
- case "kubernetes" :
383
- v = coderd .AutoImportTemplateKubernetes
384
- default :
385
- return xerrors .Errorf ("auto import template %q is not supported" , autoImportTemplate )
386
- }
387
-
388
- if _ , ok := seenValidatedAutoImportTemplates [v ]; ok {
389
- return xerrors .Errorf ("auto import template %q is specified more than once" , v )
390
- }
391
- seenValidatedAutoImportTemplates [v ] = struct {}{}
392
- validatedAutoImportTemplates [i ] = v
393
- }
394
-
395
374
defaultRegion := & tailcfg.DERPRegion {
396
375
EmbeddedRelay : true ,
397
376
RegionID : cfg .DERP .Server .RegionID .Value ,
@@ -449,7 +428,6 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
449
428
SSHKeygenAlgorithm : sshKeygenAlgorithm ,
450
429
TracerProvider : tracerProvider ,
451
430
Telemetry : telemetry .NewNoop (),
452
- AutoImportTemplates : validatedAutoImportTemplates ,
453
431
MetricsCacheRefreshInterval : cfg .MetricsCacheRefreshInterval .Value ,
454
432
AgentStatsRefreshInterval : cfg .AgentStatRefreshInterval .Value ,
455
433
DeploymentConfig : cfg ,
@@ -526,8 +504,9 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
526
504
Verifier : oidcProvider .Verifier (& oidc.Config {
527
505
ClientID : cfg .OIDC .ClientID .Value ,
528
506
}),
529
- EmailDomain : cfg .OIDC .EmailDomain .Value ,
530
- AllowSignups : cfg .OIDC .AllowSignups .Value ,
507
+ EmailDomain : cfg .OIDC .EmailDomain .Value ,
508
+ AllowSignups : cfg .OIDC .AllowSignups .Value ,
509
+ UsernameField : cfg .OIDC .UsernameField .Value ,
531
510
}
532
511
}
533
512
0 commit comments