@Override
    protected void doApply(ApiRequest request, IPolicyContext context, ApiKeyConfigBean config,
            IPolicyChain<ApiRequest> chain) {
        if (request.getApiKey() != null) {
            String header = config.getRequestHeader();
            request.getHeaders().put(header, request.getApiKey());
            // Ensure that connector does not strip the header out (e.g. X-Api-Key)
            context.getConnectorConfiguration().permitRequestHeader(header);
        }
        super.doApply(request, context, config, chain);
    }
@see io.apiman.gateway.engine.policies.AbstractMappedPolicy#doApply(io.apiman.gateway.engine.beans.ApiRequest, io.apiman.gateway.engine.policy.IPolicyContext, java.lang.Object, io.apiman.gateway.engine.policy.IPolicyChain)
plugins/apikey-policy/src/main/java/io/apiman/plugins/apikey_policy/ApiKeyPolicy.java