aboutsummaryrefslogtreecommitdiffstats
path: root/identity/version.go
diff options
context:
space:
mode:
Diffstat (limited to 'identity/version.go')
-rw-r--r--identity/version.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/identity/version.go b/identity/version.go
index 85195049..f9c7b262 100644
--- a/identity/version.go
+++ b/identity/version.go
@@ -30,7 +30,7 @@ type Version struct {
// The set of keys valid at that time, from this version onward, until they get removed
// in a new version. This allow to have multiple key for the same identity (e.g. one per
// device) as well as revoke key.
- keys []Key
+ keys []*Key
// This optional array is here to ensure a better randomness of the identity id to avoid collisions.
// It has no functional purpose and should be ignored.
@@ -53,24 +53,22 @@ type VersionJSON struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
AvatarUrl string `json:"avatar_url,omitempty"`
- Keys []Key `json:"pub_keys,omitempty"`
+ Keys []*Key `json:"pub_keys,omitempty"`
Nonce []byte `json:"nonce,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
// Make a deep copy
func (v *Version) Clone() *Version {
-
clone := &Version{
name: v.name,
email: v.email,
avatarURL: v.avatarURL,
- keys: make([]Key, len(v.keys)),
- metadata: make(map[string]string),
+ keys: make([]*Key, len(v.keys)),
}
- for i, op := range opp.Operations {
- clone.Operations[i] = op
+ for i, key := range v.keys {
+ clone.keys[i] = key.Clone()
}
return clone