tokio-xmpp: publish auth method
This commit is contained in:
parent
65c3e0dee7
commit
3bda04124e
4 changed files with 10 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
Version NEXT:
|
Version NEXT:
|
||||||
0000-00-00 RELEASER <releaser@domain>
|
0000-00-00 RELEASER <releaser@domain>
|
||||||
|
* Added:
|
||||||
|
- Expose `client_auth` method to allow manual stream setups for advanced
|
||||||
|
use cases.
|
||||||
* Fixed:
|
* Fixed:
|
||||||
- Ignore missing "version" stream attribute for 0114 components.
|
- Ignore missing "version" stream attribute for 0114 components.
|
||||||
- Gate `AsRawFd` behind `ktls` feature to make Windows build work again.
|
- Gate `AsRawFd` behind `ktls` feature to make Windows build work again.
|
||||||
|
|
|
||||||
|
|
@ -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>(
|
pub async fn auth<S: AsyncBufRead + AsyncWrite + Unpin>(
|
||||||
mut stream: XmppStream<S>,
|
mut stream: XmppStream<S>,
|
||||||
sasl_mechanisms: &SaslMechanisms,
|
sasl_mechanisms: &SaslMechanisms,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ use crate::connect::TcpServerConnector;
|
||||||
mod iq;
|
mod iq;
|
||||||
pub(crate) mod login;
|
pub(crate) mod login;
|
||||||
mod stream;
|
mod stream;
|
||||||
|
pub use login::auth;
|
||||||
|
|
||||||
pub use iq::{IqFailure, IqRequest, IqResponse, IqResponseToken};
|
pub use iq::{IqFailure, IqRequest, IqResponse, IqResponseToken};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ pub use xso::{asxml::PrintRawXml, error::FromElementError};
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
/// Generic tokio_xmpp Error
|
/// Generic tokio_xmpp Error
|
||||||
pub use crate::error::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")]
|
#[cfg(feature = "insecure-tcp")]
|
||||||
pub use component::Component;
|
pub use component::Component;
|
||||||
pub use event::{Event, Stanza};
|
pub use event::{Event, Stanza};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue