News for hackers. Stuff that matters.
Re:Datasette’s new JSON write API: The first alpha of Datase... by pedrovhb on Friday December 02, 2022 @08:24PM (#33839299)
Or a bit more generically, having a configurable allowlist of hosts, so I can make my ESP32 just a dumb "sensors on a microcontroller" thing pushing data to a RPi on my local home network, which has static IPs provided to certain devices via DHCP. Having to add an auth header isn't a great deal of work, but it'd be handy to be able to try things out quickly. IMO the great thing about all this is how frictionless it is.
Re:Datasette’s new JSON write API: The first alpha of Datase... by simonw on Friday December 02, 2022 @08:32PM (#33839345)
I like that: I can have a thing where you can provide "localhost" but can also provide other host names and IPs too.
Re:Datasette’s new JSON write API: The first alpha of Datase... by vorpalhex on Friday December 02, 2022 @11:45PM (#33840688)
That approach also makes things more docker friendly.
Re:Datasette’s new JSON write API: The first alpha of Datase... by tlarkworthy on Saturday December 03, 2022 @02:17AM (#33841443)
Unfortunately the host header is spoofable
Re:Datasette’s new JSON write API: The first alpha of Datase... by simonw on Saturday December 03, 2022 @02:25AM (#33841488)
You mean the HTTP host header?

Yeah that's a good call: I need to do these checks only based on IP.

I could allow users to enter host names which I would resolve to the IP before checking though, which matches how networking is used in things like Kubernetes.