1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Default, PartialEq, Serialize)]
5pub struct GateVerifyRequest {
6 pub secret: String,
8 pub token: String,
9 #[serde(skip_serializing_if = "Option::is_none")]
10 pub remote_ip: Option<String>,
11}
12
13impl GateVerifyRequest {
14 pub fn new(secret: impl Into<String>, token: impl Into<String>) -> Self {
15 GateVerifyRequest {
16 secret: secret.into(),
17 token: token.into(),
18 remote_ip: None,
19 }
20 }
21}
22
23#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
25#[serde(default)]
26pub struct GateVerification {
27 pub success: bool,
28 pub class: String,
30 pub action: String,
32 pub mode: String,
34 pub confidence: f64,
35 pub network: GateNetwork,
36 pub signals: Vec<String>,
37 pub hostname: String,
38 pub issued_at: String,
39 pub ip_match: bool,
40 pub locked: Vec<String>,
41 #[serde(rename = "planRequired")]
42 pub plan_required: Option<String>,
43}
44
45#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
47#[serde(default)]
48pub struct GateNetwork {
49 pub classification: String,
50 pub anonymized: bool,
51 pub provider: Option<String>,
53 pub vpn_provider: Option<String>,
55}