clintropolis commented on PR #12396:
URL: https://github.com/apache/druid/pull/12396#issuecomment-1136547761

   >@clintropolis maybe we can add a default implementation for 
getQueryContext() that returns null. Callers should check the return value and 
use getContext() instead if null is returned. When context param authorization 
is enabled but getQueryContext() returns null, since we cannot distinguish user 
context params and others, the authorizer authorizes all context params 
returned by getContext(). What do you think?
   
   I did something somewhat similar in #12564, except instead of null I 
returned a specific object and a default implementation method to check for it. 
I considered null, but ultimately decided to do this instead so that I didn't 
have to mark `getQueryContext` nullable, because it didn't seem like legitimate 
implementations should ever return null. I'm not very attached to the way I did 
it though, so if you think `null` is better its more or less the same thing I 
think.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to