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
d86a12a6
Commit
d86a12a6
authored
Oct 17, 2016
by
Evgeniy Zaitsev
Browse files
v0.0.10
parent
6066db22
Changes
4
Hide whitespace changes
Inline
Side-by-side
middlewares/checkSignature.js
View file @
d86a12a6
...
...
@@ -7,6 +7,7 @@ function * checkToken(next) {
const
signature
=
this
.
checkHeader
(
'
x-lvis-signature
'
).
notBlank
().
value
;
this
.
logger
.
log
(
__filename
,
'
headers:
'
,
JSON
.
stringify
({
salt
,
signature
}));
this
.
logger
.
log
(
__filename
,
'
body:
'
,
JSON
.
stringify
(
this
.
request
.
body
));
this
.
throwResponseErrorIfNeed
(
this
.
errors
);
...
...
@@ -16,7 +17,11 @@ function * checkToken(next) {
this
.
logger
.
log
(
__filename
,
'
\n
'
,
this
.
request
.
path
,
'
\n
'
,
this
.
request
.
querystring
,
'
\n
'
,
reqBody
);
const
signeableContent
=
this
.
request
.
path
+
querystring
+
reqBody
;
const
privateSignature
=
sha1
(
this
.
config
.
accessToken
+
signeableContent
+
salt
);
const
str
=
this
.
config
.
accessToken
+
signeableContent
+
salt
;
this
.
logger
.
log
(
__filename
,
'
sa1 from str:
'
,
str
);
const
privateSignature
=
sha1
(
str
);
this
.
logger
.
log
(
__filename
,
'
private signature:
'
,
privateSignature
);
...
...
package.json
View file @
d86a12a6
{
"name"
:
"service-sdk"
,
"version"
:
"0.0.
9
"
,
"version"
:
"0.0.
10
"
,
"private"
:
true
,
"description"
:
"Service SDK for LViS"
,
"keywords"
:
[],
...
...
router/index.js
View file @
d86a12a6
...
...
@@ -29,7 +29,7 @@ router
'
/lvis/:instanceId/project/:projectId/tabs
'
,
checkSignature
,
checkInstanceId
,
checkProjectId
,
tabs
.
getProject
)
.
get
(
'
/lvis/:instanceId/project/:projectId/events/:eventId/tabs
'
,
checkSignature
,
checkInstanceId
,
checkProjectId
,
checkEventId
,
tabs
.
getEvent
...
...
@@ -39,7 +39,7 @@ router
'
/lvis/:instanceId/project/:projectId/tabs/:tabId
'
,
checkInstanceId
,
checkProjectId
,
checkTabId
,
checkSessionToken
,
tab
.
getEvent
)
.
get
(
'
/lvis/:instanceId/project/:projectId/events/:eventId/tabs/:tabId
'
,
checkInstanceId
,
checkProjectId
,
checkEventId
,
checkTabId
,
checkSessionToken
,
tab
.
getEvent
...
...
router/tabs.js
View file @
d86a12a6
...
...
@@ -27,7 +27,6 @@ function * getEvent() {
return
;
}
const
tabs
=
yield
this
.
config
.
eventTabsCallback
(
this
.
state
.
instance
,
this
.
state
.
project
,
this
.
state
.
eventId
);
tabs
.
forEach
(
tab
=>
Object
.
assign
(
tab
,
{
...
...
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