logs.go 1.72 KB
Newer Older
1
package irmaclient
Sietse Ringers's avatar
Sietse Ringers committed
2
3

import (
Tomas's avatar
Tomas committed
4
	"github.com/bwesterb/go-atum"
Sietse Ringers's avatar
Sietse Ringers committed
5
	"github.com/mhe/gabi"
6
	"github.com/privacybydesign/irmago"
Sietse Ringers's avatar
Sietse Ringers committed
7
8
)

Sietse Ringers's avatar
Sietse Ringers committed
9
// LogEntry is a log entry of a past event.
Sietse Ringers's avatar
Sietse Ringers committed
10
type LogEntry struct {
Sietse Ringers's avatar
Sietse Ringers committed
11
	// General info
12
13
14
	Type    irma.Action
	Time    irma.Timestamp        // Time at which the session was completed
	Version *irma.ProtocolVersion `json:",omitempty"` // Protocol version that was used in the session
15
	//Request irma.SessionRequest   `json:",omitempty"` // Message that started the session
Sietse Ringers's avatar
Sietse Ringers committed
16

Sietse Ringers's avatar
Sietse Ringers committed
17
	// Session type-specific info
Tomas's avatar
Tomas committed
18
19
20
	Removed       map[irma.CredentialTypeIdentifier][]irma.TranslatedString `json:",omitempty"` // In case of credential removal
	SignedMessage []byte                                                    `json:",omitempty"` // In case of signature sessions
	Timestamp     *atum.Timestamp                                           `json:",omitempty"` // In case of signature sessions
Sietse Ringers's avatar
Sietse Ringers committed
21

Tomas's avatar
Tomas committed
22
23
	IssueCommitment *gabi.IssueCommitmentMessage `json:",omitempty"`
	ProofList       gabi.ProofList               `json:",omitempty"`
Sietse Ringers's avatar
Sietse Ringers committed
24
25
}

26
const actionRemoval = irma.Action("removal")
27

Tomas's avatar
Tomas committed
28
// GetDisclosedCredentials gets the list of disclosed credentials for a log entry
29
func (entry *LogEntry) GetDisclosedCredentials(conf *irma.Configuration) ([]*irma.DisclosedAttribute, error) {
30
	return nil, nil
Tomas's avatar
Tomas committed
31
32
33
34
}

// GetIssuedCredentials gets the list of issued credentials for a log entry
func (entry *LogEntry) GetIssuedCredentials(conf *irma.Configuration) (list irma.CredentialInfoList, err error) {
35
	return nil, nil
Tomas's avatar
Tomas committed
36
37
38
}

// GetSignedMessage gets the signed for a log entry
39
func (entry *LogEntry) GetSignedMessage() (abs *irma.SignedMessage, err error) {
40
	return nil, nil
Tomas's avatar
Tomas committed
41
42
}

43
func (session *session) createLogEntry(response interface{}) (*LogEntry, error) {
44
	return nil, nil
Sietse Ringers's avatar
Sietse Ringers committed
45
}