News for hackers. Stuff that matters.
Re:Need Postgresql HTTP API Extension by michaelt on Sunday September 21, 2014 @02:20PM (#8347835)

  How does using HTTP preclude that?
Well, some of the discussion suggests client apps (web browsers, mobile apps etc) can talk directly to the database server, and the traditional database server security model is at the table level.

So if I had insert and delete permissions on the Hacker News comments table to insert or delete my own posts, I could insert and delete every user's posts.

It's possible to imagine hacks that might work around this problem (e.g. comments-table-per-user, or liberal use of stored procedures) but none of them sound like particularly good ideas.

Re:Need Postgresql HTTP API Extension by dragonwriter on Monday September 22, 2014 @01:30PM (#8351514)
> the traditional database server security model is at the table level.

Actually, many RDBMSs (postgres included) provide security at the command, relation (table/view), and column level.

With that, and appropriate view definitions and triggers, you can essentially as fine-grained permissions as you'd like. We manage this all client side because while much of the theory of this has been around for servers and held up as the ideal model since very early in the RDBMS era, a lot of the necessary features were not implemented in many servers (or implemented so wildly inconsistently between servers as to make practical, rather than theoretical, knowledge sharing in the community difficult.) That's less true now, though it still requires implementation-specific knowledge for the SQL implementation you are using.

Re:Need Postgresql HTTP API Extension by imanaccount247 on Sunday September 21, 2014 @08:05PM (#8348748)
You are inventing the problem you want to exist. The traditional database server security model does not allow any application users to have permissions to any tables at all, only views and stored procedures.
Re:Need Postgresql HTTP API Extension by fat0wl on Monday September 22, 2014 @09:49AM (#8350510)
i don't think this is a valid counterargument -- even if access is only given to views / stored procs you would have the same issue of a client connection directly to the HTTP api having too coarse-grained security privileges since they could be executed with any input params (unless there was some kindof extra security layer spanning front-end to db layer? sounds crazy)

but this could be a moot point as long as db communication is only done server-side so it can be behind company firewall anyway -- after all, isn't that why the current db security model works? No one should EVER post ajax to the db, essentially. & i dont think anyone is suggesting that, i hope

Re:Need Postgresql HTTP API Extension by imanaccount247 on Monday September 22, 2014 @02:21PM (#8351740)
I don't know how to make it any clearer. You connect as user A. You authenticate. You can only do things user A is given permission to do. Yes, people are suggesting talking directly to the DB. We want that because we already use our DB this way anyways, but we have to have a completely unnecessary web layer sitting in front of it just to pass the request directly back to the database without doing anything to it.