Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
04710755
Commit
04710755
authored
Mar 06, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #409 from gibiansky/check-signature-scheme
Check signature scheme, fixes #390
parents
3d167925
da7c4ca7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
Types.hs
ipython-kernel/src/IHaskell/IPython/Types.hs
+13
-9
No files found.
ipython-kernel/src/IHaskell/IPython/Types.hs
View file @
04710755
...
@@ -70,7 +70,10 @@ data Profile = Profile { ip :: IP -- ^ The IP on which to li
...
@@ -70,7 +70,10 @@ data Profile = Profile { ip :: IP -- ^ The IP on which to li
-- Convert the kernel profile to and from JSON.
-- Convert the kernel profile to and from JSON.
instance
FromJSON
Profile
where
instance
FromJSON
Profile
where
parseJSON
(
Object
v
)
=
parseJSON
(
Object
v
)
=
do
signatureScheme
<-
v
.:
"signature_scheme"
case
signatureScheme
of
"hmac-sha256"
->
Profile
<$>
v
.:
"ip"
Profile
<$>
v
.:
"ip"
<*>
v
.:
"transport"
<*>
v
.:
"transport"
<*>
v
.:
"stdin_port"
<*>
v
.:
"stdin_port"
...
@@ -79,6 +82,7 @@ instance FromJSON Profile where
...
@@ -79,6 +82,7 @@ instance FromJSON Profile where
<*>
v
.:
"shell_port"
<*>
v
.:
"shell_port"
<*>
v
.:
"iopub_port"
<*>
v
.:
"iopub_port"
<*>
(
Text
.
encodeUtf8
<$>
v
.:
"key"
)
<*>
(
Text
.
encodeUtf8
<$>
v
.:
"key"
)
sig
->
error
$
"Unexpected signature scheme: "
++
sig
parseJSON
_
=
fail
"Expecting JSON object."
parseJSON
_
=
fail
"Expecting JSON object."
instance
ToJSON
Profile
where
instance
ToJSON
Profile
where
...
...
Write
Preview
Markdown
is supported
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