-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Implement subfield acl check #17475
Conversation
19d498e
to
808ed7a
Compare
808ed7a
to
ff6a104
Compare
presto-main/src/main/java/com/facebook/presto/sql/analyzer/Analysis.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/Analysis.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/Analysis.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
if (baseType == null || !(baseType instanceof RowType)) { | ||
continue; | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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 |
54c65d9
to
8ead1b4
Compare
8ead1b4
to
ec0a89f
Compare
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.