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
// Namespace: "keybase.1"
// Protocol: "proveCommon"
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Serialize, Deserialize};
use serde_repr::{Deserialize_repr, Serialize_repr};use super::*;

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ProofState {
  None_0,
  Ok_1,
  Temp_failure_2,
  Perm_failure_3,
  Looking_4,
  Superseded_5,
  Posted_6,
  Revoked_7,
  Deleted_8,
  Unknown_type_9,
  Sig_hint_missing_10,
  Unchecked_11,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ProofStatus {
  None_0,
  Ok_1,
  Local_2,
  Found_3,
  Base_error_100,
  Host_unreachable_101,
  Permission_denied_103,
  Failed_parse_106,
  Dns_error_107,
  Auth_failed_108,
  Http_429_129,
  Http_500_150,
  Timeout_160,
  Internal_error_170,
  Unchecked_171,
  Missing_pvl_172,
  Base_hard_error_200,
  Not_found_201,
  Content_failure_202,
  Bad_username_203,
  Bad_remote_id_204,
  Text_not_found_205,
  Bad_args_206,
  Content_missing_207,
  Title_not_found_208,
  Service_error_209,
  Tor_skipped_210,
  Tor_incompatible_211,
  Http_300_230,
  Http_400_240,
  Http_other_260,
  Empty_json_270,
  Deleted_301,
  Service_dead_302,
  Bad_signature_303,
  Bad_api_url_304,
  Unknown_type_305,
  No_hint_306,
  Bad_hint_text_307,
  Invalid_pvl_308,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ProofType {
  None_0,
  Keybase_1,
  Twitter_2,
  Github_3,
  Reddit_4,
  Coinbase_5,
  Hackernews_6,
  Facebook_8,
  Generic_social_9,
  Generic_web_site_1000,
  Dns_1001,
  Pgp_1002,
  Rooter_100001,
}

pub struct SelectorEntry {
  pub isIndex: bool,
  pub index: i32,
  pub isKey: bool,
  pub key: Option<String>,
  pub isAll: bool,
  pub isContents: bool,
}

pub struct ParamProofJSON {
  pub sigHash: SigID,
  pub kbUsername: Option<String>,
}

pub struct ParamProofUsernameConfig {
  pub re: Option<String>,
  pub min: i32,
  pub max: i32,
}

pub struct ParamProofLogoConfig {
  pub svgBlack: Option<String>,
  pub svgFull: Option<String>,
}

pub struct ParamProofServiceConfig {
  pub version: i32,
  pub domain: Option<String>,
  pub displayName: Option<String>,
  pub logo: Option<ParamProofLogoConfig>,
  pub description: Option<String>,
  pub usernameConfig: ParamProofUsernameConfig,
  pub brandColor: Option<String>,
  pub prefillUrl: Option<String>,
  pub profileUrl: Option<String>,
  pub checkUrl: Option<String>,
  pub checkPath: Option<Vec<SelectorEntry>>,
  pub avatarPath: Option<Vec<SelectorEntry>>,
}

pub struct ServiceDisplayConfig {
  pub creationDisabled: bool,
  pub priority: i32,
  pub key: Option<String>,
  pub group: Option<String>,
  pub new: bool,
  pub logoKey: Option<String>,
}

pub struct ExternalServiceConfig {
  pub schemaVersion: i32,
  pub display: Option<ServiceDisplayConfig>,
  pub config: Option<ParamProofServiceConfig>,
}