Add devices field to UserLookup
This commit is contained in:
@ -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 {
|
||||
|
||||
24
types.go
24
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
|
||||
|
||||
Reference in New Issue
Block a user