INNER CODE UNIT · Go
TestAuthDisabledRefusesNonLoopbackListener
chaitin/SafeLine · mcp_server/main_test.go:100
func TestAuthDisabledRefusesNonLoopbackListener(t *testing.T) {
configPath := filepath.Join(t.TempDir(), "config.yaml")
contents := `
server:
name: SafeLine MCP
version: 1.0.0
host: 0.0.0.0
port: 5678
logger:
level: info
instances:
- id: dev152
base_url: https://dev152:9443
token_file: /run/secrets/dev152_token
`
if err := os.WriteFile(configPath, []byte(contents), 0o600); err != nil {
t.Fatal(err)
}