Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement subfield acl check #17475

Merged
merged 1 commit into from
Mar 17, 2022
Merged

Conversation

pranjalssh
Copy link
Contributor

@pranjalssh pranjalssh commented Mar 15, 2022

Added an option to enable fine grained column subfield acl check. If we query col.x, we send "col.x" to permission server for access control checks, rather than just "col".

Also noticed that UtilizedColumnReferenceAnalyzer had a bug with dereference expressions. I fixed it(one liner) and I guess people weren't relying on it.

After fixing it, UtilizedColumnReferenceAnalyzer implementation still doesn't work perfectly with subfields, as it doesn't prune unused subfields(added a test with explanation), but the implementation should be more than enough to push it like this, especially given the fact that it was already buggy before.

== RELEASE NOTES ==

General Changes

* Allow connectors to support column subfield access control checks. Connectors can specify subfield access control for row-type columns through ``checkCanSelectFromColumns()`` in SPI.

@pranjalssh pranjalssh force-pushed the subfield_acl_2 branch 3 times, most recently from 19d498e to 808ed7a Compare March 15, 2022 20:29
Comment on lines +1375 to +1377
if (baseType == null || !(baseType instanceof RowType)) {
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!(baseType instanceof RowType) implies baseType == null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This is for subscript, it could be array/map

@highker highker self-assigned this Mar 16, 2022
@kaikalur
Copy link
Contributor

Also remember we have indexed access to fields x[n]is same as x.a if a is the n-th field in the struct.

@pranjalssh
Copy link
Contributor Author

Also remember we have indexed access to fields x[n]is same as x.a if a is the n-th field in the struct.

Yeah, I added tests for this

@pranjalssh pranjalssh force-pushed the subfield_acl_2 branch 2 times, most recently from 54c65d9 to 8ead1b4 Compare March 16, 2022 17:42
@pranjalssh pranjalssh requested a review from highker March 16, 2022 20:18
@highker highker merged commit e1d40fb into prestodb:master Mar 17, 2022
@mshang816 mshang816 mentioned this pull request May 17, 2022
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants