1package identity
2
3import (
4 "github.com/MichaelMure/git-bug/repository"
5 "github.com/MichaelMure/git-bug/util/lamport"
6)
7
8type Interface interface {
9 Id() string
10
11 Name() string
12 Email() string
13 Login() string
14 AvatarUrl() string
15
16 // Keys return the last version of the valid keys
17 Keys() []Key
18
19 // ValidKeysAtTime return the set of keys valid at a given lamport time
20 ValidKeysAtTime(time lamport.Time) []Key
21
22 // DisplayName return a non-empty string to display, representing the
23 // identity, based on the non-empty values.
24 DisplayName() string
25
26 // Validate check if the Identity data is valid
27 Validate() error
28
29 // Write the identity into the Repository. In particular, this ensure that
30 // the Id is properly set.
31 Commit(repo repository.Repo) error
32
33 // IsProtected return true if the chain of git commits started to be signed.
34 // If that's the case, only signed commit with a valid key for this identity can be added.
35 IsProtected() bool
36}