github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/prove_common.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/keybase1/prove_common.avdl 3 4 package keybase1 5 6 import ( 7 "fmt" 8 "github.com/keybase/go-framed-msgpack-rpc/rpc" 9 ) 10 11 type ProofState int 12 13 const ( 14 ProofState_NONE ProofState = 0 15 ProofState_OK ProofState = 1 16 ProofState_TEMP_FAILURE ProofState = 2 17 ProofState_PERM_FAILURE ProofState = 3 18 ProofState_LOOKING ProofState = 4 19 ProofState_SUPERSEDED ProofState = 5 20 ProofState_POSTED ProofState = 6 21 ProofState_REVOKED ProofState = 7 22 ProofState_DELETED ProofState = 8 23 ProofState_UNKNOWN_TYPE ProofState = 9 24 ProofState_SIG_HINT_MISSING ProofState = 10 25 ProofState_UNCHECKED ProofState = 11 26 ) 27 28 func (o ProofState) DeepCopy() ProofState { return o } 29 30 var ProofStateMap = map[string]ProofState{ 31 "NONE": 0, 32 "OK": 1, 33 "TEMP_FAILURE": 2, 34 "PERM_FAILURE": 3, 35 "LOOKING": 4, 36 "SUPERSEDED": 5, 37 "POSTED": 6, 38 "REVOKED": 7, 39 "DELETED": 8, 40 "UNKNOWN_TYPE": 9, 41 "SIG_HINT_MISSING": 10, 42 "UNCHECKED": 11, 43 } 44 45 var ProofStateRevMap = map[ProofState]string{ 46 0: "NONE", 47 1: "OK", 48 2: "TEMP_FAILURE", 49 3: "PERM_FAILURE", 50 4: "LOOKING", 51 5: "SUPERSEDED", 52 6: "POSTED", 53 7: "REVOKED", 54 8: "DELETED", 55 9: "UNKNOWN_TYPE", 56 10: "SIG_HINT_MISSING", 57 11: "UNCHECKED", 58 } 59 60 func (e ProofState) String() string { 61 if v, ok := ProofStateRevMap[e]; ok { 62 return v 63 } 64 return fmt.Sprintf("%v", int(e)) 65 } 66 67 // 3: It's been found in the hunt, but not proven yet 68 // 1xx: Retryable soft errors; note that this will be put in the proof_cache, but won't 69 // be returned from the proof cache in most cases. Their freshness will always be 70 // RANCID. 71 // 2xx: Will likely result in a hard error, if repeated enough 72 // 3xx: Hard final errors 73 type ProofStatus int 74 75 const ( 76 ProofStatus_NONE ProofStatus = 0 77 ProofStatus_OK ProofStatus = 1 78 ProofStatus_LOCAL ProofStatus = 2 79 ProofStatus_FOUND ProofStatus = 3 80 ProofStatus_BASE_ERROR ProofStatus = 100 81 ProofStatus_HOST_UNREACHABLE ProofStatus = 101 82 ProofStatus_PERMISSION_DENIED ProofStatus = 103 83 ProofStatus_FAILED_PARSE ProofStatus = 106 84 ProofStatus_DNS_ERROR ProofStatus = 107 85 ProofStatus_AUTH_FAILED ProofStatus = 108 86 ProofStatus_HTTP_429 ProofStatus = 129 87 ProofStatus_HTTP_500 ProofStatus = 150 88 ProofStatus_TIMEOUT ProofStatus = 160 89 ProofStatus_INTERNAL_ERROR ProofStatus = 170 90 ProofStatus_UNCHECKED ProofStatus = 171 91 ProofStatus_MISSING_PVL ProofStatus = 172 92 ProofStatus_BASE_HARD_ERROR ProofStatus = 200 93 ProofStatus_NOT_FOUND ProofStatus = 201 94 ProofStatus_CONTENT_FAILURE ProofStatus = 202 95 ProofStatus_BAD_USERNAME ProofStatus = 203 96 ProofStatus_BAD_REMOTE_ID ProofStatus = 204 97 ProofStatus_TEXT_NOT_FOUND ProofStatus = 205 98 ProofStatus_BAD_ARGS ProofStatus = 206 99 ProofStatus_CONTENT_MISSING ProofStatus = 207 100 ProofStatus_TITLE_NOT_FOUND ProofStatus = 208 101 ProofStatus_SERVICE_ERROR ProofStatus = 209 102 ProofStatus_TOR_SKIPPED ProofStatus = 210 103 ProofStatus_TOR_INCOMPATIBLE ProofStatus = 211 104 ProofStatus_HTTP_300 ProofStatus = 230 105 ProofStatus_HTTP_400 ProofStatus = 240 106 ProofStatus_HTTP_OTHER ProofStatus = 260 107 ProofStatus_EMPTY_JSON ProofStatus = 270 108 ProofStatus_DELETED ProofStatus = 301 109 ProofStatus_SERVICE_DEAD ProofStatus = 302 110 ProofStatus_BAD_SIGNATURE ProofStatus = 303 111 ProofStatus_BAD_API_URL ProofStatus = 304 112 ProofStatus_UNKNOWN_TYPE ProofStatus = 305 113 ProofStatus_NO_HINT ProofStatus = 306 114 ProofStatus_BAD_HINT_TEXT ProofStatus = 307 115 ProofStatus_INVALID_PVL ProofStatus = 308 116 ) 117 118 func (o ProofStatus) DeepCopy() ProofStatus { return o } 119 120 var ProofStatusMap = map[string]ProofStatus{ 121 "NONE": 0, 122 "OK": 1, 123 "LOCAL": 2, 124 "FOUND": 3, 125 "BASE_ERROR": 100, 126 "HOST_UNREACHABLE": 101, 127 "PERMISSION_DENIED": 103, 128 "FAILED_PARSE": 106, 129 "DNS_ERROR": 107, 130 "AUTH_FAILED": 108, 131 "HTTP_429": 129, 132 "HTTP_500": 150, 133 "TIMEOUT": 160, 134 "INTERNAL_ERROR": 170, 135 "UNCHECKED": 171, 136 "MISSING_PVL": 172, 137 "BASE_HARD_ERROR": 200, 138 "NOT_FOUND": 201, 139 "CONTENT_FAILURE": 202, 140 "BAD_USERNAME": 203, 141 "BAD_REMOTE_ID": 204, 142 "TEXT_NOT_FOUND": 205, 143 "BAD_ARGS": 206, 144 "CONTENT_MISSING": 207, 145 "TITLE_NOT_FOUND": 208, 146 "SERVICE_ERROR": 209, 147 "TOR_SKIPPED": 210, 148 "TOR_INCOMPATIBLE": 211, 149 "HTTP_300": 230, 150 "HTTP_400": 240, 151 "HTTP_OTHER": 260, 152 "EMPTY_JSON": 270, 153 "DELETED": 301, 154 "SERVICE_DEAD": 302, 155 "BAD_SIGNATURE": 303, 156 "BAD_API_URL": 304, 157 "UNKNOWN_TYPE": 305, 158 "NO_HINT": 306, 159 "BAD_HINT_TEXT": 307, 160 "INVALID_PVL": 308, 161 } 162 163 var ProofStatusRevMap = map[ProofStatus]string{ 164 0: "NONE", 165 1: "OK", 166 2: "LOCAL", 167 3: "FOUND", 168 100: "BASE_ERROR", 169 101: "HOST_UNREACHABLE", 170 103: "PERMISSION_DENIED", 171 106: "FAILED_PARSE", 172 107: "DNS_ERROR", 173 108: "AUTH_FAILED", 174 129: "HTTP_429", 175 150: "HTTP_500", 176 160: "TIMEOUT", 177 170: "INTERNAL_ERROR", 178 171: "UNCHECKED", 179 172: "MISSING_PVL", 180 200: "BASE_HARD_ERROR", 181 201: "NOT_FOUND", 182 202: "CONTENT_FAILURE", 183 203: "BAD_USERNAME", 184 204: "BAD_REMOTE_ID", 185 205: "TEXT_NOT_FOUND", 186 206: "BAD_ARGS", 187 207: "CONTENT_MISSING", 188 208: "TITLE_NOT_FOUND", 189 209: "SERVICE_ERROR", 190 210: "TOR_SKIPPED", 191 211: "TOR_INCOMPATIBLE", 192 230: "HTTP_300", 193 240: "HTTP_400", 194 260: "HTTP_OTHER", 195 270: "EMPTY_JSON", 196 301: "DELETED", 197 302: "SERVICE_DEAD", 198 303: "BAD_SIGNATURE", 199 304: "BAD_API_URL", 200 305: "UNKNOWN_TYPE", 201 306: "NO_HINT", 202 307: "BAD_HINT_TEXT", 203 308: "INVALID_PVL", 204 } 205 206 func (e ProofStatus) String() string { 207 if v, ok := ProofStatusRevMap[e]; ok { 208 return v 209 } 210 return fmt.Sprintf("%v", int(e)) 211 } 212 213 type ProofType int 214 215 const ( 216 ProofType_NONE ProofType = 0 217 ProofType_KEYBASE ProofType = 1 218 ProofType_TWITTER ProofType = 2 219 ProofType_GITHUB ProofType = 3 220 ProofType_REDDIT ProofType = 4 221 ProofType_COINBASE ProofType = 5 222 ProofType_HACKERNEWS ProofType = 6 223 ProofType_FACEBOOK ProofType = 8 224 ProofType_GENERIC_SOCIAL ProofType = 9 225 ProofType_GENERIC_WEB_SITE ProofType = 1000 226 ProofType_DNS ProofType = 1001 227 ProofType_PGP ProofType = 1002 228 ProofType_ROOTER ProofType = 100001 229 ) 230 231 func (o ProofType) DeepCopy() ProofType { return o } 232 233 var ProofTypeMap = map[string]ProofType{ 234 "NONE": 0, 235 "KEYBASE": 1, 236 "TWITTER": 2, 237 "GITHUB": 3, 238 "REDDIT": 4, 239 "COINBASE": 5, 240 "HACKERNEWS": 6, 241 "FACEBOOK": 8, 242 "GENERIC_SOCIAL": 9, 243 "GENERIC_WEB_SITE": 1000, 244 "DNS": 1001, 245 "PGP": 1002, 246 "ROOTER": 100001, 247 } 248 249 var ProofTypeRevMap = map[ProofType]string{ 250 0: "NONE", 251 1: "KEYBASE", 252 2: "TWITTER", 253 3: "GITHUB", 254 4: "REDDIT", 255 5: "COINBASE", 256 6: "HACKERNEWS", 257 8: "FACEBOOK", 258 9: "GENERIC_SOCIAL", 259 1000: "GENERIC_WEB_SITE", 260 1001: "DNS", 261 1002: "PGP", 262 100001: "ROOTER", 263 } 264 265 func (e ProofType) String() string { 266 if v, ok := ProofTypeRevMap[e]; ok { 267 return v 268 } 269 return fmt.Sprintf("%v", int(e)) 270 } 271 272 type SelectorEntry struct { 273 IsIndex bool `codec:"isIndex" json:"isIndex"` 274 Index int `codec:"index" json:"index"` 275 IsKey bool `codec:"isKey" json:"isKey"` 276 Key string `codec:"key" json:"key"` 277 IsAll bool `codec:"isAll" json:"isAll"` 278 IsContents bool `codec:"isContents" json:"isContents"` 279 } 280 281 func (o SelectorEntry) DeepCopy() SelectorEntry { 282 return SelectorEntry{ 283 IsIndex: o.IsIndex, 284 Index: o.Index, 285 IsKey: o.IsKey, 286 Key: o.Key, 287 IsAll: o.IsAll, 288 IsContents: o.IsContents, 289 } 290 } 291 292 type ParamProofJSON struct { 293 SigHash SigID `codec:"sigHash" json:"sig_hash"` 294 KbUsername string `codec:"kbUsername" json:"kb_username"` 295 } 296 297 func (o ParamProofJSON) DeepCopy() ParamProofJSON { 298 return ParamProofJSON{ 299 SigHash: o.SigHash.DeepCopy(), 300 KbUsername: o.KbUsername, 301 } 302 } 303 304 type ParamProofUsernameConfig struct { 305 Re string `codec:"re" json:"re"` 306 Min int `codec:"min" json:"min"` 307 Max int `codec:"max" json:"max"` 308 } 309 310 func (o ParamProofUsernameConfig) DeepCopy() ParamProofUsernameConfig { 311 return ParamProofUsernameConfig{ 312 Re: o.Re, 313 Min: o.Min, 314 Max: o.Max, 315 } 316 } 317 318 type ParamProofServiceConfig struct { 319 Version int `codec:"version" json:"version"` 320 Domain string `codec:"domain" json:"domain"` 321 DisplayName string `codec:"displayName" json:"display_name"` 322 Description string `codec:"description" json:"description"` 323 UsernameConfig ParamProofUsernameConfig `codec:"usernameConfig" json:"username"` 324 BrandColor string `codec:"brandColor" json:"brand_color"` 325 PrefillUrl string `codec:"prefillUrl" json:"prefill_url"` 326 ProfileUrl string `codec:"profileUrl" json:"profile_url"` 327 CheckUrl string `codec:"checkUrl" json:"check_url"` 328 CheckPath []SelectorEntry `codec:"checkPath" json:"check_path"` 329 AvatarPath []SelectorEntry `codec:"avatarPath" json:"avatar_path"` 330 } 331 332 func (o ParamProofServiceConfig) DeepCopy() ParamProofServiceConfig { 333 return ParamProofServiceConfig{ 334 Version: o.Version, 335 Domain: o.Domain, 336 DisplayName: o.DisplayName, 337 Description: o.Description, 338 UsernameConfig: o.UsernameConfig.DeepCopy(), 339 BrandColor: o.BrandColor, 340 PrefillUrl: o.PrefillUrl, 341 ProfileUrl: o.ProfileUrl, 342 CheckUrl: o.CheckUrl, 343 CheckPath: (func(x []SelectorEntry) []SelectorEntry { 344 if x == nil { 345 return nil 346 } 347 ret := make([]SelectorEntry, len(x)) 348 for i, v := range x { 349 vCopy := v.DeepCopy() 350 ret[i] = vCopy 351 } 352 return ret 353 })(o.CheckPath), 354 AvatarPath: (func(x []SelectorEntry) []SelectorEntry { 355 if x == nil { 356 return nil 357 } 358 ret := make([]SelectorEntry, len(x)) 359 for i, v := range x { 360 vCopy := v.DeepCopy() 361 ret[i] = vCopy 362 } 363 return ret 364 })(o.AvatarPath), 365 } 366 } 367 368 type ServiceDisplayConfig struct { 369 CreationDisabled bool `codec:"creationDisabled" json:"creation_disabled"` 370 Priority int `codec:"priority" json:"priority"` 371 Key string `codec:"key" json:"key"` 372 Group *string `codec:"group,omitempty" json:"group,omitempty"` 373 New bool `codec:"new" json:"new"` 374 LogoKey string `codec:"logoKey" json:"logo_key"` 375 } 376 377 func (o ServiceDisplayConfig) DeepCopy() ServiceDisplayConfig { 378 return ServiceDisplayConfig{ 379 CreationDisabled: o.CreationDisabled, 380 Priority: o.Priority, 381 Key: o.Key, 382 Group: (func(x *string) *string { 383 if x == nil { 384 return nil 385 } 386 tmp := (*x) 387 return &tmp 388 })(o.Group), 389 New: o.New, 390 LogoKey: o.LogoKey, 391 } 392 } 393 394 type ExternalServiceConfig struct { 395 SchemaVersion int `codec:"schemaVersion" json:"schema_version"` 396 Display *ServiceDisplayConfig `codec:"display,omitempty" json:"display,omitempty"` 397 Config *ParamProofServiceConfig `codec:"config,omitempty" json:"config,omitempty"` 398 } 399 400 func (o ExternalServiceConfig) DeepCopy() ExternalServiceConfig { 401 return ExternalServiceConfig{ 402 SchemaVersion: o.SchemaVersion, 403 Display: (func(x *ServiceDisplayConfig) *ServiceDisplayConfig { 404 if x == nil { 405 return nil 406 } 407 tmp := (*x).DeepCopy() 408 return &tmp 409 })(o.Display), 410 Config: (func(x *ParamProofServiceConfig) *ParamProofServiceConfig { 411 if x == nil { 412 return nil 413 } 414 tmp := (*x).DeepCopy() 415 return &tmp 416 })(o.Config), 417 } 418 } 419 420 type ProveCommonInterface interface { 421 } 422 423 func ProveCommonProtocol(i ProveCommonInterface) rpc.Protocol { 424 return rpc.Protocol{ 425 Name: "keybase.1.proveCommon", 426 Methods: map[string]rpc.ServeHandlerDescription{}, 427 } 428 } 429 430 type ProveCommonClient struct { 431 Cli rpc.GenericClient 432 }