presto-main/src/main/java/io/prestosql/server/InternalAuthenticationManager.java/InternalAuthenticationManager/authenticateInternalRequest
class InternalAuthenticationManager:    public Principal authenticateInternalRequest(HttpServletRequest request)
    {
        if (!jwtParser.isPresent()) {
            log.error("Internal authentication in not configured");
            return null;
        }

        String internalBarer = request.getHeader(PRESTO_INTERNAL_BEARER);
        try {
            String subject = jwtParser.get().apply(internalBarer);
            return new InternalPrincipal(subject);
        }
        catch (JwtException e) {
            log.error(e, "Internal authentication failed");
            return null;
        }
        catch (RuntimeException e) {
            throw new RuntimeException("Authentication error", e);
        }
    }