blob: bbb94be7c2968447b2d28a833e75b6068617b9e9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
package identity
import (
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/lamport"
"github.com/MichaelMure/git-bug/util/timestamp"
)
type Interface interface {
// Id return the Identity identifier
Id() entity.Id
// Name return the last version of the name
// Can be empty.
Name() string
// Email return the last version of the email
// Can be empty.
Email() string
// Login return the last version of the login
// Can be empty.
// Warning: this login can be defined when importing from a bridge but should *not* be
// used to identify an identity as multiple bridge with different login can map to the same
// identity. Use the metadata system for that usage instead.
Login() string
// AvatarUrl return the last version of the Avatar URL
// Can be empty.
AvatarUrl() string
// Keys return the last version of the valid keys
// Can be empty.
Keys() []*Key
// ValidKeysAtTime return the set of keys valid at a given lamport time
// Can be empty.
ValidKeysAtTime(time lamport.Time) []*Key
// DisplayName return a non-empty string to display, representing the
// identity, based on the non-empty values.
DisplayName() string
// Validate check if the Identity data is valid
Validate() error
// Write the identity into the Repository. In particular, this ensure that
// the Id is properly set.
Commit(repo repository.ClockedRepo) error
// If needed, write the identity into the Repository. In particular, this
// ensure that the Id is properly set.
CommitAsNeeded(repo repository.ClockedRepo) error
// IsProtected return true if the chain of git commits started to be signed.
// If that's the case, only signed commit with a valid key for this identity can be added.
IsProtected() bool
// LastModificationLamportTime return the Lamport time at which the last version of the identity became valid.
LastModificationLamport() lamport.Time
// LastModification return the timestamp at which the last version of the identity became valid.
LastModification() timestamp.Timestamp
}
|