Skip to main content

openvpn_mgmt_codec/
client_deny.rs

1/// Denial of a `>CLIENT:CONNECT` or `>CLIENT:REAUTH` request.
2///
3/// Wire format: `client-deny {CID} {KID} "reason" ["client-reason"]`
4///
5/// Use the generated builder for ergonomic construction:
6///
7/// ```
8/// # use openvpn_mgmt_codec::ClientDeny;
9/// let deny = ClientDeny::builder()
10///     .cid(42)
11///     .kid(0)
12///     .reason("expired certificate")
13///     .client_reason("Your certificate has expired.")
14///     .build();
15/// ```
16#[derive(Debug, Clone, PartialEq, Eq, bon::Builder)]
17pub struct ClientDeny {
18    /// Client ID from the `>CLIENT:` notification.
19    pub cid: u64,
20
21    /// Key ID from the `>CLIENT:` notification.
22    pub kid: u64,
23
24    /// Server-side reason string (logged but not sent to client).
25    #[builder(into)]
26    pub reason: String,
27
28    /// Optional message sent to the client as part of AUTH_FAILED.
29    #[builder(into)]
30    pub client_reason: Option<String>,
31}