feat(pgsql): extend Grant kind specification with schema, tables, columns, sequences, routines, foreign data wrappers, foreign servers #235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
Fixes #217
This PR is a rework of #218 who is still a draft and will probably be closed soon by his owner (cf. comments).
This PR create more fields in the
forProvider
part of the Grant kind for managing grants on different objects.I refactored #218 by removing the defined
objectType
andobjects
fields, and using specific fields for each type of grant. I believe it follows the original philosophy of the Grant kind better.This PR does not cover the
GRANT xxx ON ALL xxx IN SCHEMA yyy
case.I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
I tested this PR using both
make test
andmake e2e
.I tested the raw queries on my local database.
e2e tests & unit tests have been updated with more Grant configurations :
However, I have only tested requests for multiple objets (i.e:
grant all on table1, table2 to user
) on my local database.I did not test this PR against sql injections, as I believe it is already a problem for the actual Grant feature (see #18 , #22 for mysql, and I would say #22 did not fully fix the problem for mysql as the injection can still be performed using some other fields: database, table, user).