News for hackers. Stuff that matters.
Re:How We Turn Authorization Logic into SQL by eatonphil on Tuesday November 23, 2021 @03:00PM (#29322578)
Are there any policy-language-libraries-backed-by-sql like Polar but that aren't based on logic programming languages? I don't really want to learn logic programming for this purpose nor do I want to require it on my coworkers.

I guess I'm just looking for a library + SQL shorthand that can easily interpolate request variables and session variables that gets declared in code where a route is declared. Just spitballing but something like `(blogs.id = $req.blogid).userid = $session.userid OR (users.id = $session.userid).isAdmin`.

This [0] is close but it doesn't have enough momentum to be well documented let alone usable as a library in every language you'd want (Go, C#, Python, Node.js, etc.).

Edit: Maybe OPA/Rego can in fact do this [1].

[0] https://github.com/mrumkovskis/tresql

[1] https://blog.openpolicyagent.org/write-policy-in-opa-enforce...

Re:How We Turn Authorization Logic into SQL by evancordell on Tuesday November 23, 2021 @04:45PM (#29323963)
Rego is a nice language to use (IMO), but also has roots in logic programming and is closer to datalog than SQL.
Re:How We Turn Authorization Logic into SQL by nicoburns on Tuesday November 23, 2021 @04:29PM (#29323806)
What advantage would this have over a middleware that implements this logic as a lambda?