This repository has been archived by the owner on Jul 7, 2020. It is now read-only.
forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
identify_common.go
336 lines (297 loc) · 9.3 KB
/
identify_common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
// Auto-generated by avdl-compiler v1.3.22 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/keybase1/identify_common.avdl
package keybase1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type TrackToken string
func (o TrackToken) DeepCopy() TrackToken {
return o
}
type SigVersion int
func (o SigVersion) DeepCopy() SigVersion {
return o
}
type TrackDiffType int
const (
TrackDiffType_NONE TrackDiffType = 0
TrackDiffType_ERROR TrackDiffType = 1
TrackDiffType_CLASH TrackDiffType = 2
TrackDiffType_REVOKED TrackDiffType = 3
TrackDiffType_UPGRADED TrackDiffType = 4
TrackDiffType_NEW TrackDiffType = 5
TrackDiffType_REMOTE_FAIL TrackDiffType = 6
TrackDiffType_REMOTE_WORKING TrackDiffType = 7
TrackDiffType_REMOTE_CHANGED TrackDiffType = 8
TrackDiffType_NEW_ELDEST TrackDiffType = 9
TrackDiffType_NONE_VIA_TEMPORARY TrackDiffType = 10
)
func (o TrackDiffType) DeepCopy() TrackDiffType { return o }
var TrackDiffTypeMap = map[string]TrackDiffType{
"NONE": 0,
"ERROR": 1,
"CLASH": 2,
"REVOKED": 3,
"UPGRADED": 4,
"NEW": 5,
"REMOTE_FAIL": 6,
"REMOTE_WORKING": 7,
"REMOTE_CHANGED": 8,
"NEW_ELDEST": 9,
"NONE_VIA_TEMPORARY": 10,
}
var TrackDiffTypeRevMap = map[TrackDiffType]string{
0: "NONE",
1: "ERROR",
2: "CLASH",
3: "REVOKED",
4: "UPGRADED",
5: "NEW",
6: "REMOTE_FAIL",
7: "REMOTE_WORKING",
8: "REMOTE_CHANGED",
9: "NEW_ELDEST",
10: "NONE_VIA_TEMPORARY",
}
func (e TrackDiffType) String() string {
if v, ok := TrackDiffTypeRevMap[e]; ok {
return v
}
return ""
}
type TrackDiff struct {
Type TrackDiffType `codec:"type" json:"type"`
DisplayMarkup string `codec:"displayMarkup" json:"displayMarkup"`
}
func (o TrackDiff) DeepCopy() TrackDiff {
return TrackDiff{
Type: o.Type.DeepCopy(),
DisplayMarkup: o.DisplayMarkup,
}
}
type TrackSummary struct {
Username string `codec:"username" json:"username"`
Time Time `codec:"time" json:"time"`
IsRemote bool `codec:"isRemote" json:"isRemote"`
}
func (o TrackSummary) DeepCopy() TrackSummary {
return TrackSummary{
Username: o.Username,
Time: o.Time.DeepCopy(),
IsRemote: o.IsRemote,
}
}
// TrackStatus is a summary of this track before the track is approved by the
// user.
// NEW_*: New tracks
// UPDATE_*: Update to an existing track
// NEW_OK: Everything ok
// NEW_ZERO_PROOFS: User being tracked has no proofs
// NEW_FAIL_PROOFS: User being tracked has some failed proofs
// UPDATE_BROKEN: Previous tracking statement broken, this one will fix it.
// UPDATE_NEW_PROOFS: Previous tracking statement ok, but there are new proofs since previous tracking statement generated
// UPDATE_OK: No changes to previous tracking statement
type TrackStatus int
const (
TrackStatus_NEW_OK TrackStatus = 1
TrackStatus_NEW_ZERO_PROOFS TrackStatus = 2
TrackStatus_NEW_FAIL_PROOFS TrackStatus = 3
TrackStatus_UPDATE_BROKEN_FAILED_PROOFS TrackStatus = 4
TrackStatus_UPDATE_NEW_PROOFS TrackStatus = 5
TrackStatus_UPDATE_OK TrackStatus = 6
TrackStatus_UPDATE_BROKEN_REVOKED TrackStatus = 7
)
func (o TrackStatus) DeepCopy() TrackStatus { return o }
var TrackStatusMap = map[string]TrackStatus{
"NEW_OK": 1,
"NEW_ZERO_PROOFS": 2,
"NEW_FAIL_PROOFS": 3,
"UPDATE_BROKEN_FAILED_PROOFS": 4,
"UPDATE_NEW_PROOFS": 5,
"UPDATE_OK": 6,
"UPDATE_BROKEN_REVOKED": 7,
}
var TrackStatusRevMap = map[TrackStatus]string{
1: "NEW_OK",
2: "NEW_ZERO_PROOFS",
3: "NEW_FAIL_PROOFS",
4: "UPDATE_BROKEN_FAILED_PROOFS",
5: "UPDATE_NEW_PROOFS",
6: "UPDATE_OK",
7: "UPDATE_BROKEN_REVOKED",
}
func (e TrackStatus) String() string {
if v, ok := TrackStatusRevMap[e]; ok {
return v
}
return ""
}
type TrackOptions struct {
LocalOnly bool `codec:"localOnly" json:"localOnly"`
BypassConfirm bool `codec:"bypassConfirm" json:"bypassConfirm"`
ForceRetrack bool `codec:"forceRetrack" json:"forceRetrack"`
ExpiringLocal bool `codec:"expiringLocal" json:"expiringLocal"`
ForPGPPull bool `codec:"forPGPPull" json:"forPGPPull"`
SigVersion *SigVersion `codec:"sigVersion,omitempty" json:"sigVersion,omitempty"`
}
func (o TrackOptions) DeepCopy() TrackOptions {
return TrackOptions{
LocalOnly: o.LocalOnly,
BypassConfirm: o.BypassConfirm,
ForceRetrack: o.ForceRetrack,
ExpiringLocal: o.ExpiringLocal,
ForPGPPull: o.ForPGPPull,
SigVersion: (func(x *SigVersion) *SigVersion {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.SigVersion),
}
}
type IdentifyReasonType int
const (
IdentifyReasonType_NONE IdentifyReasonType = 0
IdentifyReasonType_ID IdentifyReasonType = 1
IdentifyReasonType_TRACK IdentifyReasonType = 2
IdentifyReasonType_ENCRYPT IdentifyReasonType = 3
IdentifyReasonType_DECRYPT IdentifyReasonType = 4
IdentifyReasonType_VERIFY IdentifyReasonType = 5
IdentifyReasonType_RESOURCE IdentifyReasonType = 6
IdentifyReasonType_BACKGROUND IdentifyReasonType = 7
)
func (o IdentifyReasonType) DeepCopy() IdentifyReasonType { return o }
var IdentifyReasonTypeMap = map[string]IdentifyReasonType{
"NONE": 0,
"ID": 1,
"TRACK": 2,
"ENCRYPT": 3,
"DECRYPT": 4,
"VERIFY": 5,
"RESOURCE": 6,
"BACKGROUND": 7,
}
var IdentifyReasonTypeRevMap = map[IdentifyReasonType]string{
0: "NONE",
1: "ID",
2: "TRACK",
3: "ENCRYPT",
4: "DECRYPT",
5: "VERIFY",
6: "RESOURCE",
7: "BACKGROUND",
}
func (e IdentifyReasonType) String() string {
if v, ok := IdentifyReasonTypeRevMap[e]; ok {
return v
}
return ""
}
type IdentifyReason struct {
Type IdentifyReasonType `codec:"type" json:"type"`
Reason string `codec:"reason" json:"reason"`
Resource string `codec:"resource" json:"resource"`
}
func (o IdentifyReason) DeepCopy() IdentifyReason {
return IdentifyReason{
Type: o.Type.DeepCopy(),
Reason: o.Reason,
Resource: o.Resource,
}
}
type IdentifyOutcome struct {
Username string `codec:"username" json:"username"`
Status *Status `codec:"status,omitempty" json:"status,omitempty"`
Warnings []string `codec:"warnings" json:"warnings"`
TrackUsed *TrackSummary `codec:"trackUsed,omitempty" json:"trackUsed,omitempty"`
TrackStatus TrackStatus `codec:"trackStatus" json:"trackStatus"`
NumTrackFailures int `codec:"numTrackFailures" json:"numTrackFailures"`
NumTrackChanges int `codec:"numTrackChanges" json:"numTrackChanges"`
NumProofFailures int `codec:"numProofFailures" json:"numProofFailures"`
NumRevoked int `codec:"numRevoked" json:"numRevoked"`
NumProofSuccesses int `codec:"numProofSuccesses" json:"numProofSuccesses"`
Revoked []TrackDiff `codec:"revoked" json:"revoked"`
TrackOptions TrackOptions `codec:"trackOptions" json:"trackOptions"`
ForPGPPull bool `codec:"forPGPPull" json:"forPGPPull"`
Reason IdentifyReason `codec:"reason" json:"reason"`
}
func (o IdentifyOutcome) DeepCopy() IdentifyOutcome {
return IdentifyOutcome{
Username: o.Username,
Status: (func(x *Status) *Status {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Status),
Warnings: (func(x []string) []string {
if x == nil {
return nil
}
var ret []string
for _, v := range x {
vCopy := v
ret = append(ret, vCopy)
}
return ret
})(o.Warnings),
TrackUsed: (func(x *TrackSummary) *TrackSummary {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackUsed),
TrackStatus: o.TrackStatus.DeepCopy(),
NumTrackFailures: o.NumTrackFailures,
NumTrackChanges: o.NumTrackChanges,
NumProofFailures: o.NumProofFailures,
NumRevoked: o.NumRevoked,
NumProofSuccesses: o.NumProofSuccesses,
Revoked: (func(x []TrackDiff) []TrackDiff {
if x == nil {
return nil
}
var ret []TrackDiff
for _, v := range x {
vCopy := v.DeepCopy()
ret = append(ret, vCopy)
}
return ret
})(o.Revoked),
TrackOptions: o.TrackOptions.DeepCopy(),
ForPGPPull: o.ForPGPPull,
Reason: o.Reason.DeepCopy(),
}
}
type RemoteProof struct {
ProofType ProofType `codec:"proofType" json:"proofType"`
Key string `codec:"key" json:"key"`
Value string `codec:"value" json:"value"`
DisplayMarkup string `codec:"displayMarkup" json:"displayMarkup"`
SigID SigID `codec:"sigID" json:"sigID"`
MTime Time `codec:"mTime" json:"mTime"`
}
func (o RemoteProof) DeepCopy() RemoteProof {
return RemoteProof{
ProofType: o.ProofType.DeepCopy(),
Key: o.Key,
Value: o.Value,
DisplayMarkup: o.DisplayMarkup,
SigID: o.SigID.DeepCopy(),
MTime: o.MTime.DeepCopy(),
}
}
type IdentifyCommonInterface interface {
}
func IdentifyCommonProtocol(i IdentifyCommonInterface) rpc.Protocol {
return rpc.Protocol{
Name: "keybase.1.identifyCommon",
Methods: map[string]rpc.ServeHandlerDescription{},
}
}
type IdentifyCommonClient struct {
Cli rpc.GenericClient
}