You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2023/06/06 20:57:06 UTC

[GitHub] [druid] gianm commented on a diff in pull request #14376: Add method to authorize native query using authentication result

gianm commented on code in PR #14376:
URL: https://github.com/apache/druid/pull/14376#discussion_r1220350149


##########
server/src/main/java/org/apache/druid/server/QueryLifecycle.java:
##########
@@ -220,6 +220,18 @@ public void initialize(final Query<?> baseQuery)
    * @return authorization result
    */
   public Access authorize(HttpServletRequest req)
+  {
+    return authorize(AuthorizationUtils.authenticationResultFromRequest(req));
+  }
+
+  /**
+   * Authorize the query using the authentication result.
+   * Will return an Access object denoting whether the query is authorized or not.
+   *
+   * @param authenticationResult authentication result indicating identity of the requester
+   * @return authorization result of requester
+   */
+  public Access authorize(AuthenticationResult authenticationResult)

Review Comment:
   Please include some unit tests for this new method, in case it's called directly.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org