Commit 8a70d658 authored by Evgeniy Zaitsev's avatar Evgeniy Zaitsev
Browse files

v0.0.6

parent 5081ccdc
......@@ -6,7 +6,7 @@ function serialize(obj, prefix) {
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
const strKey = prefix ? prefix + '[' + key + ']' : key;
const value = obj[strKey];
const value = obj[key];
if (typeof value === 'object') {
res.push(serialize(value, strKey));
......
......@@ -10,7 +10,11 @@ function * checkToken(next) {
this.throwResponseErrorIfNeed(this.errors);
const signeableContent = this.request.path + this.request.querystring + serialize(this.request.body);
const reqBody = serialize(this.request.body);
this.logger.log(__filename, '\n', this.request.path, '\n', this.request.querystring, '\n', reqBody);
const signeableContent = this.request.path + '?' + this.request.querystring + reqBody;
const privateSignature = sha1(this.config.accessToken + signeableContent + salt);
this.logger.log(__filename, 'private signature:', privateSignature);
......
{
"name": "service-sdk",
"version": "0.0.5",
"version": "0.0.6",
"private": true,
"description": "Service SDK for LViS",
"keywords": [],
......
......@@ -7,6 +7,7 @@ const checkProjectId = require('../middlewares/checkProjectId');
const lvis = require('./lvis');
const project = require('./project');
const analytics = require('./analytics');
const tabs = require('./tabs');
router
.post('/lvis', checkToken, lvis.post)
......@@ -19,6 +20,11 @@ router
'/lvis/:instanceId/project/:projectId/events/:eventId/analytics_tab',
checkToken, checkInstanceId, checkProjectId, analytics.get
)
.get(
'/lvis/:instanceId/project/:projectId/events/:eventId/tabs',
checkToken, checkInstanceId, checkProjectId, tabs.get
)
;
module.exports = router;
'use strict';
function * get() {
this.logger.log(__filename, 'GET');
if (this.config.tabsCallback) {
this.body = yield this.config.tabsCallback(this.state.instance, this.state.project);
}
}
module.exports = {get: get};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment