nullnet_libappguard/proto/
appguard_commands.rs1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct AuthorizationRequest {
4 #[prost(string, tag = "1")]
5 pub uuid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub code: ::prost::alloc::string::String,
8 #[prost(string, tag = "3")]
9 pub category: ::prost::alloc::string::String,
10 #[prost(string, tag = "4")]
11 pub r#type: ::prost::alloc::string::String,
12 #[prost(string, tag = "5")]
13 pub target_os: ::prost::alloc::string::String,
14}
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct Authentication {
17 #[prost(string, tag = "1")]
18 pub app_id: ::prost::alloc::string::String,
19 #[prost(string, tag = "2")]
20 pub app_secret: ::prost::alloc::string::String,
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct ClientMessage {
24 #[prost(oneof = "client_message::Message", tags = "1, 2")]
25 pub message: ::core::option::Option<client_message::Message>,
26}
27pub mod client_message {
29 #[derive(Clone, PartialEq, ::prost::Oneof)]
30 pub enum Message {
31 #[prost(message, tag = "1")]
32 AuthorizationRequest(super::AuthorizationRequest),
33 #[prost(message, tag = "2")]
34 Authentication(super::Authentication),
35 }
36}
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct AuthenticationData {
39 #[prost(string, optional, tag = "1")]
40 pub app_id: ::core::option::Option<::prost::alloc::string::String>,
41 #[prost(string, optional, tag = "2")]
42 pub app_secret: ::core::option::Option<::prost::alloc::string::String>,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct ServerMessage {
46 #[prost(oneof = "server_message::Message", tags = "1, 2, 3, 4, 5, 6")]
47 pub message: ::core::option::Option<server_message::Message>,
48}
49pub mod server_message {
51 #[derive(Clone, PartialEq, ::prost::Oneof)]
52 pub enum Message {
53 #[prost(string, tag = "1")]
54 UpdateTokenCommand(::prost::alloc::string::String),
55 #[prost(message, tag = "2")]
56 SetFirewallDefaults(super::FirewallDefaults),
57 #[prost(message, tag = "3")]
58 Heartbeat(()),
59 #[prost(message, tag = "4")]
60 DeviceAuthorized(super::AuthenticationData),
61 #[prost(message, tag = "5")]
62 DeviceDeauthorized(()),
63 #[prost(message, tag = "6")]
64 AuthorizationRejected(()),
65 }
66}
67#[derive(serde::Deserialize)]
68#[derive(Clone, Copy, PartialEq, ::prost::Message)]
69pub struct FirewallDefaults {
70 #[prost(uint32, tag = "1")]
71 pub timeout: u32,
72 #[prost(enumeration = "FirewallPolicy", tag = "2")]
73 pub policy: i32,
74 #[prost(bool, tag = "3")]
75 pub cache: bool,
76}
77#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
78#[repr(i32)]
79pub enum FirewallPolicy {
80 Unknown = 0,
81 Allow = 1,
82 Deny = 2,
83}
84impl FirewallPolicy {
85 pub fn as_str_name(&self) -> &'static str {
90 match self {
91 Self::Unknown => "UNKNOWN",
92 Self::Allow => "ALLOW",
93 Self::Deny => "DENY",
94 }
95 }
96 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
98 match value {
99 "UNKNOWN" => Some(Self::Unknown),
100 "ALLOW" => Some(Self::Allow),
101 "DENY" => Some(Self::Deny),
102 _ => None,
103 }
104 }
105}