api.go 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package irmaserver

import (
	"github.com/Sirupsen/logrus"
	"github.com/mhe/gabi"
	"github.com/privacybydesign/irmago"
)

type Configuration struct {
	IrmaConfigurationPath string

	PrivateKeys       map[irma.IssuerIdentifier]*gabi.PrivateKey
	IrmaConfiguration *irma.Configuration
	Logger            *logrus.Logger
}

type SessionResult struct {
Sietse Ringers's avatar
Sietse Ringers committed
18
19
20
21
22
23
	Token       string
	Status      Status
	ProofStatus irma.ProofStatus
	Disclosed   []*irma.DisclosedAttribute
	Signature   *irma.SignedMessage
	Err         *irma.RemoteError
24
25
}

Sietse Ringers's avatar
Sietse Ringers committed
26
// Status is the status of an IRMA session.
27
28
29
type Status string

const (
Sietse Ringers's avatar
Sietse Ringers committed
30
31
32
33
34
	StatusInitialized Status = "INITIALIZED" // The session has been started and is waiting for the client
	StatusConnected   Status = "CONNECTED"   // The client has retrieved the session request, we wait for its response
	StatusCancelled   Status = "CANCELLED"   // The session is cancelled, possibly due to an error
	StatusDone        Status = "DONE"        // The session has completed successfully
	StatusTimeout     Status = "TIMEOUT"     // Session timed out
35
)