feat(pgsql): extend Grant kind specification with schema, tables, columns, sequences, routines, foreign data wrappers, foreign servers#345
Conversation
Signed-off-by: Bastien CERIANI <bastien.ceriani@gmail.com> Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Julien Christophe <julien.christophe@datanumia.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
…-grant-support-to-schema
…-grant-support-to-schema
38ce595 to
6e47912
Compare
Quote multiple parameters in GRANT/REVOKE statements to prevent SQL injection. Qualify aclexplode ACL column references with their table aliases (n.nspacl, db.datacl) for consistency. Error instead of panic for Observe, Create, and Delete. Add tests to assert generated SQL strings directly. Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
ac42126 to
e9b0e9a
Compare
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
|
hey @fernandezcuesta, I think another issue stemming from the rebase and Crossplane v2 adjustment may be the fact that cluster variant of apiVersion: postgresql.sql.crossplane.io/v1alpha1
kind: Grant
metadata:
name: demo-application-staging-user-1
spec:
deletionPolicy: Delete
forProvider:
database: demo-application-staging-dedicated
databaseRef:
name: demo-application-staging-dedicated
privileges:
- SELECT
role: demo-application-staging-user
roleRef:
name: demo-application-staging-user
schema: public
tables:
- deployments
managementPolicies:
- '*'
providerConfigRef:
name: demo-application-staging-user-db-connectionto apply after adding the same behaviour to namespaced reconciler (this PR with these 2 commits) demo-application-staging-dedicated=> SELECT table_schema, table_name, privilege_type
FROM information_schema.table_privileges
WHERE grantee = 'demo-application-staging-user';
table_schema | table_name | privilege_type
--------------+-------------+----------------
public | deployments | SELECT
(1 row)
demo-application-staging-dedicated=> |
…cific database — tables, schemas, sequences, columns, routines, fallback to provider config one's otherwise Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
…espaced Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
591f50b to
582048b
Compare
Thanks! added |
|
@dawidmalina ghcr.io/crossplane-contrib/provider-sql:v0.15.0-rc.1 |
|
@fernandezcuesta - no issues after switching to this version. Working as expected :) thank you |
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
|
@fernandezcuesta - Just a reminder :) Is there any news on this matter? |
|
We need an approval from a maintainer :( |
|
@fernandezcuesta Do you have some spare time to review this PR? 🙏 |
|
Even if I could, that would look awkward 😄 |
Whoops your handle and name didn't match and I wasn't being careful enough. My mistake. |
chlunde
left a comment
There was a problem hiding this comment.
Not super excited about calling GetServerVersion with sql.Open every reconcile, but I don't have a good alternative now either :)
|
Just a few nits - and a conflict (sorry about that, I should have reviewed this one first). LGTM soon! |
Co-authored-by: Carl Henrik Lunde <chlunde@gmail.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
OK "addressed" that by calling it once per |
|
thank you for this great work! Do you guys think we could issue a new tag to include this PR? :) I know |
Description of your changes
This is a follow up of #235 with some minor issues found while merging from master.
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Added tests