xmpp-parsers: Integrate sasl2 and sasl_cb into stream:features

This commit is contained in:
Emmanuel Gil Peyrot 2024-08-08 14:58:49 +02:00 committed by xmpp ftw
parent 7238ebc35e
commit 8e16ae1cbb

View file

@ -9,6 +9,8 @@ use xso::{AsXml, FromXml};
use crate::bind::BindFeature;
use crate::ns;
use crate::sasl2::Authentication;
use crate::sasl_cb::SaslChannelBinding;
use crate::stream_limits::Limits;
/// Wraps `<stream:features/>`, usually the very first nonza of a
@ -32,6 +34,14 @@ pub struct StreamFeatures {
#[xml(child(default))]
pub limits: Option<Limits>,
/// Extensible SASL Profile, a newer authentication method than the one from the RFC.
#[xml(child(default))]
pub sasl2: Option<Authentication>,
/// SASL Channel-Binding Type Capability.
#[xml(child(default))]
pub sasl_cb: Option<SaslChannelBinding>,
/// Other stream features advertised
///
/// If some features you use end up here, you may want to contribute
@ -86,7 +96,7 @@ mod tests {
assert_size!(SaslMechanisms, 12);
assert_size!(RequiredStartTls, 0);
assert_size!(StartTls, 1);
assert_size!(StreamFeatures, 40);
assert_size!(StreamFeatures, 92);
}
#[cfg(target_pointer_width = "64")]
@ -95,7 +105,7 @@ mod tests {
assert_size!(SaslMechanisms, 24);
assert_size!(RequiredStartTls, 0);
assert_size!(StartTls, 1);
assert_size!(StreamFeatures, 64);
assert_size!(StreamFeatures, 168);
}
#[test]