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
3935afac
Commit
3935afac
authored
Jun 27, 2019
by
Sietse Ringers
Browse files
fix: wrong verbosity handling in irma session subcommand
parent
165b4ea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
irma/cmd/session.go
View file @
3935afac
...
...
@@ -61,7 +61,8 @@ irma session --server http://localhost:48680 --authmethod token --key mytoken --
if
serverurl
==
""
{
port
,
_
:=
flags
.
GetInt
(
"port"
)
privatekeysPath
,
_
:=
flags
.
GetString
(
"privkeys"
)
result
,
err
=
libraryRequest
(
request
,
irmaconfig
,
url
,
port
,
privatekeysPath
,
noqr
)
verbosity
,
_
:=
cmd
.
Flags
()
.
GetCount
(
"verbose"
)
result
,
err
=
libraryRequest
(
request
,
irmaconfig
,
url
,
port
,
privatekeysPath
,
noqr
,
verbosity
)
}
else
{
authmethod
,
_
:=
flags
.
GetString
(
"authmethod"
)
key
,
_
:=
flags
.
GetString
(
"key"
)
...
...
@@ -88,8 +89,9 @@ func libraryRequest(
port
int
,
privatekeysPath
string
,
noqr
bool
,
verbosity
int
,
)
(
*
server
.
SessionResult
,
error
)
{
if
err
:=
configureServer
(
url
,
port
,
privatekeysPath
,
irmaconfig
);
err
!=
nil
{
if
err
:=
configureServer
(
url
,
port
,
privatekeysPath
,
irmaconfig
,
verbosity
);
err
!=
nil
{
return
nil
,
err
}
startServer
(
port
)
...
...
@@ -187,7 +189,7 @@ func postRequest(serverurl string, request irma.RequestorRequest, name, authmeth
// Configuration functions
func
configureServer
(
url
string
,
port
int
,
privatekeysPath
string
,
irmaconfig
*
irma
.
Configuration
)
error
{
func
configureServer
(
url
string
,
port
int
,
privatekeysPath
string
,
irmaconfig
*
irma
.
Configuration
,
verbosity
int
)
error
{
// Replace "port" in url with actual port
replace
:=
"$1:"
+
strconv
.
Itoa
(
port
)
url
=
string
(
regexp
.
MustCompile
(
"(https?://[^/]*):port"
)
.
ReplaceAll
([]
byte
(
url
),
[]
byte
(
replace
)))
...
...
@@ -197,6 +199,7 @@ func configureServer(url string, port int, privatekeysPath string, irmaconfig *i
Logger
:
logger
,
URL
:
url
,
DisableSchemesUpdate
:
true
,
Verbose
:
verbosity
,
}
if
privatekeysPath
!=
""
{
config
.
IssuerPrivateKeysPath
=
privatekeysPath
...
...
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