@@ -481,92 +481,6 @@ func TestValidateEmbeddingServer(t *testing.T) {
481481 }
482482}
483483
484- func TestValidateAuthServerConfig (t * testing.T ) {
485- t .Parallel ()
486-
487- tests := []struct {
488- name string
489- server * VirtualMCPServer
490- expectError bool
491- errContains string
492- }{
493- {
494- name : "nil_config_passes" ,
495- server : & VirtualMCPServer {
496- Spec : VirtualMCPServerSpec {
497- Config : config.Config {Group : "test-group" },
498- },
499- },
500- },
501- {
502- name : "valid_config_passes" ,
503- server : & VirtualMCPServer {
504- Spec : VirtualMCPServerSpec {
505- Config : config.Config {Group : "test-group" },
506- AuthServerConfig : & EmbeddedAuthServerConfig {
507- Issuer : "http://localhost:9090" ,
508- UpstreamProviders : []UpstreamProviderConfig {
509- {
510- Name : "test" ,
511- Type : UpstreamProviderTypeOIDC ,
512- OIDCConfig : & OIDCUpstreamConfig {
513- IssuerURL : "https://accounts.google.com" ,
514- ClientID : "test-client" ,
515- },
516- },
517- },
518- },
519- },
520- },
521- },
522- {
523- name : "empty_issuer_errors" ,
524- server : & VirtualMCPServer {
525- Spec : VirtualMCPServerSpec {
526- Config : config.Config {Group : "test-group" },
527- AuthServerConfig : & EmbeddedAuthServerConfig {
528- Issuer : "" ,
529- UpstreamProviders : []UpstreamProviderConfig {
530- {Name : "test" , Type : UpstreamProviderTypeOIDC },
531- },
532- },
533- },
534- },
535- expectError : true ,
536- errContains : "spec.authServerConfig.issuer is required" ,
537- },
538- {
539- name : "no_upstreams_errors" ,
540- server : & VirtualMCPServer {
541- Spec : VirtualMCPServerSpec {
542- Config : config.Config {Group : "test-group" },
543- AuthServerConfig : & EmbeddedAuthServerConfig {
544- Issuer : "http://localhost:9090" ,
545- },
546- },
547- },
548- expectError : true ,
549- errContains : "spec.authServerConfig.upstreamProviders is required" ,
550- },
551- }
552-
553- for _ , tt := range tests {
554- t .Run (tt .name , func (t * testing.T ) {
555- t .Parallel ()
556-
557- err := tt .server .Validate ()
558- if tt .expectError {
559- require .Error (t , err )
560- if tt .errContains != "" {
561- assert .Contains (t , err .Error (), tt .errContains )
562- }
563- return
564- }
565- require .NoError (t , err )
566- })
567- }
568- }
569-
570484func TestVirtualMCPServerSpecScalingFieldsJSONRoundtrip (t * testing.T ) {
571485 t .Parallel ()
572486
@@ -621,4 +535,3 @@ func TestVirtualMCPServerSpecScalingFieldsJSONRoundtrip(t *testing.T) {
621535 })
622536 }
623537}
624-
0 commit comments