nullnet_libappguard/proto/
appguard_commands.rs

1// This file is @generated by prost-build.
2#[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 org_id: ::prost::alloc::string::String,
8    /// Client Data
9    ///
10    /// Client category: App, Load balancer, Firewall, etc.
11    #[prost(string, tag = "3")]
12    pub category: ::prost::alloc::string::String,
13    /// Model of client, e.g. OPNSence vs PfSense.
14    #[prost(string, tag = "4")]
15    pub model: ::prost::alloc::string::String,
16    /// Client's operating system
17    #[prost(string, tag = "5")]
18    pub target_os: ::prost::alloc::string::String,
19}
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct Authentication {
22    #[prost(string, tag = "1")]
23    pub app_id: ::prost::alloc::string::String,
24    #[prost(string, tag = "2")]
25    pub app_secret: ::prost::alloc::string::String,
26}
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct ClientMessage {
29    #[prost(oneof = "client_message::Message", tags = "1, 2")]
30    pub message: ::core::option::Option<client_message::Message>,
31}
32/// Nested message and enum types in `ClientMessage`.
33pub mod client_message {
34    #[derive(Clone, PartialEq, ::prost::Oneof)]
35    pub enum Message {
36        #[prost(message, tag = "1")]
37        AuthorizationRequest(super::AuthorizationRequest),
38        #[prost(message, tag = "2")]
39        Authentication(super::Authentication),
40    }
41}
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct AuthenticationData {
44    #[prost(string, optional, tag = "1")]
45    pub app_id: ::core::option::Option<::prost::alloc::string::String>,
46    #[prost(string, optional, tag = "2")]
47    pub app_secret: ::core::option::Option<::prost::alloc::string::String>,
48}
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct ServerMessage {
51    #[prost(oneof = "server_message::Message", tags = "1, 2, 3, 4, 5, 6")]
52    pub message: ::core::option::Option<server_message::Message>,
53}
54/// Nested message and enum types in `ServerMessage`.
55pub mod server_message {
56    #[derive(Clone, PartialEq, ::prost::Oneof)]
57    pub enum Message {
58        #[prost(string, tag = "1")]
59        UpdateTokenCommand(::prost::alloc::string::String),
60        #[prost(message, tag = "2")]
61        SetFirewallDefaults(super::FirewallDefaults),
62        #[prost(message, tag = "3")]
63        Heartbeat(()),
64        #[prost(message, tag = "4")]
65        DeviceAuthorized(super::AuthenticationData),
66        #[prost(message, tag = "5")]
67        DeviceDeauthorized(()),
68        #[prost(message, tag = "6")]
69        AuthorizationRejected(()),
70    }
71}
72#[derive(serde::Deserialize)]
73#[derive(Clone, Copy, PartialEq, ::prost::Message)]
74pub struct FirewallDefaults {
75    #[prost(uint32, tag = "1")]
76    pub timeout: u32,
77    #[prost(enumeration = "FirewallPolicy", tag = "2")]
78    pub policy: i32,
79}
80#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
81#[repr(i32)]
82pub enum FirewallPolicy {
83    Unknown = 0,
84    Allow = 1,
85    Deny = 2,
86}
87impl FirewallPolicy {
88    /// String value of the enum field names used in the ProtoBuf definition.
89    ///
90    /// The values are not transformed in any way and thus are considered stable
91    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
92    pub fn as_str_name(&self) -> &'static str {
93        match self {
94            Self::Unknown => "UNKNOWN",
95            Self::Allow => "ALLOW",
96            Self::Deny => "DENY",
97        }
98    }
99    /// Creates an enum from field names used in the ProtoBuf definition.
100    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
101        match value {
102            "UNKNOWN" => Some(Self::Unknown),
103            "ALLOW" => Some(Self::Allow),
104            "DENY" => Some(Self::Deny),
105            _ => None,
106        }
107    }
108}