aboutsummaryrefslogtreecommitdiffstats
path: root/identity/interface.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-09 13:01:14 +0200
committerMichael Muré <batolettre@gmail.com>2021-04-09 13:01:14 +0200
commit1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7 (patch)
treef6d71c1f29cf06ccab9e4ae434b19ab17caa4385 /identity/interface.go
parent0fd570171d171aa574d7f01d6033a9c01d668465 (diff)
parentbc5f618eba812859bf87ce2c31b278bd518d4555 (diff)
downloadgit-bug-1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7.tar.gz
Merge remote-tracking branch 'origin/master' into dev-gh-bridge
Diffstat (limited to 'identity/interface.go')
-rw-r--r--identity/interface.go28
1 files changed, 16 insertions, 12 deletions
diff --git a/identity/interface.go b/identity/interface.go
index a7174962..5b14295b 100644
--- a/identity/interface.go
+++ b/identity/interface.go
@@ -2,6 +2,7 @@ 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"
)
@@ -13,6 +14,10 @@ type Interface interface {
// Can be empty.
Name() string
+ // DisplayName return a non-empty string to display, representing the
+ // identity, based on the non-empty values.
+ DisplayName() string
+
// Email return the last version of the email
// Can be empty.
Email() string
@@ -32,26 +37,25 @@ type Interface interface {
// Can be empty.
Keys() []*Key
- // ValidKeysAtTime return the set of keys valid at a given lamport time
+ // SigningKey return the key that should be used to sign new messages. If no key is available, return nil.
+ SigningKey(repo repository.RepoKeyring) (*Key, error)
+
+ // ValidKeysAtTime return the set of keys valid at a given lamport time for a given clock of another entity
// Can be empty.
- ValidKeysAtTime(time lamport.Time) []*Key
+ ValidKeysAtTime(clockName string, time lamport.Time) []*Key
- // DisplayName return a non-empty string to display, representing the
- // identity, based on the non-empty values.
- DisplayName() string
+ // LastModification return the timestamp at which the last version of the identity became valid.
+ LastModification() timestamp.Timestamp
- // Validate check if the Identity data is valid
- Validate() error
+ // LastModificationLamports return the lamport times at which the last version of the identity became valid.
+ LastModificationLamports() map[string]lamport.Time
// 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
+ // Validate check if the Identity data is valid
+ Validate() error
// Indicate that the in-memory state changed and need to be commit in the repository
NeedCommit() bool