ip-white-list.js 310 Bytes
const co = Promise.coroutine;
const cache = global.yoho.cache.master;
const WHITE_LIST_KEY = 'whitelist:ips';

module.exports = () => {
    return co(function* () {
        let listFromCache = yield cache.getAsync(WHITE_LIST_KEY);

        return Promise.resolve(JSON.parse(listFromCache) || []);
    })();
};