okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
b585313
main
1// MCP URL validation blocks embedded credentials and unsupported schemes even on trusted networks. 2import gleeunit/should 3 4@external ( erlang , "albedo_mcp" , "url_allowed" ) 5fn allowed ( url : String ) -> Bool 6 7pub fn mcp_http_trusted_network_test () -> Nil { 8allowed ( "http://100.64.0.19:8787/mcp" ) |> should . be_true 9allowed ( "http://nas.lan:8787/mcp" ) |> should . be_true 10allowed ( "https://mcp.example.com/mcp" ) |> should . be_true 11allowed ( "http://127.0.0.1:8787/mcp" ) |> should . be_true 12} 13 14pub fn mcp_url_rejects_embedded_credentials_and_invalid_schemes_test () -> Nil { 15allowed ( "http://user:secret@nas.lan/mcp" ) |> should . be_false 16allowed ( "http://nas.lan/mcp#fragment" ) |> should . be_false 17allowed ( "file:///tmp/server" ) |> should . be_false 18allowed ( "http:///missing-host" ) |> should . be_false 19}