logoalt Hacker News

thegagne • today at 5:49 AM • 2 replies • view on HN

Cool!

I did look for “url” on that page and came up empty, then read it with my own eyes and didn’t see it, and even passed it to Claude and it also couldn’t find an answer for my query:

> Take a look at and see if there’s a way to limit fetching from a particular hostname over https. https://march-lang.org/docs/capabilities

What I would like to be able to do is to say “only let this imported function talk to https://example.com/*”, and deny any tcp connections other than the dns lookup and https calls to that domain.


Replies

ch4s3 • today at 3:16 PM

I have a draft PR open to enable something like

mod A do

  needs IO.NetConnect("example.com")
end

mod B do

  needs IO.NetConnect("foo.com", no_redirects)
end

Where A can call "example.com" but not "foo.com".

ch4s3 • today at 1:13 PM

Sorry the docs aren’t 100% there yet, the language is still pre-1.0. You can do that but it’s not as well supported as file paths, but will be by 1.0.