Closed jmks closed 6 months ago
@jmks Thanks a lot for working on this! It's indeed a high demanded feature.
I'll try to take, a look as soon as I can (can take a little while though).
Regarding the tests, if you running them against a Postgresql server started in a Docker container, you need to set the sslmode
setting to disable
(export PGSSLMODE=disable
for example)
You can see here how it's configured for Travis and I use the same script manually with the docker-compose.yml to start Postgres:
cd tests/
docker-compose up -d
source switch_superuser.sh
# run the tests
@cyrilgdn Ahh. The README mentioned a tests/env.sh
but I see its contents were moved around now. Thanks!
@cyrilgdn Ahh. The README mentioned a
tests/env.sh
but I see its contents were moved around now. Thanks!
Yes, recently but indeed I forgot to update the README :facepalm: , I'll fix it.
OK, I got the acceptance tests running now.
I'm realizing pulling the tables / table-level privileges information from the database is trickier than I thought. I may need a couple days to go through that.
Hey @cyrilgdn
I finally got an Acceptance test working. It turns out when they fail, it may indicate something is wrong 😄
A couple design issues that came up:
To read the privileges for particular tables, I needed a lot of metadata from the resource Id
.
Id
, so I went with that approach.A lot of changes to this resource for tables.
It seems to do what I expect locally (revoke all then grant, in all cases), so think it can be reviewed now.
Related to #85
I have the use-case of granting specific privileges to specific tables (and others seemed interested as well, so took a shot at doing that.
should produce the SQL
GRANT SELECT ON TABLE table1,table2 TO "some_role"
.I was interested in writing an acceptance test but could not get them running. I tried this:
I could try harder 😄