openvpn_mgmt_codec/
auth.rs1use std::fmt;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
7pub enum AuthType {
8 Auth,
10
11 PrivateKey,
13
14 HttpProxy,
16
17 SocksProxy,
19
20 Custom(String),
22}
23
24impl fmt::Display for AuthType {
25 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26 match self {
27 Self::Auth => f.write_str("Auth"),
28 Self::PrivateKey => f.write_str("Private Key"),
29 Self::HttpProxy => f.write_str("HTTP Proxy"),
30 Self::SocksProxy => f.write_str("SOCKS Proxy"),
31 Self::Custom(s) => f.write_str(s),
32 }
33 }
34}
35
36#[derive(Debug, Clone, Copy, PartialEq, Eq)]
38pub enum AuthRetryMode {
39 None,
41
42 Interact,
44
45 NoInteract,
47}
48
49impl fmt::Display for AuthRetryMode {
50 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
51 match self {
52 Self::None => f.write_str("none"),
53 Self::Interact => f.write_str("interact"),
54 Self::NoInteract => f.write_str("nointeract"),
55 }
56 }
57}