Skip to content
GitLab
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
0c6d5606
Commit
0c6d5606
authored
Dec 21, 2018
by
Sietse Ringers
Browse files
Rename server backend package to core
Co-authored-by:
Confiks
<
confiks@scriptbase.org
>
parent
a39a86ef
Changes
6
Hide whitespace changes
Inline
Side-by-side
server/
backend
/api.go
→
server/
core
/api.go
View file @
0c6d5606
package
backend
package
core
import
(
"encoding/json"
...
...
server/
backend
/handle.go
→
server/
core
/handle.go
View file @
0c6d5606
package
backend
package
core
import
(
"github.com/privacybydesign/gabi"
...
...
server/
backend
/helpers.go
→
server/
core
/helpers.go
View file @
0c6d5606
package
backend
package
core
import
(
"os"
...
...
server/
backend
/sessions.go
→
server/
core
/sessions.go
View file @
0c6d5606
package
backend
package
core
import
(
"math/rand"
...
...
server/irmarequestor/main.go
View file @
0c6d5606
...
...
@@ -6,7 +6,7 @@ import (
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/server/
backend
"
"github.com/privacybydesign/irmago/server/
core
"
)
// SessionHandler is a function that can handle a session result
...
...
@@ -17,14 +17,14 @@ var handlers = make(map[string]SessionHandler)
// Initialize sets configuration.
func
Initialize
(
configuration
*
server
.
Configuration
)
error
{
return
backend
.
Initialize
(
configuration
)
return
core
.
Initialize
(
configuration
)
}
// StartSession starts an IRMA session, running the handler on completion, if specified.
// The session token (the second return parameter) can be used in GetSessionResult()
// and CancelSession().
func
StartSession
(
request
irma
.
SessionRequest
,
handler
SessionHandler
)
(
*
irma
.
Qr
,
string
,
error
)
{
qr
,
token
,
err
:=
backend
.
StartSession
(
request
)
qr
,
token
,
err
:=
core
.
StartSession
(
request
)
if
err
!=
nil
{
return
nil
,
""
,
err
}
...
...
@@ -36,12 +36,12 @@ func StartSession(request irma.SessionRequest, handler SessionHandler) (*irma.Qr
// GetSessionResult retrieves the result of the specified IRMA session.
func
GetSessionResult
(
token
string
)
*
server
.
SessionResult
{
return
backend
.
GetSessionResult
(
token
)
return
core
.
GetSessionResult
(
token
)
}
// CancelSession cancels the specified IRMA session.
func
CancelSession
(
token
string
)
error
{
return
backend
.
CancelSession
(
token
)
return
core
.
CancelSession
(
token
)
}
// HttpHandlerFunc returns a http.HandlerFunc that handles the IRMA protocol
...
...
@@ -59,7 +59,7 @@ func HttpHandlerFunc() http.HandlerFunc {
w
.
WriteHeader
(
http
.
StatusInternalServerError
)
return
}
status
,
response
,
result
:=
backend
.
HandleProtocolMessage
(
r
.
URL
.
Path
,
r
.
Method
,
r
.
Header
,
message
)
status
,
response
,
result
:=
core
.
HandleProtocolMessage
(
r
.
URL
.
Path
,
r
.
Method
,
r
.
Header
,
message
)
w
.
WriteHeader
(
status
)
w
.
Write
(
response
)
if
result
!=
nil
{
...
...
server/irmaserver/cmd/main.go
View file @
0c6d5606
...
...
@@ -13,7 +13,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/go-errors/errors"
"github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/server/
backend
"
"github.com/privacybydesign/irmago/server/
core
"
"github.com/privacybydesign/irmago/server/irmaserver"
"github.com/spf13/cobra"
"github.com/spf13/viper"
...
...
@@ -60,7 +60,7 @@ func setFlags(cmd *cobra.Command) error {
flags
:=
cmd
.
Flags
()
flags
.
SortFlags
=
false
cachepath
,
err
:=
backend
.
CachePath
()
cachepath
,
err
:=
core
.
CachePath
()
if
err
!=
nil
{
return
err
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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