Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
publics
service-sdk-releases
Commits
8a70d658
Commit
8a70d658
authored
Oct 14, 2016
by
Evgeniy Zaitsev
Browse files
v0.0.6
parent
5081ccdc
Changes
5
Hide whitespace changes
Inline
Side-by-side
lib/serialize.js
View file @
8a70d658
...
@@ -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
[
strK
ey
];
const
value
=
obj
[
k
ey
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
)
{
res
.
push
(
serialize
(
value
,
strKey
));
res
.
push
(
serialize
(
value
,
strKey
));
...
...
middlewares/checkToken.js
View file @
8a70d658
...
@@ -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
);
...
...
package.json
View file @
8a70d658
{
{
"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"
:
[],
...
...
router/index.js
View file @
8a70d658
...
@@ -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
;
router/tabs.js
0 → 100644
View file @
8a70d658
'
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
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment