tokio-xmpp: publish auth method

This commit is contained in:
Jonas Schäfer 2025-11-12 12:07:32 +01:00
commit 3bda04124e
4 changed files with 10 additions and 1 deletions

View file

@ -1,5 +1,8 @@
Version NEXT:
0000-00-00 RELEASER <releaser@domain>
* Added:
- Expose `client_auth` method to allow manual stream setups for advanced
use cases.
* Fixed:
- Ignore missing "version" stream attribute for 0114 components.
- Gate `AsRawFd` behind `ktls` feature to make Windows build work again.

View file

@ -23,6 +23,11 @@ use crate::{
},
};
/// Run the authentication handshake on a given stream.
///
/// Uses the given `sasl_mechanisms` and `creds` to perform the full
/// authentication handshake. As authentication ends with a stream reset,
/// this returns the `stream` as [`InitiatingStream`] on success.
pub async fn auth<S: AsyncBufRead + AsyncWrite + Unpin>(
mut stream: XmppStream<S>,
sasl_mechanisms: &SaslMechanisms,

View file

@ -28,6 +28,7 @@ use crate::connect::TcpServerConnector;
mod iq;
pub(crate) mod login;
mod stream;
pub use login::auth;
pub use iq::{IqFailure, IqRequest, IqResponse, IqResponseToken};

View file

@ -128,7 +128,7 @@ pub use xso::{asxml::PrintRawXml, error::FromElementError};
#[doc(inline)]
/// Generic tokio_xmpp Error
pub use crate::error::Error;
pub use client::{Client, IqFailure, IqRequest, IqResponse, IqResponseToken};
pub use client::{auth as client_login, Client, IqFailure, IqRequest, IqResponse, IqResponseToken};
#[cfg(feature = "insecure-tcp")]
pub use component::Component;
pub use event::{Event, Stanza};