From d790e52506e3a7c61749ecbce10dfa3d3d8e8024 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 05:06:28 +0000 Subject: [PATCH] fix(NATSRS-009-2): Public Auth struct and constructor lack doc comments --- async-nats/src/auth.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/async-nats/src/auth.rs b/async-nats/src/auth.rs index 968c5c6da..be4e7fce3 100644 --- a/async-nats/src/auth.rs +++ b/async-nats/src/auth.rs @@ -1,17 +1,30 @@ use crate::{options::CallbackArg1, AuthError}; +/// Authentication configuration used to authenticate with the NATS server. +/// +/// This can include a JWT, an NKey, a signature callback, or simple +/// username/password or token credentials, depending on how the server is +/// configured to authenticate clients. #[derive(Default)] pub struct Auth { + /// A JWT used for authentication with the server. pub jwt: Option, + /// An NKey used for authentication with the server. pub nkey: Option, pub(crate) signature_callback: Option>>, + /// A signature, typically produced from signing a server-provided nonce + /// with an NKey, used for authentication with the server. pub signature: Option>, + /// The username used for basic username/password authentication. pub username: Option, + /// The password used for basic username/password authentication. pub password: Option, + /// A token used for token-based authentication. pub token: Option, } impl Auth { + /// Creates a new, empty `Auth` with all fields set to `None`. pub fn new() -> Auth { Auth::default() }