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) { ...@@ -6,7 +6,7 @@ function serialize(obj, prefix) {
for (let key in obj) { for (let key in obj) {
if (obj.hasOwnProperty(key)) { if (obj.hasOwnProperty(key)) {
const strKey = prefix ? prefix + '[' + key + ']' : key; const strKey = prefix ? prefix + '[' + key + ']' : key;
const value = obj[strKey]; const value = obj[key];
if (typeof value === 'object') { if (typeof value === 'object') {
res.push(serialize(value, strKey)); res.push(serialize(value, strKey));
......
...@@ -10,7 +10,11 @@ function * checkToken(next) { ...@@ -10,7 +10,11 @@ function * checkToken(next) {
this.throwResponseErrorIfNeed(this.errors); 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); const privateSignature = sha1(this.config.accessToken + signeableContent + salt);
this.logger.log(__filename, 'private signature:', privateSignature); this.logger.log(__filename, 'private signature:', privateSignature);
......
{ {
"name": "service-sdk", "name": "service-sdk",
"version": "0.0.5", "version": "0.0.6",
"private": true, "private": true,
"description": "Service SDK for LViS", "description": "Service SDK for LViS",
"keywords": [], "keywords": [],
......
...@@ -7,6 +7,7 @@ const checkProjectId = require('../middlewares/checkProjectId'); ...@@ -7,6 +7,7 @@ const checkProjectId = require('../middlewares/checkProjectId');
const lvis = require('./lvis'); const lvis = require('./lvis');
const project = require('./project'); const project = require('./project');
const analytics = require('./analytics'); const analytics = require('./analytics');
const tabs = require('./tabs');
router router
.post('/lvis', checkToken, lvis.post) .post('/lvis', checkToken, lvis.post)
...@@ -19,6 +20,11 @@ router ...@@ -19,6 +20,11 @@ router
'/lvis/:instanceId/project/:projectId/events/:eventId/analytics_tab', '/lvis/:instanceId/project/:projectId/events/:eventId/analytics_tab',
checkToken, checkInstanceId, checkProjectId, analytics.get checkToken, checkInstanceId, checkProjectId, analytics.get
) )
.get(
'/lvis/:instanceId/project/:projectId/events/:eventId/tabs',
checkToken, checkInstanceId, checkProjectId, tabs.get
)
; ;
module.exports = router; 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