diff --git a/keybase.go b/keybase.go index fa2313f..d2f48c0 100644 --- a/keybase.go +++ b/keybase.go @@ -119,10 +119,10 @@ func (k *Keybase) version() string { } // UserLookup pulls information about users. -// The following fields are currently returned: basics, profile, proofs_summary +// The following fields are currently returned: basics, profile, proofs_summary, devices // See https://keybase.io/docs/api/1.0/call/user/lookup for more info func (k *Keybase) UserLookup(users ...string) (UserAPI, error) { - var fields = []string{"basics", "profile", "proofs_summary"} + var fields = []string{"basics", "profile", "proofs_summary", "devices"} cmdOut, err := k.Exec("apicall", "--arg", fmt.Sprintf("usernames=%s", strings.Join(users, ",")), "--arg", fmt.Sprintf("fields=%s", strings.Join(fields, ",")), "user/lookup") if err != nil { diff --git a/types.go b/types.go index ee044f2..afc54ad 100644 --- a/types.go +++ b/types.go @@ -648,11 +648,27 @@ type proofsSummary struct { HasWeb bool `json:"has_web"` } +type key struct { + KeyRole int `json:"key_role"` + Kid string `json:"kid"` + SigID string `json:"sig_id"` +} + +type uDevice struct { + Ctime int `json:"ctime"` + Keys []key `json:"keys"` + Mtime int `json:"mtime"` + Name string `json:"name"` + Status int `json:"status"` + Type string `json:"type"` +} + type them struct { - Basics basics `json:"basics,omitempty"` - ID string `json:"id"` - Profile profile `json:"profile,omitempty"` - ProofsSummary proofsSummary `json:"proofs_summary"` + Basics basics `json:"basics,omitempty"` + ID string `json:"id"` + Profile profile `json:"profile,omitempty"` + ProofsSummary proofsSummary `json:"proofs_summary"` + Devices map[string]uDevice `json:"devices,omitempty"` } // Keybase holds basic information about the local Keybase executable