Adding schema access rules to file based system access control#15886
Adding schema access rules to file based system access control#15886rschlussel merged 1 commit intoprestodb:masterfrom
Conversation
7c6a42c to
160e98d
Compare
|
Can you link to the PR? It's a better source of context then the commit trinodb/trino#3766 Also the linked commit is not actually on Trino master. |
aweisberg
left a comment
There was a problem hiding this comment.
Thanks!
Some simplification we can take from Trino and the tests seem to be a bit different and incomplete compared to what Trino is currently doing.
There was a problem hiding this comment.
If you ignore the linked diff and look at just how Trino is operating today they dropped the canAccessCatalog check here and pushed it into isSchemaOwner() which is simpler.
There was a problem hiding this comment.
Sure sounds good. I will place a catalog access check with the isSchemaOwner() method itself.
There was a problem hiding this comment.
There was a problem hiding this comment.
We seem to deviate a lot on the tests? Are there "extra" tests that we don't need to cover? Can we do a better job of synchronizing?
There was a problem hiding this comment.
@aweisberg I have tried covering all positive and negative tests for all the 3 schema operations. If you think something is missing here, I can add more tests to this.
There was a problem hiding this comment.
I can see why we deviated in several ways like not supporting groups and thus not needing to test groups.
If you fix the assertThrows I think it will be fine.
There was a problem hiding this comment.
Why does one assertThrows have a bunch of different things in it? It will stop executing after the first one fails?
There was a problem hiding this comment.
Made the changes.
There was a problem hiding this comment.
There are three cases now where there were five previously? It looks like it isn't validating whether the catalog can be accessed since coverage shows no cases where it is denied because the user can't access the catalog.
There was a problem hiding this comment.
Yes look like those got removed while making other changes in test, added them back.
b75a2c3 to
f345b1c
Compare
aweisberg
left a comment
There was a problem hiding this comment.
It's still not testing the catalog ownership check. You can see because if you step through in the debugger it will never stop at return false in the test cases for schema. It does happen to do it in the read only catalog case, but I don't want to depend on testing unrelated functionality to cover it.
Sorry I know I am being picky here.
Cherry pick of trinodb/trino#3766 Co-authored-by: haldes <sumit.halder@gmail.com>
f345b1c to
94af7fc
Compare
|
@aweisberg I had added tests for catalog ownership check via read-only catalog access as you mentioned. In all the other cases AccessManager would redirect checks for Accesscatalog to checkCanAccessCatalog. Please review and let me know if any other changes are required. |
|
@arhimondr @rschlussel This is ready for review/merge. |
Currently, file-based system access control allows defining catalog level rule. As a part of these changes, schema access rules can be included with file-based system access control for the below operations -