Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
4e0f4111
Commit
4e0f4111
authored
Feb 06, 2019
by
Sietse Ringers
Browse files
Update irma session command
parent
44d91d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
irma/cmd/session.go
View file @
4e0f4111
...
...
@@ -15,7 +15,7 @@ import (
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/fs"
"github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/server/irma
requesto
r"
"github.com/privacybydesign/irmago/server/irma
serve
r"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
...
...
@@ -23,7 +23,8 @@ import (
const
pollInterval
=
1000
*
time
.
Millisecond
var
(
irmaServer
*
http
.
Server
httpServer
*
http
.
Server
irmaServer
*
irmaserver
.
Server
logger
*
logrus
.
Logger
)
...
...
@@ -63,8 +64,8 @@ irma session --server http://localhost:48680 --authmethod token --key mytoken --
printSessionResult
(
result
)
// Done!
if
irma
Server
!=
nil
{
_
=
irma
Server
.
Close
()
if
http
Server
!=
nil
{
_
=
http
Server
.
Close
()
}
},
}
...
...
@@ -83,7 +84,7 @@ func libraryRequest(
// Start the session
resultchan
:=
make
(
chan
*
server
.
SessionResult
)
qr
,
_
,
err
:=
irma
requesto
r
.
StartSession
(
request
,
func
(
r
*
server
.
SessionResult
)
{
qr
,
_
,
err
:=
irma
Serve
r
.
StartSession
(
request
,
func
(
r
*
server
.
SessionResult
)
{
resultchan
<-
r
})
if
err
!=
nil
{
...
...
@@ -209,7 +210,8 @@ func configureServer(port int, privatekeysPath string, irmaconfig *irma.Configur
config
.
IssuerPrivateKeysPath
=
privatekeysPath
}
return
irmarequestor
.
Initialize
(
config
)
irmaServer
,
err
=
irmaserver
.
New
(
config
)
return
err
}
func
configure
(
cmd
*
cobra
.
Command
)
(
irma
.
RequestorRequest
,
*
irma
.
Configuration
,
error
)
{
...
...
@@ -406,10 +408,10 @@ func parseDisjunctions(disjunctionsStr []string, conf *irma.Configuration) (irma
func
startServer
(
port
int
)
{
mux
:=
http
.
NewServeMux
()
mux
.
HandleFunc
(
"/"
,
irma
requesto
r
.
HttpHandlerFunc
())
irma
Server
=
&
http
.
Server
{
Addr
:
":"
+
strconv
.
Itoa
(
port
),
Handler
:
mux
}
mux
.
HandleFunc
(
"/"
,
irma
Serve
r
.
HttpHandlerFunc
())
http
Server
=
&
http
.
Server
{
Addr
:
":"
+
strconv
.
Itoa
(
port
),
Handler
:
mux
}
go
func
()
{
err
:=
irma
Server
.
ListenAndServe
()
err
:=
http
Server
.
ListenAndServe
()
if
err
!=
nil
&&
err
!=
http
.
ErrServerClosed
{
die
(
"Failed to start server"
,
err
)
}
...
...
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