private static void enableCors(HttpServerRequest request) {
        HttpServerResponse response = request.response();
        response.putHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "*");

        String requestMethod = request.getHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD);
        if (requestMethod != null) {
            response.putHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, requestMethod);
        }
        String requestHeaders = request.getHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS);
        if (requestHeaders != null) {
            response.putHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, requestHeaders);
        }
    }
The method authorizes HTTP request by user access token or (and) API key.
<p>
    There are four possible use cases:
    <ol>
    <li>Both API key and access token are missed</li>
    <li>Both API key and access token are provided</li>
    <li>Just API key is provided</li>
    <li>Just access token is provided</li>
    </ol>
    The 2nd use case has two sub-cases:
    <ol>
    <li>API key is equal to access token. The credentials could be either access token or API key</li>
    <li>API key is not equal to access token. It could be per-request API key sent by an interceptor</li>
    </ol>
</p>

@param request HTTP request
@return the future of {@link AuthorizationResult}
server/src/main/java/com/epam/aidial/core/server/Proxy.java