Adding schema access rules to FileBasedSystemAccessControl#3766
Adding schema access rules to FileBasedSystemAccessControl#3766kokosing merged 1 commit intotrinodb:masterfrom haldes:schemaSystemAccess
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@prestosql.io. For more information, see https://github.com/prestosql/cla. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@prestosql.io. For more information, see https://github.com/prestosql/cla. |
|
I think it was a deliberate choice to have table/schemas access control checked at catalog level with @haldes Why above mentioned solution does not work for you? |
|
Hi @kokosing, As I understand io.prestosql.plugin.base.security.FileBasedAccessControl is only available for hive connectors. We don't have similar access controls (schema, table) for other connectors. Please find below the slack discussion on the same |
|
Thanks. Are you going to cover access to tables and views as well? |
kokosing
left a comment
There was a problem hiding this comment.
So far so good. Some initial comments
...in-toolkit/src/main/java/io/prestosql/plugin/base/security/FileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
presto-plugin-toolkit/src/test/resources/file-based-system-access-schema.json
Outdated
Show resolved
Hide resolved
...oolkit/src/test/java/io/prestosql/plugin/base/security/TestFileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
...oolkit/src/test/java/io/prestosql/plugin/base/security/TestFileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
|
@kokosing Thanks - Will work on it and get back. |
...in-toolkit/src/main/java/io/prestosql/plugin/base/security/FileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
...oolkit/src/test/java/io/prestosql/plugin/base/security/TestFileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
...oolkit/src/test/java/io/prestosql/plugin/base/security/TestFileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
...oolkit/src/test/java/io/prestosql/plugin/base/security/TestFileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
kokosing
left a comment
There was a problem hiding this comment.
% few minor comments
Thanks!
There was a problem hiding this comment.
DROP_SCHEMA_ERR_MESSAGE -> DROP_SCHEMA_ACCESS_DENIED_MESSAGE
Same for all below.
There was a problem hiding this comment.
INVALID_JSON_ERR_MESSAGE -> INVALID_JSON
There was a problem hiding this comment.
assertDenied -> assertAccessDenied
expectedErrMessage -> expectedMessage
There was a problem hiding this comment.
check that message equals or matches the pattern
There was a problem hiding this comment.
@kokosing - I have changed to hasMessageMatching() and using pattern to match. Let me know if that's ok.
...oolkit/src/test/java/io/prestosql/plugin/base/security/TestFileBasedSystemAccessControl.java
Outdated
Show resolved
Hide resolved
kokosing
left a comment
There was a problem hiding this comment.
Please squash all commits and rebase.
Add schema access rules to FileBasedSystemAccessControl Add schema access rules to FileBasedSystemAccessControl Add schema access rules to FileBasedSystemAccessControl Add schema access rules to FileBasedSystemAccessControl Add schema access rules to FileBasedSystemAccessControl
|
@kokosing - I have squashed and did rebase. |
|
Automation hit: #2435 |
|
Merged, thanks! |
Cherry pick of trinodb/trino#3766 Co-authored-by: haldes <sumit.halder@gmail.com>
Cherry pick of trinodb/trino#3766 Co-authored-by: haldes <sumit.halder@gmail.com>
Currently FileBasedSystemAccessControl control has catalogRules, queryAccessRules, impersonationRules and principalUserMatchRules. The proposal here is to add schema access rules to it. This will give more granular access controls over the datasets.
At high level idea is to implement/enhance the below methods of FileBasedSystemAccessControl
Original Issue : #3733