Commit de975e0b authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Renaming packages

parent 45250a0d
...@@ -9,8 +9,8 @@ import ( ...@@ -9,8 +9,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/privacybydesign/irmago" "github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/test" "github.com/privacybydesign/irmago/internal/test"
"github.com/privacybydesign/irmago/irmaserver" "github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/irmaserver/irmarequestor" "github.com/privacybydesign/irmago/server/irmarequestor"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
...@@ -22,7 +22,7 @@ func StartIrmaServer(t *testing.T) { ...@@ -22,7 +22,7 @@ func StartIrmaServer(t *testing.T) {
logger := logrus.New() logger := logrus.New()
logger.Level = logrus.WarnLevel logger.Level = logrus.WarnLevel
logger.Formatter = &logrus.TextFormatter{} logger.Formatter = &logrus.TextFormatter{}
require.NoError(t, irmarequestor.Initialize(&irmaserver.Configuration{ require.NoError(t, irmarequestor.Initialize(&server.Configuration{
Logger: logger, Logger: logger,
IrmaConfigurationPath: filepath.Join(testdata, "irma_configuration"), IrmaConfigurationPath: filepath.Join(testdata, "irma_configuration"),
PrivateKeysPath: filepath.Join(testdata, "privatekeys"), PrivateKeysPath: filepath.Join(testdata, "privatekeys"),
...@@ -40,7 +40,7 @@ func StopIrmaServer() { ...@@ -40,7 +40,7 @@ func StopIrmaServer() {
irmaServer.Close() irmaServer.Close()
} }
func newSessionHelper(t *testing.T, request irma.SessionRequest) *irmaserver.SessionResult { func newSessionHelper(t *testing.T, request irma.SessionRequest) *server.SessionResult {
StartIrmaServer(t) StartIrmaServer(t)
defer StopIrmaServer() defer StopIrmaServer()
...@@ -48,9 +48,9 @@ func newSessionHelper(t *testing.T, request irma.SessionRequest) *irmaserver.Ses ...@@ -48,9 +48,9 @@ func newSessionHelper(t *testing.T, request irma.SessionRequest) *irmaserver.Ses
defer test.ClearTestStorage(t) defer test.ClearTestStorage(t)
clientChan := make(chan *SessionResult) clientChan := make(chan *SessionResult)
serverChan := make(chan *irmaserver.SessionResult) serverChan := make(chan *server.SessionResult)
qr, token, err := irmarequestor.StartSession(request, func(result *irmaserver.SessionResult) { qr, token, err := irmarequestor.StartSession(request, func(result *server.SessionResult) {
serverChan <- result serverChan <- result
}) })
require.NoError(t, err) require.NoError(t, err)
......
...@@ -9,8 +9,8 @@ import ( ...@@ -9,8 +9,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/privacybydesign/irmago" "github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/internal/test" "github.com/privacybydesign/irmago/internal/test"
"github.com/privacybydesign/irmago/irmaserver" "github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/irmaserver/server" "github.com/privacybydesign/irmago/server/irmaserver"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
...@@ -22,8 +22,8 @@ func StartRequestorServer() { ...@@ -22,8 +22,8 @@ func StartRequestorServer() {
logger.Formatter = &logrus.TextFormatter{} logger.Formatter = &logrus.TextFormatter{}
go func() { go func() {
err := server.Start(&server.Configuration{ err := irmaserver.Start(&irmaserver.Configuration{
Configuration: &irmaserver.Configuration{ Configuration: &server.Configuration{
Logger: logger, Logger: logger,
IrmaConfigurationPath: filepath.Join(testdata, "irma_configuration"), IrmaConfigurationPath: filepath.Join(testdata, "irma_configuration"),
PrivateKeysPath: filepath.Join(testdata, "privatekeys"), PrivateKeysPath: filepath.Join(testdata, "privatekeys"),
...@@ -38,10 +38,10 @@ func StartRequestorServer() { ...@@ -38,10 +38,10 @@ func StartRequestorServer() {
} }
func StopRequestorServer() { func StopRequestorServer() {
server.Stop() irmaserver.Stop()
} }
func serverSessionHelper(t *testing.T, request irma.SessionRequest) *irmaserver.SessionResult { func serverSessionHelper(t *testing.T, request irma.SessionRequest) *server.SessionResult {
client := parseStorage(t) client := parseStorage(t)
defer test.ClearTestStorage(t) defer test.ClearTestStorage(t)
...@@ -64,7 +64,7 @@ func serverSessionHelper(t *testing.T, request irma.SessionRequest) *irmaserver. ...@@ -64,7 +64,7 @@ func serverSessionHelper(t *testing.T, request irma.SessionRequest) *irmaserver.
require.NoError(t, clientResult.Err) require.NoError(t, clientResult.Err)
} }
var result irmaserver.SessionResult var result server.SessionResult
transport.Get("result/"+token, &result) transport.Get("result/"+token, &result)
return &result return &result
} }
......
package irmaserver package server
import ( import (
"encoding/json" "encoding/json"
......
...@@ -13,10 +13,10 @@ import ( ...@@ -13,10 +13,10 @@ import (
"github.com/mhe/gabi" "github.com/mhe/gabi"
"github.com/mhe/gabi/big" "github.com/mhe/gabi/big"
"github.com/privacybydesign/irmago" "github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/irmaserver" "github.com/privacybydesign/irmago/server"
) )
func Initialize(configuration *irmaserver.Configuration) error { func Initialize(configuration *server.Configuration) error {
conf = configuration conf = configuration
if conf.Logger == nil { if conf.Logger == nil {
...@@ -24,7 +24,7 @@ func Initialize(configuration *irmaserver.Configuration) error { ...@@ -24,7 +24,7 @@ func Initialize(configuration *irmaserver.Configuration) error {
conf.Logger.Level = logrus.DebugLevel conf.Logger.Level = logrus.DebugLevel
conf.Logger.Formatter = &logrus.TextFormatter{} conf.Logger.Formatter = &logrus.TextFormatter{}
} }
irmaserver.Logger = conf.Logger server.Logger = conf.Logger
if conf.IrmaConfiguration == nil { if conf.IrmaConfiguration == nil {
var err error var err error
...@@ -102,7 +102,7 @@ func StartSession(request irma.SessionRequest) (*irma.Qr, string, error) { ...@@ -102,7 +102,7 @@ func StartSession(request irma.SessionRequest) (*irma.Qr, string, error) {
}, session.token, nil }, session.token, nil
} }
func GetSessionResult(token string) *irmaserver.SessionResult { func GetSessionResult(token string) *server.SessionResult {
session := sessions.get(token) session := sessions.get(token)
if session == nil { if session == nil {
return nil return nil
...@@ -115,7 +115,7 @@ func HandleProtocolMessage( ...@@ -115,7 +115,7 @@ func HandleProtocolMessage(
method string, method string,
headers map[string][]string, headers map[string][]string,
message []byte, message []byte,
) (status int, output []byte, result *irmaserver.SessionResult) { ) (status int, output []byte, result *server.SessionResult) {
// Parse path into session and action // Parse path into session and action
if len(path) > 0 { // Remove any starting and trailing slash if len(path) > 0 { // Remove any starting and trailing slash
if path[0] == '/' { if path[0] == '/' {
...@@ -130,7 +130,7 @@ func HandleProtocolMessage( ...@@ -130,7 +130,7 @@ func HandleProtocolMessage(
matches := pattern.FindStringSubmatch(path) matches := pattern.FindStringSubmatch(path)
if len(matches) != 3 { if len(matches) != 3 {
conf.Logger.Warnf("Invalid URL: %s", path) conf.Logger.Warnf("Invalid URL: %s", path)
status, output = irmaserver.JsonResponse(nil, irmaserver.RemoteError(irmaserver.ErrorInvalidRequest, "")) status, output = server.JsonResponse(nil, server.RemoteError(server.ErrorInvalidRequest, ""))
return return
} }
...@@ -140,7 +140,7 @@ func HandleProtocolMessage( ...@@ -140,7 +140,7 @@ func HandleProtocolMessage(
session := sessions.get(token) session := sessions.get(token)
if session == nil { if session == nil {
conf.Logger.Warnf("Session not found: %s", token) conf.Logger.Warnf("Session not found: %s", token)
status, output = irmaserver.JsonResponse(nil, irmaserver.RemoteError(irmaserver.ErrorSessionUnknown, "")) status, output = server.JsonResponse(nil, server.RemoteError(server.ErrorSessionUnknown, ""))
return return
} }
session.Lock() session.Lock()
...@@ -170,53 +170,53 @@ func HandleProtocolMessage( ...@@ -170,53 +170,53 @@ func HandleProtocolMessage(
min := &irma.ProtocolVersion{} min := &irma.ProtocolVersion{}
max := &irma.ProtocolVersion{} max := &irma.ProtocolVersion{}
if err := json.Unmarshal([]byte(h.Get(irma.MinVersionHeader)), min); err != nil { if err := json.Unmarshal([]byte(h.Get(irma.MinVersionHeader)), min); err != nil {
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorMalformedInput, err.Error())) status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, err.Error()))
return return
} }
if err := json.Unmarshal([]byte(h.Get(irma.MaxVersionHeader)), max); err != nil { if err := json.Unmarshal([]byte(h.Get(irma.MaxVersionHeader)), max); err != nil {
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorMalformedInput, err.Error())) status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, err.Error()))
return return
} }
status, output = irmaserver.JsonResponse(session.handleGetRequest(min, max)) status, output = server.JsonResponse(session.handleGetRequest(min, max))
return return
} }
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorInvalidRequest, "")) status, output = server.JsonResponse(nil, session.fail(server.ErrorInvalidRequest, ""))
return return
default: default:
if method != http.MethodPost { if method != http.MethodPost {
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorInvalidRequest, "")) status, output = server.JsonResponse(nil, session.fail(server.ErrorInvalidRequest, ""))
return return
} }
if verb == "commitments" && session.action == irma.ActionIssuing { if verb == "commitments" && session.action == irma.ActionIssuing {
commitments := &gabi.IssueCommitmentMessage{} commitments := &gabi.IssueCommitmentMessage{}
if err := irma.UnmarshalValidate(message, commitments); err != nil { if err := irma.UnmarshalValidate(message, commitments); err != nil {
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorMalformedInput, "")) status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, ""))
return return
} }
status, output = irmaserver.JsonResponse(session.handlePostCommitments(commitments)) status, output = server.JsonResponse(session.handlePostCommitments(commitments))
return return
} }
if verb == "proofs" && session.action == irma.ActionDisclosing { if verb == "proofs" && session.action == irma.ActionDisclosing {
proofs := gabi.ProofList{} proofs := gabi.ProofList{}
if err := irma.UnmarshalValidate(message, &proofs); err != nil { if err := irma.UnmarshalValidate(message, &proofs); err != nil {
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorMalformedInput, "")) status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, ""))
return return
} }
status, output = irmaserver.JsonResponse(session.handlePostProofs(proofs)) status, output = server.JsonResponse(session.handlePostProofs(proofs))
return return
} }
if verb == "proofs" && session.action == irma.ActionSigning { if verb == "proofs" && session.action == irma.ActionSigning {
signature := &irma.SignedMessage{} signature := &irma.SignedMessage{}
if err := irma.UnmarshalValidate(message, signature); err != nil { if err := irma.UnmarshalValidate(message, signature); err != nil {
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorMalformedInput, "")) status, output = server.JsonResponse(nil, session.fail(server.ErrorMalformedInput, ""))
return return
} }
status, output = irmaserver.JsonResponse(session.handlePostSignature(signature)) status, output = server.JsonResponse(session.handlePostSignature(signature))
return return
} }
status, output = irmaserver.JsonResponse(nil, session.fail(irmaserver.ErrorInvalidRequest, "")) status, output = server.JsonResponse(nil, session.fail(server.ErrorInvalidRequest, ""))
return return
} }
} }
...@@ -3,7 +3,7 @@ package backend ...@@ -3,7 +3,7 @@ package backend
import ( import (
"github.com/mhe/gabi" "github.com/mhe/gabi"
"github.com/privacybydesign/irmago" "github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/irmaserver" "github.com/privacybydesign/irmago/server"
) )
// This file contains the handler functions for the protocol messages, receiving and returning normally // This file contains the handler functions for the protocol messages, receiving and returning normally
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
// Maintaining the session state is done here, as well as checking whether the session is in the // Maintaining the session state is done here, as well as checking whether the session is in the
// appropriate status before handling the request. // appropriate status before handling the request.
var conf *irmaserver.Configuration var conf *server.Configuration
func (session *session) handleDelete() { func (session *session) handleDelete() {
if session.finished() { if session.finished() {
...@@ -19,29 +19,29 @@ func (session *session) handleDelete() { ...@@ -19,29 +19,29 @@ func (session *session) handleDelete() {
} }
session.markAlive() session.markAlive()
session.result = &irmaserver.SessionResult{Token: session.token, Status: irmaserver.StatusCancelled} session.result = &server.SessionResult{Token: session.token, Status: server.StatusCancelled}
session.setStatus(irmaserver.StatusCancelled) session.setStatus(server.StatusCancelled)
} }
func (session *session) handleGetRequest(min, max *irma.ProtocolVersion) (irma.SessionRequest, *irma.RemoteError) { func (session *session) handleGetRequest(min, max *irma.ProtocolVersion) (irma.SessionRequest, *irma.RemoteError) {
if session.status != irmaserver.StatusInitialized { if session.status != server.StatusInitialized {
return nil, irmaserver.RemoteError(irmaserver.ErrorUnexpectedRequest, "Session already started") return nil, server.RemoteError(server.ErrorUnexpectedRequest, "Session already started")
} }
session.markAlive() session.markAlive()
var err error var err error
if session.version, err = chooseProtocolVersion(min, max); err != nil { if session.version, err = chooseProtocolVersion(min, max); err != nil {
return nil, session.fail(irmaserver.ErrorProtocolVersion, "") return nil, session.fail(server.ErrorProtocolVersion, "")
} }
session.request.SetVersion(session.version) session.request.SetVersion(session.version)
session.setStatus(irmaserver.StatusConnected) session.setStatus(server.StatusConnected)
return session.request, nil return session.request, nil
} }
func (session *session) handlePostSignature(signature *irma.SignedMessage) (*irma.ProofStatus, *irma.RemoteError) { func (session *session) handlePostSignature(signature *irma.SignedMessage) (*irma.ProofStatus, *irma.RemoteError) {
if session.status != irmaserver.StatusConnected { if session.status != server.StatusConnected {
return nil, irmaserver.RemoteError(irmaserver.ErrorUnexpectedRequest, "Session not yet started or already finished") return nil, server.RemoteError(server.ErrorUnexpectedRequest, "Session not yet started or already finished")
} }
session.markAlive() session.markAlive()
...@@ -51,21 +51,21 @@ func (session *session) handlePostSignature(signature *irma.SignedMessage) (*irm ...@@ -51,21 +51,21 @@ func (session *session) handlePostSignature(signature *irma.SignedMessage) (*irm
session.result.Disclosed, session.result.ProofStatus, err = signature.Verify( session.result.Disclosed, session.result.ProofStatus, err = signature.Verify(
conf.IrmaConfiguration, session.request.(*irma.SignatureRequest)) conf.IrmaConfiguration, session.request.(*irma.SignatureRequest))
if err == nil { if err == nil {
session.setStatus(irmaserver.StatusDone) session.setStatus(server.StatusDone)
} else { } else {
session.setStatus(irmaserver.StatusCancelled) session.setStatus(server.StatusCancelled)
if err == irma.ErrorMissingPublicKey { if err == irma.ErrorMissingPublicKey {
rerr = session.fail(irmaserver.ErrorUnknownPublicKey, err.Error()) rerr = session.fail(server.ErrorUnknownPublicKey, err.Error())
} else { } else {
rerr = session.fail(irmaserver.ErrorUnknown, err.Error()) rerr = session.fail(server.ErrorUnknown, err.Error())
} }
} }
return &session.result.ProofStatus, rerr return &session.result.ProofStatus, rerr
} }
func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStatus, *irma.RemoteError) { func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStatus, *irma.RemoteError) {
if session.status != irmaserver.StatusConnected { if session.status != server.StatusConnected {
return nil, irmaserver.RemoteError(irmaserver.ErrorUnexpectedRequest, "Session not yet started or already finished") return nil, server.RemoteError(server.ErrorUnexpectedRequest, "Session not yet started or already finished")
} }
session.markAlive() session.markAlive()
...@@ -74,35 +74,35 @@ func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStat ...@@ -74,35 +74,35 @@ func (session *session) handlePostProofs(proofs gabi.ProofList) (*irma.ProofStat
session.result.Disclosed, session.result.ProofStatus, err = irma.ProofList(proofs).Verify( session.result.Disclosed, session.result.ProofStatus, err = irma.ProofList(proofs).Verify(
conf.IrmaConfiguration, session.request.(*irma.DisclosureRequest)) conf.IrmaConfiguration, session.request.(*irma.DisclosureRequest))
if err == nil { if err == nil {
session.setStatus(irmaserver.StatusDone) session.setStatus(server.StatusDone)
} else { } else {
session.setStatus(irmaserver.StatusCancelled) session.setStatus(server.StatusCancelled)
if err == irma.ErrorMissingPublicKey { if err == irma.ErrorMissingPublicKey {
rerr = session.fail(irmaserver.ErrorUnknownPublicKey, err.Error()) rerr = session.fail(server.ErrorUnknownPublicKey, err.Error())
} else { } else {
rerr = session.fail(irmaserver.ErrorUnknown, err.Error()) rerr = session.fail(server.ErrorUnknown, err.Error())
} }
} }
return &session.result.ProofStatus, rerr return &session.result.ProofStatus, rerr
} }
func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentMessage) ([]*gabi.IssueSignatureMessage, *irma.RemoteError) { func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentMessage) ([]*gabi.IssueSignatureMessage, *irma.RemoteError) {
if session.status != irmaserver.StatusConnected { if session.status != server.StatusConnected {
return nil, irmaserver.RemoteError(irmaserver.ErrorUnexpectedRequest, "Session not yet started or already finished") return nil, server.RemoteError(server.ErrorUnexpectedRequest, "Session not yet started or already finished")
} }
session.markAlive() session.markAlive()
request := session.request.(*irma.IssuanceRequest) request := session.request.(*irma.IssuanceRequest)
discloseCount := len(request.Disclose) discloseCount := len(request.Disclose)
if len(commitments.Proofs) != len(request.Credentials)+discloseCount { if len(commitments.Proofs) != len(request.Credentials)+discloseCount {
return nil, session.fail(irmaserver.ErrorAttributesMissing, "") return nil, session.fail(server.ErrorAttributesMissing, "")
} }
// Compute list of public keys against which to verify the received proofs // Compute list of public keys against which to verify the received proofs
disclosureproofs := irma.ProofList(commitments.Proofs[:discloseCount]) disclosureproofs := irma.ProofList(commitments.Proofs[:discloseCount])
pubkeys, err := disclosureproofs.ExtractPublicKeys(conf.IrmaConfiguration) pubkeys, err := disclosureproofs.ExtractPublicKeys(conf.IrmaConfiguration)
if err != nil { if err != nil {
return nil, session.fail(irmaserver.ErrorInvalidProofs, err.Error()) return nil, session.fail(server.ErrorInvalidProofs, err.Error())
} }
for _, cred := range request.Credentials { for _, cred := range request.Credentials {
iss := cred.CredentialTypeID.IssuerIdentifier() iss := cred.CredentialTypeID.IssuerIdentifier()
...@@ -117,7 +117,7 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM ...@@ -117,7 +117,7 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM
if conf.IrmaConfiguration.SchemeManagers[schemeid].Distributed() { if conf.IrmaConfiguration.SchemeManagers[schemeid].Distributed() {
proofP, err := session.getProofP(commitments, schemeid) proofP, err := session.getProofP(commitments, schemeid)
if err != nil { if err != nil {
return nil, session.fail(irmaserver.ErrorKeyshareProofMissing, err.Error()) return nil, session.fail(server.ErrorKeyshareProofMissing, err.Error())
} }
proof.MergeProofP(proofP, pubkey) proof.MergeProofP(proofP, pubkey)
} }
...@@ -128,16 +128,16 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM ...@@ -128,16 +128,16 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM
conf.IrmaConfiguration, request.Disclose, request.Context, request.Nonce, pubkeys, false) conf.IrmaConfiguration, request.Disclose, request.Context, request.Nonce, pubkeys, false)
if err != nil { if err != nil {
if err == irma.ErrorMissingPublicKey { if err == irma.ErrorMissingPublicKey {
return nil, session.fail(irmaserver.ErrorUnknownPublicKey, "") return nil, session.fail(server.ErrorUnknownPublicKey, "")
} else { } else {
return nil, session.fail(irmaserver.ErrorUnknown, "") return nil, session.fail(server.ErrorUnknown, "")
} }
} }
if session.result.ProofStatus == irma.ProofStatusExpired { if session.result.ProofStatus == irma.ProofStatusExpired {
return nil, session.fail(irmaserver.ErrorAttributesExpired, "") return nil, session.fail(server.ErrorAttributesExpired, "")
} }
if session.result.ProofStatus != irma.ProofStatusValid { if session.result.ProofStatus != irma.ProofStatusValid {
return nil, session.fail(irmaserver.ErrorInvalidProofs, "") return nil, session.fail(server.ErrorInvalidProofs, "")
} }
// Compute CL signatures // Compute CL signatures
...@@ -149,15 +149,15 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM ...@@ -149,15 +149,15 @@ func (session *session) handlePostCommitments(commitments *gabi.IssueCommitmentM
proof := commitments.Proofs[i+discloseCount].(*gabi.ProofU) proof := commitments.Proofs[i+discloseCount].(*gabi.ProofU)
attributes, err := cred.AttributeList(conf.IrmaConfiguration, 0x03) attributes, err := cred.AttributeList(conf.IrmaConfiguration, 0x03)
if err != nil { if err != nil {
return nil, session.fail(irmaserver.ErrorIssuanceFailed, err.Error()) return nil, session.fail(server.ErrorIssuanceFailed, err.Error())
} }
sig, err := issuer.IssueSignature(proof.U, attributes.Ints, commitments.Nonce2) sig, err := issuer.IssueSignature(proof.U, attributes.Ints, commitments.Nonce2)
if err != nil { if err != nil {
return nil, session.fail(irmaserver.ErrorIssuanceFailed, err.Error()) return nil, session.fail(server.ErrorIssuanceFailed, err.Error())
} }
sigs = append(sigs, sig) sigs = append(sigs, sig)
} }
session.setStatus(irmaserver.StatusDone) session.setStatus(server.StatusDone)
return sigs, nil return sigs, nil
} }
...@@ -8,30 +8,30 @@ import ( ...@@ -8,30 +8,30 @@ import (
"github.com/go-errors/errors" "github.com/go-errors/errors"
"github.com/mhe/gabi" "github.com/mhe/gabi"
"github.com/privacybydesign/irmago" "github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/irmaserver" "github.com/privacybydesign/irmago/server"
) )
// Session helpers // Session helpers
func (session *session) finished() bool { func (session *session) finished() bool {
return session.status == irmaserver.StatusDone || return session.status == server.StatusDone ||
session.status == irmaserver.StatusCancelled || session.status == server.StatusCancelled ||
session.status == irmaserver.StatusTimeout session.status == server.StatusTimeout
} }
func (session *session) markAlive() { func (session *session) markAlive() {
session.lastActive = time.Now()