api.go 1.06 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
package irmaserver

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

type Configuration struct {
	IrmaConfigurationPath string
11
12
13
	PrivateKeysPath       string

	Logger *logrus.Logger
14
15
16
17
18
19

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

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

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

const (
Sietse Ringers's avatar
Sietse Ringers committed
32
33
34
35
36
	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
37
)