/** * @api {post} /api/v1/service/zwave/node/add Add Node * @apiName addNode * @apiGroup Zwave */ async function addNode(req, res) { zwaveManager.addNode(req.body.secure); res.json({ success: true, }); }
list.forEach(function(name) { var cookie = cookies[name]; name = escapeName(name); if (!cookie || typeof cookie != 'object') { result[name] = cookie ? escapeValue(cookie) : cookie; } else { var attrs = []; var value = cookie.value; attrs.push(escapeValue(value)); var maxAge = cookie.maxAge || cookie.maxage || cookie['Max-Age'] || cookie['max-age']; maxAge = parseInt(cookie.maxAge, 10); if (!Number.isNaN(maxAge)) { attrs.push('Expires=' + new Date(Date.now() + maxAge * 1000).toGMTString()); attrs.push('Max-Age=' + maxAge); } cookie.secure && attrs.push('Secure'); cookie.path && attrs.push('Path=' + cookie.path); cookie.domain && attrs.push('Domain=' + cookie.domain); (cookie.httpOnly || cookie.httponly) && attrs.push('HttpOnly'); var sameSite = cookie.sameSite || cookie.samesite || cookie.SameSite; sameSite && attrs.push('SameSite=' + sameSite); result[name] = attrs.join('; '); } });
if (opt.secure) { str += '; Secure' }
const middleware = (req, res, next) => !this.authStrategy || this.isAccessAllowed(req) ? pair.secure(req, res, next) : pair.public(req, res, next); app.use(dev ? '/' : adminPath, middleware);
/** * @api {post} /api/v1/service/zwave/node/remove Remove Node * @apiName removeNode * @apiGroup Zwave */ async function removeNode(req, res) { zwaveManager.removeNode(req.body.secure); res.json({ success: true, }); }
function createOneClient(config, app) { const isHostProt = config.host && config.port && typeof (config.secure) === 'boolean'; const service = config.service; if (!(isHostProt || service) || !config.auth) return {}; // assert((isHostProt || service) && config.auth, '[egg-email] host and prot or service are require on config'); app.coreLogger.info('[egg-email] connecting success!'); const smtpTransport = nodemailer.createTransport(config); return smtpTransport; }
// 收集每日日报数据 async getDaliyDatas(data, type) { const config = this.app.config.email.client; if (!((config.host && config.port && typeof (config.secure) === 'boolean') || config.service) || !config.auth) return; if (!data.appId) return; if (!this.daliy[data.appId]) this.daliy[data.appId] = { pvuvip: null, toplist: null }; this.daliy[data.appId][type] = data; if (this.daliy[data.appId].pvuvip && this.daliy[data.appId].toplist) { this.sendDaliyEmail(); } }
function Application (clientAccessToken, options) { var self = this; self.language = options.language || language; self.clientAccessToken = clientAccessToken; self.hostname = options.hostname || hostname; self.version = options.version || version; self.endpoint = options.endpoint || endpoint; self.requestSource = options.requestSource || defaultSource; if ('secure' in options) { self.secure = options.secure; } else { self.secure = true; } var _http = self.secure ? https : http; self._agent = new _http.Agent({ keepAlive: true }); }
/** * @api {post} /api/v1/service/zwave/node/add Add Node * @apiName addNode * @apiGroup Zwave */ async function addNode(req, res) { zwaveManager.addNode(req.body.secure); res.json({ success: true, }); }
/** * @api {post} /api/v1/service/zwave/node/add Add Node * @apiName addNode * @apiGroup Zwave */ async function addNode(req, res) { zwaveManager.addNode(req.body.secure); res.json({ success: true, }); }
/** * @api {post} /api/v1/service/zwave/node/remove Remove Node * @apiName removeNode * @apiGroup Zwave */ async function removeNode(req, res) { zwaveManager.removeNode(req.body.secure); res.json({ success: true, }); }
/** * @api {post} /api/v1/service/zwave/node/remove Remove Node * @apiName removeNode * @apiGroup Zwave */ async function removeNode(req, res) { zwaveManager.removeNode(req.body.secure); res.json({ success: true, }); }
const middleware = (req, res, next) => !this.authStrategy || this.isAccessAllowed(req) ? pair.secure(req, res, next) : pair.public(req, res, next); app.use(dev ? '/' : adminPath, middleware);
function createOneClient(config, app) { const isHostProt = config.host && config.port && typeof (config.secure) === 'boolean'; const service = config.service; if (!(isHostProt || service) || !config.auth) return {}; // assert((isHostProt || service) && config.auth, '[egg-email] host and prot or service are require on config'); app.coreLogger.info('[egg-email] connecting success!'); const smtpTransport = nodemailer.createTransport(config); return smtpTransport; }
// 收集每日日报数据 async getDaliyDatas(data, type) { const config = this.app.config.email.client; if (!((config.host && config.port && typeof (config.secure) === 'boolean') || config.service) || !config.auth) return; if (!data.appId) return; if (!this.daliy[data.appId]) this.daliy[data.appId] = { pvuvip: null, toplist: null }; this.daliy[data.appId][type] = data; if (this.daliy[data.appId].pvuvip && this.daliy[data.appId].toplist) { this.sendDaliyEmail(); } }