private static boolean isAuthJwt(String authType) {
    return "jwt".equalsIgnoreCase(authType);
  }
Secures servlet processing.
<p>This is to be used by servlets that require impersonation through {@link UserGroupInformation#doAs(PrivilegedAction)}
method when providing service. The servlet request header provides user identification
that Hadoop{@literal '}s security uses to perform actions, the
{@link ServletSecurity#execute(HttpServletRequest, HttpServletResponse, ServletSecurity.MethodExecutor)}
method invokes the executor through a {@link PrivilegedAction} in the expected {@link UserGroupInformation} context.
</p>
A typical usage in a servlet is the following:
<pre><code>
ServletSecurity security; // ...
{@literal @}Override protected void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {
 security.execute(request, response, this::runPost);
}
private void runPost(HttpServletRequest request, HttpServletResponse response) throws ServletException {
...
}
</code></pre>
<p>
As a convenience, instead of embedding the security instance, one can wrap an existing servlet in a proxy that
will ensure all its service methods are called with the expected {@link UserGroupInformation} .
</p>
<pre><code>
 HttpServlet myServlet = ...;
 ServletSecurity security = ...: ;
 Servlet ugiServlet = security.proxy(mySerlvet);
 }
 </code></pre>
<p>
This implementation performs user extraction and eventual JWT validation to
execute (servlet service) methods within the context of the retrieved UserGroupInformation.
</p>
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java