@@ -614,6 +614,53 @@ def test_dump_configuration_with_more_mcp_servers(tmp_path) -> None:
614614 ]
615615
616616
617+ def test_authentication_configuration_in_config () -> None :
618+ """Test the authentication configuration in main config."""
619+ cfg = Configuration (
620+ name = "test_name" ,
621+ service = ServiceConfiguration (),
622+ llama_stack = LlamaStackConfiguration (
623+ use_as_library_client = True ,
624+ library_client_config_path = "tests/configuration/run.yaml" ,
625+ ),
626+ user_data_collection = UserDataCollection (
627+ feedback_enabled = False , feedback_storage = None
628+ ),
629+ mcp_servers = [],
630+ )
631+ assert cfg .authentication is not None
632+ assert cfg .authentication .module == AUTH_MOD_NOOP
633+ assert cfg .authentication .skip_tls_verification is False
634+ assert cfg .authentication .k8s_ca_cert_path is None
635+ assert cfg .authentication .k8s_cluster_api is None
636+
637+ cfg2 = Configuration (
638+ name = "test_name" ,
639+ service = ServiceConfiguration (),
640+ llama_stack = LlamaStackConfiguration (
641+ use_as_library_client = True ,
642+ library_client_config_path = "tests/configuration/run.yaml" ,
643+ ),
644+ user_data_collection = UserDataCollection (
645+ feedback_enabled = False , feedback_storage = None
646+ ),
647+ mcp_servers = [],
648+ authentication = AuthenticationConfiguration (
649+ module = AUTH_MOD_K8S ,
650+ skip_tls_verification = True ,
651+ k8s_ca_cert_path = "tests/configuration/server.crt" ,
652+ k8s_cluster_api = None ,
653+ ),
654+ )
655+ assert cfg2 .authentication is not None
656+ assert cfg2 .authentication .module == AUTH_MOD_K8S
657+ assert cfg2 .authentication .skip_tls_verification is True
658+ assert cfg2 .authentication .k8s_ca_cert_path == Path (
659+ "tests/configuration/server.crt"
660+ )
661+ assert cfg2 .authentication .k8s_cluster_api is None
662+
663+
617664def test_authentication_configuration () -> None :
618665 """Test the AuthenticationConfiguration constructor."""
619666
0 commit comments