Add query integrity check in AccessControlManager#13878
Add query integrity check in AccessControlManager#13878highker merged 1 commit intoprestodb:masterfrom
Conversation
presto-main/src/test/java/com/facebook/presto/security/TestAccessControlManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I thought requireNonNull was only for checking constructor args.
See #13705 (comment)
There was a problem hiding this comment.
While I am not completely sure about the context behind the comment that you linked to, I feel that it is reasonable to validate that the input that the class is getting from an external agent. So I can generalize it to when something out of the class creates an instance by calling the constructor or to validate arguments passed to a public method of a class.
There was a problem hiding this comment.
@mayankgarg1990 , definitely I see the need for null checking params in public methods.
However seems like in presto we usually do not null check method parameters using requireNonNull. We do that only for constructor arguments. cc @mbasmanova .
There was a problem hiding this comment.
@ajaygeorge - If you take a look AccessControlManager that has been doing this since 2015 - so there are examples already in the codebase. Also, it is better that we focus on what makes sense rather than how things are being done.
f188cf4 to
3257797
Compare
presto-main/src/main/java/com/facebook/presto/security/AccessControlManager.java
Outdated
Show resolved
Hide resolved
Perhaps, clarify what "integrity" means here. |
3257797 to
cbca15f
Compare
I feel that integrity generally refers to ensuring that the query is what was expected. The exact details are up for the implementation and this PR just adds the API to implement to perform the check. I am unable to think of how I can clarify what "integrity" means. I will be glad if you can share what is the missing context that you will like or if you have some suggestion. |
|
@mayankgarg1990 I'd like to come up with a one-liner for the release notes that would be meaningful to the reader. We can start with |
cbca15f to
33db74d
Compare
|
@mbasmanova - I didn't pay attention to this comment. The token is an implementation detail and in general the idea is to use the identity object (where extra information can be passed as I have changed the comment - |
|
@mayankgarg1990 I like these proposals. |
|
Thank you for the feedback @mbasmanova . I had already updated the code, I have updated the PR description as well |
|
@highker , @mbasmanova - can one of you help with merging this PR? |
Resubmitting #13632