version is a complete set of information about an Identity at a point in time.
| 21 | |
| 22 | // version is a complete set of information about an Identity at a point in time. |
| 23 | type version struct { |
| 24 | name string |
| 25 | email string // as defined in git or from a bridge when importing the identity |
| 26 | login string // from a bridge when importing the identity |
| 27 | avatarURL string |
| 28 | |
| 29 | // The lamport times of the other entities at which this version become effective |
| 30 | times map[string]lamport.Time |
| 31 | unixTime int64 |
| 32 | |
| 33 | // The set of keys valid at that time, from this version onward, until they get removed |
| 34 | // in a new version. This allows to have multiple key for the same identity (e.g. one per |
| 35 | // device) as well as revoke key. |
| 36 | keys []*Key |
| 37 | |
| 38 | // mandatory random bytes to ensure a better randomness of the data of the first |
| 39 | // version of an identity, used to later generate the ID |
| 40 | // len(Nonce) should be > 20 and < 64 bytes |
| 41 | // It has no functional purpose and should be ignored. |
| 42 | // TODO: optional after first version? |
| 43 | nonce []byte |
| 44 | |
| 45 | // A set of arbitrary key/value to store metadata about a version or about an Identity in general. |
| 46 | metadata map[string]string |
| 47 | |
| 48 | // Not serialized. Store the version's id in memory. |
| 49 | id entity.Id |
| 50 | // Not serialized |
| 51 | commitHash repository.Hash |
| 52 | } |
| 53 | |
| 54 | func newVersion(repo repository.RepoClock, name string, email string, login string, avatarURL string, keys []*Key) (*version, error) { |
| 55 | clocks, err := repo.AllClocks() |
nothing calls this directly
no outgoing calls
no test coverage detected